Install Apache, MySQL, and PHP in yum
1. install Apache
Yum install httpd-devel
After the installation is complete, start Apache with/etc/init. d/httpd start
Set to boot: chkconfig httpd on
2. Install MySQL
2.1 Yum install MySQL mysql-server mysql-devel
Similarly, start MySQL with/etc/init. d/mysqld start
2.2 set the MySQL password
Mysql>; use MySQL; (remember to end with a semicolon)
Mysql>; update user SET Password = PASSWORD ('newpassword') where user = 'root ';
Mysql>; flush privileges;
2.3 Allow Remote Login
Mysql-u root-P // This is returned to the front of the Linux System
Enter Password: <your new password>
Mysql> grant all privileges on *. * To 'username '@' % '[where is the write-in connection?] identified by 'Password' with grant option;
After that, you can use MySQL-front to remotely manage MySQL.
2.4 set to boot
Chkconfig mysqld on
2.5 install phpMyAdmin
Download phpMyAdmin, change the permission to 755, and deploy it to the/var/www/html/directory. (Generally, the root user has no password)
3. install PHP
Yum install PHP-mysql PHP-common PHP-Gd PHP-mbstring PHP-mcrypt PHP-devel PHP-XML
/Etc/init. d/httpd restart (Key restart Apache)
4. Test
4.1 create a test. php file in/var/www/html/, write the following content, and save the file.
<?
Phpinfo ();
?>
Change the access permission of the test. php file to 755. Remember to restart the apache service. Otherwise, it cannot run.
Edit the new PHP version as follows:
<? PHP
Phpinfo ();
?>
Otherwise, a blank page is displayed!
5. Firewall Configuration
A. Add. Allow access to port {21: FTP, 80: HTTP }.
Iptables-I RH-Firewall-1-INPUT-M State-State new-M TCP-P TCP-dport 21-J accept
Iptables-I RH-Firewall-1-INPUT-M State-State new-M TCP-P TCP-dport 80-J accept
B. Disable the firewall {not recommended }.
Service iptables stop
C. Reset and load the Firewall
Service iptables restart
Then open http: // serverip/test. php In the client browser. If it is displayed successfully, the installation is successful.
So far, the installation is complete.