1.安装pcre
yum install pcre-devel
2.安装zlib库安装
tar -zxvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
./configure
make
makeinstall
3.安装openSSL库
./config
make
make install
4.安装nginx
tar zxvf nginx-0.7.65.tar.gz
cd nginx-0.7.65
./configure
make
install
检测是否安装成功
cd /usr/local/nginx/sbin
./nginx -t
结果显示:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
5.启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
-c指定了配置文件路径,如不给这-c,会默认加载安装目录的conf下的nginx.conf
转载于:https://www.cnblogs.com/tzp_8/archive/2012/11/12/2766205.html