nginx的安装方法:
查看软件有没有安装:rpm -qa |grep name_of_software
下载nginx的tar.gz包:
wget http://nginx.org/download/nginx-0.8.33.tar.gz
解压tar.gz包:
tar -zxvf nginx-0.8.33.tar.gz
进入解压后的文件夹:
cd nginx-0.8.33
配置:
./configure --prefix=/usr/local/nginx
其中:prefix代表需要将nginx安装在什么地方
安装Nginx时报错:
(1)
错误提示:./configure: error: the HTTP rewrite module requires the PCRE library.
解决方法:
安装pcre-devel解决问题
yum -y install pcre-devel
(2)
错误提示:./configure: error: the HTTP cache module requires md5 functions
from OpenSSL library. You can either disable the module by using
--without-http-cache option, or install the OpenSSL library into the system,
or build the OpenSSL library statically from the source with nginx by using
--with-http_ssl_module --with-openssl=
解决办法:
yum -y install openssl openssl-devel
./configure --prefix=/usr/local/nginx --with-md5=/usr/lib --with-http_stub_status_module --with-http_ssl_module --with-openssl=/usr/lib
然后编译执行:
make
执行安装
make install
这里nginx已经安装好了,进入/user/local/nginx/sbin下,运行./nginx,就可以启动了。