ArvinHao

人生若只如初见,何事秋风悲画扇。

12/31
17:05
教程

AMH4.2升级PHP5.6

其实超级简单的,看下面,一步一步照做就行了

wget http://git.oschina.net/renhao/re ... .2/php-5.6.4.tar.gz
tar zxvf php-5.6.4.tar.gz
cd php-5.6.4
./configure --prefix=/usr/local/php --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-openssl --with-zlib  --with-curl --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --enable-mbstring --enable-zip --with-iconv=/usr/local/libiconv --with-mysql=/usr/local/mysql --without-pear --disable-fileinfo --enable-opcache
make
make install

最后修改下配置就好了

echo listen.owner = www  >> /usr/local/php/etc/php-fpm.conf
echo listen.group = www  >> /usr/local/php/etc/php-fpm.conf
echo listen.mode = 0660  >> /usr/local/php/etc/php-fpm.conf

然后类似的也改一下php-fpm-template.conf /usr/local/php/etc/fpm下面的配置文件 然后重启下php就好了

amh php restart

这样就行了。

12/3
18:14
教程

centos配置socks5服务器(ss5)

1.安装gcc make依赖包

yum -y install pam-devel openldap-devel cyrus-sasl-devel gcc automake make openssl openssl-devel

2. 下载

wget http://heanet.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz

tar -zxvf ss5-3.8.9-8.tar.gz

cd ss5-3.8.9-8

3.编译

./configure && make && make install

4.修改配置

/etc/opt/ss5/ss5.conf

修改:
#auth 0.0.0.0/0 – -
改成:
auth 0.0.0.0/0 – u

修改:
#permit – 0.0.0.0/0 – 0.0.0.0/0 – – – – -
改成:
permit u 0.0.0.0/0 – 0.0.0.0/0 – – – – -

5.设置用户密码

/etc/opt/ss5/ss5.passwd  一行一个用户+密码

6.启动

/etc/rc.d/init.d/ss5 start

 

7,修改端口

/etc/init.d/ss5    编辑这个文件,内容自行研究

11/30
12:59
教程

ngx_pagespeed安装与使用

ngx_pagespeed是谷歌为nginx开发的一个模块,谷歌官方是这么描述的:

PageSpeed speeds up your site and reduces page load time. This open-source webserver module automatically appliesweb performance best practices to pages and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow.

如何英文不错的话可以去官方查看英文教程,谷歌已经写得非常详细了   官方  (自带梯子)

补充一点:tengine 2.0.3版在编译中会出错,谷歌工程师回复我的邮件中说这个问题已经解决(1,使用最新版本仓库源码 2,自己动手修改源码的一行)

建议还是使用nginx.tengine不知怎么的很久木更新了

1.安装编译环境,已经装过的略过这一步

红帽系:redhat centos dedora

sudo yum install gcc-c++ pcre-dev pcre-devel zlib-devel make

debian系:debian ubuntu

sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev

2.下载pagespeed

NPS_VERSION=1.9.32.2 #最新版本可去官网查看
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-${NPS_VERSION}-beta.zip
unzip release-${NPS_VERSION}-beta.zip
cd ngx_pagespeed-release-${NPS_VERSION}-beta/
wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}.tar.gz
tar -xzvf ${NPS_VERSION}.tar.gz # extracts to psol/

3. build nginx with support for pagespeed #没有安装NGINX的还需要下载,至于下载官方也有

./configure --add-module=$HOME/ngx_pagespeed-release-${NPS_VERSION}-beta
make  #记得在这基础上加上之前的配置,新安装的就无所谓了
sudo make install

4.启用
配置文件里面添加下面的内容

pagespeed on;

# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;

# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ ".pagespeed.([a-z].)?[a-z]{2}.[^.]{10}.[^.]+" {
 add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }

5.重启nginx