1. Installing Apache
You can install Apache by entering the following command in the terminal:
sudo yum install httpd
sudo means what to do with the root user. It is very convenient to confirm the download installation by clicking on Y.
Then use the following command to start the service
sudo service httpd start
Now do not worry down, directly in the browser input digitalocean to your IP address, you should be able to access the Apache Welcome page. Looks like this:
Isn't it cool? If your domain name has been successfully resolved to your host's IP address, use your domain name should also be able to access!
2. Install MySQL
sudo yum install Mysql-serversudo service mysqld start
Use the command above to download and install MySQL, the second is to start the MySQL service meaning.
Install MySQL will ask you some simple configuration, first press ENTER, the following in fact, the English is very simple, according to their own needs to choose.
Disallow Root login remotely? There is an option to allow the root user of MySQL remote access, I chose no, can access, so convenient, but there is a security risk. In this way, the software can also use the database in this VPS.
3. Install PHP and PHP components
sudo yum install php php-mysql
with this command, you can download and install PHP. The trouble is the PHP component.
Yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
I have installed 7 simple components here, you can also search all the PHP components, with the following command
Yum Search php-
4. Boot by default Apache and MySQL services
sudo chkconfig httpd onsudo chkconfig mysqld on
You can use the above two commands to select Boot Apache and MySQL.
5. Test if PHP is installed successfully
sudo nano/var/www/html/info.php
You can use the above command to create a new info.php file, the Nano is a simple text editing tool, as well as vim.
Enter a simple test PHP command:
<?phpphpinfo ();? >
then enter Ctrl o to save and click Enter to confirm. Then enter CTRL x to exit.
Then in the browser, enter the IP address plus info.php, you can see the PHP information! Similar to the following figure:
Only install WordPress, good excitement.
Reference
Installing Apache,mysql in CentOS 6, PHP