JUST SO SO之centOs 下 nginx安装

linux系统为Centos 64位

第一步:从http://Nginx.org/download/上下载相应的版本(或者wget http://Nginx.org/download/Nginx-1.11.13.tar.gz直接在Linux上用命令下载)

第二步:解压tar -zxvf Nginx-1.11.13.tar.gz

第三步:设置一下配置信息.make编译.make install安装

./configure && make && make install

在配置信息的时候,也就是在第三步,出现了一下错误

错误为:./configure: error: the HTTP rewrite module requires the PCRE library.

安装pcre-devel解决问题
yum -y install pcre-devel

还有可能出现:

错误提示:./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=<path> options.

解决办法:

yum -y install openssl openssl-devel

第四步:启动

/usr/Nginx/sbin/Nginx(/usr/Nginx/sbin/Nginx-t查看配置信息是否正确)

查看是否启动成功 ps -aux|grep Nginx

第五步:访问Nginx,出现如下图所示表示成功安装。



注:如果本机访问不到虚拟机上的Nginx可能是防火墙导致,可关闭防火墙chkconfig –level 35 iptables off

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native