微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

原文地址:https://www.jb51.cc/centos/377926.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。