1.首先安装依赖包(依赖包有点多,我们采用yum的方式来安装)
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
tar -zxvf nginx-1.7.6.tar.gz
mv nginx-1.7.6 nginx
cd nginx
./configure
make
make install4.测试
/usr/local/nginx/nginx -t
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (2: No such file or directory) 2015/06/06 15:16:28 [emerg] 13663#0: open() "/usr/local/nginx/logs/access.log" failed (2: No such file or directory)
6.1创建文件夹logs
mkdir logs6.2创建文件
cd logs/
touch error.log
touch nginx.pid
/usr/local/nginx/nginx
我的个人网站:http://www.caicongyang.com
我的CSDN博客地址: http://blog.csdn.net/caicongyang
原文地址:http://blog.csdn.net/caicongyang/article/details/46388845