CentOS 7上安装Apache
安装apache yum install httpd vi /etc/httpd/conf/httpd.conf 修改默认端口为81 service httpd start netstat -nltp [root@xxx html]# netstat -nltp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 101785/httpd sudo firewall-cmd --permanent --zone=public --add-service=http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload sudo systemctl status httpd sudo systemctl enable httpd sudo systemctl stop httpd sudo systemctl start httpd sudo yum install httpd sudo yum reinstall httpd netstat -nltp