实验环境:CentOS7
实验步骤:
安装httpd服务:yum -y install httpd
关闭SELinux:setenforce 0
禁用防火墙策略:iptables -F
启动httpd服务:systemctl start httpd
启动进程后,在不重启服务的情况下,生效对配置文件的修改(用kill -1):kill -1 PID(httpd)
[root@localhost ~]#netstat -ntlp #查看80端口是否启动
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:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2257/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1001/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 946/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2159/master
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 35010/sshd: root@pt
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 35946/sshd: root@pt
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::80 :::* LISTEN 44037/httpd
tcp6 0 0 :::22 :::* LISTEN 1001/sshd
tcp6 0 0 ::1:631 :::* LISTEN 946/cupsd
tcp6 0 0 ::1:25 :::* LISTEN 2159/master
tcp6 0 0 ::1:6010 :::* LISTEN 35010/sshd: root@pt
tcp6 0 0 ::1:6011 :::* LISTEN 35946/sshd: root@pt
[root@localhost ~]#iptables -F #禁用防火墙策略
[root@localhost conf]#getenforce #关闭SELinux
Enforcing
[root@localhost conf]#setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]
[root@localhost conf]#setenforce 0
[root@localhost conf]#getenforce
Permissive