./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-pcre
make && make install
1.2.5. 修改Nginx配置文件
vi /usr/local/webserver/nginx/conf/fastcgi_params
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
vi /usr/local/webserver/nginx/conf/nginx.conf
worker_processes 4;
events {
use epoll;
worker_connections 8192;
}
gzip on;
1.2.6. 添加service
vi /etc/init.d/nginx
#!/bin/bash# nginx Startup script for the Nginx HTTP Server# it is v.0.0.2 version.# chkconfig: - 85 15# description: Nginx is a high-performance web and proxy server.# It has a lot of features, but it's not for everyone.# processname: nginx# pidfile: /usr/local/webserver/nginx/logs/nginx.pid# config: /usr/local/webserver/nginx/conf/nginx.conf
nginxd=/usr/local/webserver/nginx/sbin/nginx
nginx_config=/usr/local/webserver/nginx/conf/nginx.conf
nginx_pid=/usr/local/webserver/nginx/logs/nginx.pid
RETVAL=0
prog="nginx"# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] &