Linux tar包安装Nginx
1.首先安装依赖包(依赖包有点多,我们采用yum的方式来安装)
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
2.将nginx-1.7.6.tar.gz上传到/usr/local/下
tar -zxvf nginx-1.7.6.tar.gz
3.重命名包名称,讲nginx-1.7.6改为nginx
mv nginx-1.7.6 nginx
3.编译
cd nginx
./configure
make
make install4.测试
/usr/local/nginx/nginx -t
5.问题:
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.解决方案
6.1创建文件夹logs
mkdir logs6.2创建文件
cd logs/
touch error.log
touch nginx.pid
7.启动
/usr/local/nginx/nginx
看到
Welcome to nginx!
我的个人网站:http://www.caicongyang.com
我的CSDN博客地址: http://blog.csdn.net/caicongyang
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。