码迷,mamicode.com
首页 > 系统相关 > 详细

Linux tar包安装Nginx

时间:2015-06-06 16:37:53      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:linux tar包安装nginx   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 install
4.测试

/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 logs
6.2创建文件

 cd logs/

touch error.log

touch nginx.pid

7.启动

/usr/local/nginx/nginx

看到

Welcome to nginx!

说明nginx初步启动配置成功了!





我的个人网站:http://www.caicongyang.com

我的CSDN博客地址: http://blog.csdn.net/caicongyang 








Linux tar包安装Nginx

标签:linux tar包安装nginx   nginx安装   

原文地址:http://blog.csdn.net/caicongyang/article/details/46388845

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!