ubuntu11.04编译安装nginx1.0.5
2014-03-30 21:59
501 查看
原文地址:
http://blog.csdn.net/duck_genuine/article/details/6760893
http://www.ligaofeng.com/?p=1107
admin 撰写 http://www.ligaofeng.com/?p=1107
1、 PCRE库的安装:
官网:http://www.pcre.org/
下载页面:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
选择最新版本下载:
2、 OpenSSL库的安装
官网:http://www.openssl.org
下载页面:http://www.openssl.org/source/
选择最新版本下载:
zlib安装
http://www.zlib.net/
2、ngnix安装
选择最新版本下载:
修改/usr/local/nginx/conf/nginx.conf配置文件后,用命令/usr/local/nginx/sbin/nginx -t 检查配置文件是否正确
如果报:
./nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
错误而导致nginx不能启动,可用:
ln -s /usr/local/lib/libpcre.so.0 /usr/lib/libpcre.so.0
解决。
4、启动及停止nginx的命令
也可通过向nginx进程发送信号来停止nginx
步骤1:查询nginx主进程号
ps -ef | grep nginx
在进程列表里面找master进程,它的编号就是主进程号了。
步骤2:发送信号
从容停止Nginx:
kill -QUIT 主进程号
快速停止Nginx:
kill -TERM 主进程号
强制停止Nginx:
pkill -9 nginx
参考信息:http://wiki.nginx.org/NginxChsInstallOptions
遇到的问题:
没有nginx,logs目录访问权限
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
2014/03/30 22:34:22 [emerg] 12209#0: open() "/usr/local/nginx/logs/nginx.pid" failed (13: Permission denied)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
解决办法:
sudo chmod a+rwx -R logs
sudo chmod a+rwx -R /usr/local/nginx
现在的信息:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
http://blog.csdn.net/duck_genuine/article/details/6760893
http://www.ligaofeng.com/?p=1107
ubuntu11.04编译安装nginx1.0.5
由admin 撰写 http://www.ligaofeng.com/?p=1107
1、 PCRE库的安装:
官网:http://www.pcre.org/
下载页面:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
选择最新版本下载:
1 2 3 4 5 | #wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.12.tar.gz #tar zxvf pcre-8.12.tar.gz #cd pcre-8.12 #./configure –prefix=/usr/local/pcre #make && make install |
官网:http://www.openssl.org
下载页面:http://www.openssl.org/source/
选择最新版本下载:
1 2 3 | #wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz #tar zxvf openssl-1.0.0d.tar.gz #mv openssl-1.0.0d openssl |
http://www.zlib.net/
1 2 34 | #wget http://www.gzip.org/zlib/zlib-1.2.3.tar.gz #./configure #make #make install |
选择最新版本下载:
1 2 3 4 56 | #groupadd nginx #useradd -r -g nginx nginx #wget http://nginx.org/download/nginx-1.0.5.tar.gz #tar zxvf nginx-1.0.5.tar.gz #cd nginx-1.0.5 #sudo ./configure --prefix=/usr/local/nginx --with-openssl=/usr/local/openssl/ --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --user=nginx --group=nginx #sudo make #sudo make install |
如果报:
./nginx: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
错误而导致nginx不能启动,可用:
ln -s /usr/local/lib/libpcre.so.0 /usr/lib/libpcre.so.0
解决。
4、启动及停止nginx的命令
1 2 | #/usr/sbin/nginx #/usr/sbin/nginx -s stop |
步骤1:查询nginx主进程号
ps -ef | grep nginx
在进程列表里面找master进程,它的编号就是主进程号了。
步骤2:发送信号
从容停止Nginx:
kill -QUIT 主进程号
快速停止Nginx:
kill -TERM 主进程号
强制停止Nginx:
pkill -9 nginx
参考信息:http://wiki.nginx.org/NginxChsInstallOptions
遇到的问题:
没有nginx,logs目录访问权限
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (13: Permission denied)
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
2014/03/30 22:34:22 [emerg] 12209#0: open() "/usr/local/nginx/logs/nginx.pid" failed (13: Permission denied)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
解决办法:
sudo chmod a+rwx -R logs
sudo chmod a+rwx -R /usr/local/nginx
现在的信息:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
相关文章推荐
- ubuntu11.04编译安装nginx1.0.5
- linux下软件的源码编译安装(以nginx源码安装为实例)
- 源码编译安装Nginx服务
- 获取安装后Apache、MySQL、Nginx、PHP编译时参数
- linux编译安装Nginx1.6.0+MySQL5.6.19+PHP5.5.14
- linux (Centos7) 编译安装nginx
- 编译安装nginx
- nginx自编译安装
- CentOS编译安装Nginx1.5.2+PHP5.5.1+ MySQL 5.6.1
- Centos 6.5 编译安装Nginx+php+Mysql
- Ubuntu14.04 64bit 编译安装nginx1.7+php5.4+mysql5.6
- ubuntu下nginx编译安装
- Nginx 1.5.0 + PHP 5.4.15 + MySQL 5.6.10 在 CentOS 下的编译安装
- 编译nginx的源码安装subs_filter模块
- 安装成功的nginx如何添加未编译安装模块
- centos 7 编译安装nginx 及添加 nginx 到系统服务
- Linux环境下编译安装Nginx以及Lua环境
- nginx编译安装和基于域名的虚拟主机配置
- nginx 学习笔记(一)nginx 编译安装
- 源码编译安装nginx