centos7 installation configuration apache

1, the mounting apache

yum install httpd 

2, start the test

systemctl start httpd // restart (restart)

3, check the running status

service httpd status

4, configuration httpd.conf file, change the AllowOverride All.

vim /etc/httpd/conf/httpd.conf

5, see already open ports

firewall-cmd --list-ports

If there is no port 80

Open port

firewall-cmd --zone=public --add-port=80/tcp --permanent

Command Meaning:

-zone # Scope

-add-port = 80 / tcp # Add port, the format is: port / protocol

-permanent # permanent, this parameter does not restart after failure

6, reboot the firewall

firewall-cmd --reload #重启firewall

systemctl stop firewalld.service #停止firewall

disable firewalld.service systemctl # prohibit firewall boot

cmd-Firewall - State # view the default firewall status (closed after displaying notrunning, display running after opening)

7, ip access

 --------------------- restart the server finds firewalld not open

1, view operational status firewalld

systemctl status firewalld

Active: inactive (dead) for the dead means not start

2, start firewalld

systemctl start firerwalld

In view status

systemctl status firewalld

Active: active (running) is running indicates start

Guess you like

Origin www.cnblogs.com/sheshidu/p/11614604.html