JUST SO SO之centOs 下 nginx安装

前端之家收集整理的这篇文章主要介绍了JUST SO SO之centOs 下 nginx安装前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

linux系统为Centos 64位@H_301_5@

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

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

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

./configure && make && make install@H_301_5@

@H_301_5@

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

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

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

还有可能出现:@H_301_5@

错误提示:./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.
@H_301_5@

解决办法:@H_301_5@

yum -y install openssl openssl-devel@H_301_5@

第四步:启动@H_301_5@

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

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

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


@H_301_5@


@H_301_5@

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

@H_301_5@

猜你在找的CentOS相关文章