centos下安装nginx
[root@iZ258gu0zkwZ tmp]# wget http://nginx.org/download/nginx-1.9.4.tar.gz
[root@iZ258gu0zkwZ tmp]# tar zxvf nginx-1.9.4.tar.gz
[root@iZ258gu0zkwZ tmp]# cd nginx-1.9.4
[root@iZ258gu0zkwZ nginx-1.9.4]# ./configure --prefix=/opt/nginx --with-http_stub_status_module
出错:
./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.
安装pcre,可提示已是最新版本:
[root@iZ258gu0zkwZ nginx-1.9.4]# yum install pcre
Loaded plugins: security
Setting up Install Process
Package pcre-6.6-9.el5.i386 already installed and latest version
Nothing to do
现在是需要1.7.11以上的支持多线程模型的nginx版本,直接用yum查看nginx版本是0.8几,如下处理:
[root@iZ258gu0zkwZ nginx-1.9.4]# rpm -ivh http://nginx.org/packages/centos/5/i386/RPMS/nginx-1.8.0-1.el5.ngx.i386.rpm
Retrieving http://nginx.org/packages/centos/5/i386/RPMS/nginx-1.8.0-1.el5.ngx.i386.rpm
warning: /var/tmp/rpm-xfer.Zua6AN: Header V3 RSA/SHA1 signature: NOKEY, key ID 7bd9bf62
Preparing... ########################################### [100%]
1:nginx ########################################### [100%]
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
[root@iZ258gu0zkwZ nginx-1.9.4]# yum info nginx
Loaded plugins: security
Installed Packages
Name : nginx
Arch : i386
Version : 1.8.0
Release : 1.el5.ngx
Size : 746 k
Repo : installed
Summary : High performance web server
URL : http://nginx.org/
License : 2-clause BSD-like license
Description: nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server.
再执行安装:
[root@iZ258gu0zkwZ nginx-1.9.4]# yum install nginx
Loaded plugins: security
Setting up Install Process
Package matching nginx-0.8.55-6.el5.i386 already installed. Checking for update.
N
[root@iZ258gu0zkwZ tmp]# wget http://nginx.org/download/nginx-1.9.4.tar.gz
[root@iZ258gu0zkwZ tmp]# tar zxvf nginx-1.9.4.tar.gz
[root@iZ258gu0zkwZ tmp]# cd nginx-1.9.4
[root@iZ258gu0zkwZ nginx-1.9.4]# ./configure --prefix=/opt/nginx --with-http_stub_status_module
出错:
./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.
安装pcre,可提示已是最新版本:
[root@iZ258gu0zkwZ nginx-1.9.4]# yum install pcre
Loaded plugins: security
Setting up Install Process
Package pcre-6.6-9.el5.i386 already installed and latest version
Nothing to do
现在是需要1.7.11以上的支持多线程模型的nginx版本,直接用yum查看nginx版本是0.8几,如下处理:
[root@iZ258gu0zkwZ nginx-1.9.4]# rpm -ivh http://nginx.org/packages/centos/5/i386/RPMS/nginx-1.8.0-1.el5.ngx.i386.rpm
Retrieving http://nginx.org/packages/centos/5/i386/RPMS/nginx-1.8.0-1.el5.ngx.i386.rpm
warning: /var/tmp/rpm-xfer.Zua6AN: Header V3 RSA/SHA1 signature: NOKEY, key ID 7bd9bf62
Preparing... ########################################### [100%]
1:nginx ########################################### [100%]
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
[root@iZ258gu0zkwZ nginx-1.9.4]# yum info nginx
Loaded plugins: security
Installed Packages
Name : nginx
Arch : i386
Version : 1.8.0
Release : 1.el5.ngx
Size : 746 k
Repo : installed
Summary : High performance web server
URL : http://nginx.org/
License : 2-clause BSD-like license
Description: nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server.
再执行安装:
[root@iZ258gu0zkwZ nginx-1.9.4]# yum install nginx
Loaded plugins: security
Setting up Install Process
Package matching nginx-0.8.55-6.el5.i386 already installed. Checking for update.
N