centos 安装nginx遇到的问题

1、

checking for OS
+ Linux 3.10.0-327.el7.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found

解决方法:安装gcc

yum -y install gcc

2、the HTTP rewrite module requires the PCRE library

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

3、the HTTP gzip module requires the zlib library.

解决方法:安装zlib-devel

yum -y install zlib-devel

4、bash: make: 未找到命令

解决方法:yum -y install gcc automake autoconf libtool make

5、查看进程

ps -ef |grep nginx

6、查看端口

netstat -ntlp|grep 80

7、开放80端口对外访问

firewall-cmd --zone=public --add-port=80/tcp --permanent(执行完之后要重启防火墙才能看到加入的规则)

8、重启防火墙:firewall-cmd --reload  

9、查看已经开放的端口:firewall-cmd --list-ports  

原文地址:https://www.cnblogs.com/niuniu0108/p/12335492.html