We talked about basic package management and file operation, and now we have to install something useful!
In this article I will write a method to install Apache, PHP, and MySQL with Yum , and then run phpMyAdmin to manage the database.
1. How to install Apache on a Linux host
Since we installed the completed CentOS system before, it may be possible that the system is already installed Apache, so let's check if it's really installed.
Hit the command first, yum list installed httpd*, if you see httpd already installed, then yum-y remove httpd* Uninstall off. Let's review the software management you've taught before.
After uninstalling, install Apache now,
After the installation is complete, then, add httpd to boot (with chkconf httpd on to boot, with chkconfig--list httpd check the status)
Set up the boot start, we check again, now this moment is Apache open it? (with service httpd status)
The service httpd status checks the httpd status and gets the result of the stop, stating that it is not running
We opened the service httpd start again, but we also saw the httpd sent us a reminder:
Httpd:could not reliably determine the server ' s fully qualified domain name, using Localhost.localdomain for ServerName
Let's hurry. Modify Apache configuration file (vi/etc/httpd/conf/httpd.conf)
After entering the file query under ServerName, (vi Editor's query is to first press the keyboard/symbol, then you can type, case-sensitive OH. Press ENTER when you are finished typing)
Press the left and right button can slow rolling screen, press ctrl+f can turn the page, press ctrl+b can page up.
Find out if there is a line #serverName www.example.com:80, the previous # to delete the good.
Delete the method is to press the I letter, then the editor into the editable mode, and then press the left and right to move the cursor behind the #, and then press the keyboard [←backspace]
After deletion, press shift+, which is equivalent to the bottom left corner of the editor: symbol, followed by the input W and q, equivalent to: Wq, this is the meaning of saving and exit.
And then we'll restart the APAHCE.
OK, there's no hint this time.
Then we enter 192.168.229.128 in the browser and try to see what we can browse. Guess it doesn't show anything, does it? Not responding?
Then we need to continue to enter the command, clear the IP policy iptables-f (what is this thing?) We will elaborate later.)
Above, Iptables-f first clear, iptables-nl--line-number query
/etc/init.d/iptables Save the policy so that it does not expire after being re-connected.
Then use the browser to open 192.168.229.128, see if you see the Apache welcome also?
This article has been successfully installed Apache, then next we will install PHP and MySQL