新建用户及用户组
groupadd webuseruseradd -g webuser webuser下载nginx-1.5.2下载地址:http://pan.baidu.com/s/1gd1khcJ
#解包tar zxvf nginx-1.5.2.tar.gzcd nginx-1.5.2./configure --prefix=/server/nginx \--user=webuser \--group=webuser \--http-log-path=/server/nginx/var/log/access.log \--error-log-path=/server/nginx/var/log/error.log \--conf-path=/server/nginx/conf/nginx.conf \--sbin-path=/server/nginx/sbin/nginx \--pid-path=/server/nginx/var/run/nginx.pid \--with-http_ssl_module \--with-http_realip_module \--with-http_addition_module \--with-http_sub_module \--with-http_dav_module \--with-http_flv_module \--with-http_gzip_static_module \--with-http_stub_status_module#编译 并 安装make && make install#设置文件夹属主chown -R webuser:webuser /server/nginx# 检查配置文件是否正确这里可以察看配置文件路径,以及检查配置是否有错误/server/nginx/sbin/nginx -t#启动服务/server/nginx/sbin/nginx#停止服务/server/nginx/sbin/nginx -s stop#重新加载配置/server/nginx/sbin/nginx -s reload