The first is the Apache installation
Yum Install httpd
After the installation is complete, allow Apache to boot
Systemctl Enable Httpd.service
Then start the Apache service
Systemctl Start Httpd.service
Generally speaking, the system is open firewall, so we want to modify the system firewall, allow 80 port to pass
However, it seems that centos7 to the original firewall has been upgraded to become a firewall
The way to modify is as follows
Firewall-cmd--permanent--zone=public--add-service=http
Firewall-cmd--permanent--zone=public--add-service=https
Firewall-cmd--reload
In addition Firewal-cmd--list-all can view the rules of the current firewall
Other common commands about firewall can be seen here.
After that, I got it.
This is the time to enter your server's IP address to access the
The following page will appear
Then there is the installation of PHP
Yum Install PHP
It's okay.
Then restart some Apache services so that you can identify the PHP file
Systemctl Restart Httpd.service
You can then go to the/var/www/html/to create a PHP file to test
Vim phptest.php
<?php
Phpinfo ();
?>
: Wq
Then visit the <ip>/phptest.php
If the following page appears, it means success.
After the test, this is best to delete the bar, especially the public network of servers
Rm/var/www/html/phptest.php-f
This is the record I installed on the CentOS7 MySQL, there is a need to refer to the following