nginx编译安装
2015-01-15 01:37
260 查看
nginx编译安装
下载安装包 nginx-1.3.15.tar.gz
tar zxvf nginx-1.3.15.tar.gz
cd nginx-1.3.15/
进行编译
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
make && make install
遇到的问题
./configure: error: C compiler cc is not found
解决方法:yum -y install gcc
安装GCC后再次运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
报错:
hecking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决方法:yum -y install pcre-devel
再次运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
报错:
checking for PCRE JIT support ... not found
checking for OpenSSL library ... not found
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
解决方法:yum -y install openssl openssl-devel
最后运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
make && make install
安装完毕后用/usr/local/nigix/sbin/
启动nginx #./nginx
启动nginx2 /usr/local/nginx/sbin/nginx
遇到的问题
启动nginx报nginx: [emerg] getpwnam("www") failed
在nginx.conf中 把user nobody的注释去掉既可
检查是否启动成功:
netstat -ano|grep 80 有结果输入说明启动成功
打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功
ps:注意:此处需要关闭防火墙 service iptables stop
![](https://images0.cnblogs.com/blog/708415/201501/150148027145461.png)
重启
/usr/local/nginx/sbin/nginx –s reload
或者 killall -HUP nginx
参考链接:http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html
下载安装包 nginx-1.3.15.tar.gz
tar zxvf nginx-1.3.15.tar.gz
cd nginx-1.3.15/
进行编译
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
make && make install
遇到的问题
./configure: error: C compiler cc is not found
解决方法:yum -y install gcc
安装GCC后再次运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
报错:
hecking for PCRE library ... not found
checking for PCRE library in /usr/local/ ... not found
checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
解决方法:yum -y install pcre-devel
再次运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
报错:
checking for PCRE JIT support ... not found
checking for OpenSSL library ... not found
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
解决方法:yum -y install openssl openssl-devel
最后运行
./configure --user=www --group=www --prefix=/usr/local/nginx
\--with-http_stub_status_module --with-http_ssl_module
make && make install
安装完毕后用/usr/local/nigix/sbin/
启动nginx #./nginx
启动nginx2 /usr/local/nginx/sbin/nginx
遇到的问题
启动nginx报nginx: [emerg] getpwnam("www") failed
在nginx.conf中 把user nobody的注释去掉既可
检查是否启动成功:
netstat -ano|grep 80 有结果输入说明启动成功
打开浏览器访问此机器的 IP,如果浏览器出现 Welcome to nginx! 则表示 Nginx 已经安装并运行成功
ps:注意:此处需要关闭防火墙 service iptables stop
![](https://images0.cnblogs.com/blog/708415/201501/150148027145461.png)
重启
/usr/local/nginx/sbin/nginx –s reload
或者 killall -HUP nginx
参考链接:http://www.cnblogs.com/zhuhongbao/archive/2013/06/04/3118061.html
![](file:///C:\Users\An\AppData\Roaming\Tencent\Users\986843789\QQ\WinTemp\RichOle\0O~)P%K1D9%XR54VG7J3$%0.png)
相关文章推荐
- Nginx实用指南V1 (连载之二:Nginx安装与编译优化) 推荐
- 编译安装nginx with uwsgi module on centos
- nginx编译安装
- nginx介绍以及编译安装
- ubuntu11.04编译安装nginx1.0.5
- [转载]Nginx源码学习之编译、构建与安装(cygwin环境)
- LNMP一键安装包-CentOS 5/6下自动编译安装Nginx,MySQL,PHP,memcached
- CentOS 编译 nginx+php+mysql 安装手记
- CentOS 编译 nginx+php+mysql 安装手记
- CentOS 5.6(X64)下编译安装LNMP平台(Nginx1.0+PHP5.3.6+Mysql5.5.11)
- 编译安装spawn-fcgi(nginx通过FastCGI方式调用PHP)
- Linux 编译安装Nginx 配置 Python FastCGI Django (1) 编译安装nginx
- Ubuntu下自动编译安装Nginx、Mysql、PHP、Memcache、eaccelerator
- nginx编译安装和常规配置
- nginx基本编译安装部署
- 编译安装nginx with uwsgi module on centos
- 编译安装nginx [Ubuntu]
- Linux 编译安装Nginx 配置 Python FastCGI Django (3) 配置nginx和django
- CentOS下编译安装Nginx+PHP+MySQL
- Ubuntu 11.04编译安装nginx、PHP 5.3、mysql、mongodb、memcached、ssl、smtp