China official image site: http://centos.ustc.edu.cn/
/* Instructions */
CD/etc/yum. Repos. d [Go To The yum. Repos. d directory]
MV CentOS-Base.repo CentOS-Base.repo.save [modifying source file name backup]
Wget http://centos.ustc.edu.cn/centos-base.repo.5 download]
MV CentOS-Base.repo.5 CentOS-Base.repo [renamed downloaded file]
1. Update the system kernel to the latest version.
Yum-y update
After the system is updated, if an error message is prompted during Yum installation, run the following command to fix the problem.
Rpm-import/etc/pki/rpm-GPG/RPM-GPG-KEY *
2. Install apahce, PHP, MySQL, and PHP to connect to the MySQL library component.
CopyCode The Code is as follows: Yum-y install httpd PHP MySQL mysql-server PHP-MySQL
// Install MySQL extension
Yum-y install mysql-connector-ODBC mysql-devel libdbi-DBD-MySQL
// Install PHP Extension
Yum-y install PHP-Gd PHP-xml php-mbstring PHP-ldap php-pear PHP-XMLRPC
// Install Apache Extension
Yum-y install httpd-manual mod_ssl mod_perl mod_auth_mysql
One-time paste installation:
Yum-y install httpd PHP MySQL mysql-server PHP-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql PHP-mcrypt PHP-Gd PHP-xml php-mbstring PHP-ldap php-pear PHP-XMLRPC mysql-connector-ODBC mysql-devel libdbi-DBD-MySQL
3. Start service configurationCopy codeThe Code is as follows:/sbin/chkconfig httpd on [set Apache to self-start]
/Sbin/chkconfig -- add mysqld [MySQL Service]
/Sbin/chkconfig mysqld on [mysqld service]
/Sbin/service httpd start [self-starting HTTPd service]
/Sbin/service mysqld start [self-starting mysqld service]
4. Set the password of the root account of the MySQL database.
Mysqladmin-u Root Password 'new password' [enter the password in quotation marks]
Make MySQL database more secureCopy codeThe Code is as follows: mysql-u root-P [This requires you to enter the password you just set, enter it, and press Enter.
Mysql> drop database test; [Delete the test database]
Mysql> Delete from mysql. User where user = "; [deleting anonymous accounts]
Mysql> flush privileges; [reload permissions]
Mysql> grant all privileges on *. * To 'root' @ '192. 168.1.13 'identified by 'Password' with grant option; [Add a remote connection user]
according to the above installation method, the default site directory configured is/var/www/html/
test environment
rpm-Qa | grep mysql
rpm-Qa | grep httpd
rpm-Qa | grep php
we recommend that you browse the next Article .