2 安装pcre 让nginx支持rewrite 方便以后所需
wget ftp://ftp.csx.cam.ac.uk/pub/soft ... cre/pcre-7.8.tar.gz
tar zxvf pcre-7.8.tar.gz
cd pcre-7.8/
./configure
make && make install
3 安装nginx
wget http://sysoev.ru/nginx/nginx-0.7.58.tar.gz
tar zxvf nginx-0.7.58.tar.gz
cd nginx-0.7.58/
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-cc-opt='-O2' --with-cpu-opt=opteron
make && make install
第2部分:Nginx 反向代理的配置及优化配置文件
1 nginx.conf 配置文件:
user www www;
worker_processes 4;
# [ debug | info | notice | warn | error | crit ]
error_log /usr/local/webserver/nginx/logs/nginx_error.log crit;
pid /usr/local/webserver/nginx/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
第4部分HP的优化
优化一:将PHP由之前的xcache换成eaccelerator
1 安装
wget http://bart.eaccelerator.net/sou ... tor-0.9.5.3.tar.bz2
tar jxvf eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3/
/usr/local/webserver/php/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php5/bin/php-config
make
make install
注HP路径以安装为准!
2 配置
sed -i 's#extension_dir = "./"#extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/"\nextension = "memcache.so"\n#' /etc/php.ini
sed -i 's#output_buffering = Off#output_buffering = On#' /etc/php.ini
sed -i "s#; always_populate_raw_post_data = On#always_populate_raw_post_data = On#g" /etc/php.ini