CentOS7 install Apache with PHP with new firewall configuration ____php

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.