实际环境中安装Nginx,首先需要安装pcre库,然后再安装Nginx: 先安装 openssl-1.0.0 pcre-8.21 zlib-1.2.7;
解压,./configure;make makeinstall
#下载Nginx源码包 cd /usr/src ;wget -c http://nginx.org/download/nginx-1.2.6.tar.gz #解压Nginx源码包 tar -xzf nginx-1.2.6.tar.gz #进入解压目录,然后sed修改Nginx版本信息为TDTWS cd nginx-1.2.6 ; sed -i -e 's/1.2.6//g' -e 's/nginx\//TDTWS/g' -e 's/"NGINX"/"TDTWS"/g' src/core/nginx.h #预编译Nginx ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.21/
#自此Nginx安装完毕!!!
cd /opt/nginx
./nginx
#查看是否启动成功
ps -ef |grep nginx (netstat -anp |grep nginx)