CentOS 7桌面版安装nginx常见问题

Nginx安装
https://blog.huojt.top/articles/2020/08/07/1596808632021.html

编译安装nginx报错 checking for C compiler ... not found

编译安装在执行./configure步骤报错,是因为缺少环境变量

checking for C compiler … not found
./configure: error: C compiler cc is not found

解决办法

 yum -y install gcc
 yum -y install gcc-c++

./configure: error

./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= option.

解决办法

yum -y install openssl openssl-devel

安装运行之后本地浏览器输入ip无法访问

解决办法:永久关闭防火墙

查看防火墙状态:

systemctl status firewalld.service

如上图:防火墙运行状态

执行关闭命令:

systemctl stop firewalld.service

再次执行查看防火墙命令:

systemctl status firewalld.service
如下图所示表示防火墙已经关闭

执行开机禁用防火墙自启命令 :

systemctl disable firewalld.service
完成

关于防火墙的其他命令:

启动:

systemctl start firewalld.service

防火墙随系统开启启动 :

systemctl enable firewalld.service

posted @ 2020-08-08 09:17  德华。  阅读(256)  评论(0编辑  收藏  举报