China official Mirror website: http://centos.ustc.edu.cn/
/* Use instructions * *
cd/etc/yum.repos.d[into the YUM.REPOS.D directory]
MV Centos-base.repo centos-base.repo.save[Modify source file name Backup]
wget http://centos.ustc.edu.cn/centos-base.repo.5[DOWNLOAD]
MV centos-base.repo.5 centos-base.repo[file name after downloading]
1. Update the system kernel to the latest.
Yum-y Update
After the system is updated, if you are prompted for an error message when Yum is installed, perform the following command to repair it.
rpm–import/etc/pki/rpm-gpg/rpm-gpg-key*
2. Install Apahce, PHP, MySQL, and PHP to connect MySQL library components
Copy Code code as follows:
yum-y install httpd php mysql mysql-server php-mysql
Installing MySQL Extensions
Yum-y Install MYSQL-CONNECTOR-ODBC mysql-devel libdbi-dbd-mysql
Installing Extensions for PHP
Yum-y Install PHP-GD php-xml php-mbstring php-ldap php-pear php-xmlrpc
Install Apache Extensions
Yum-y Install httpd-manual mod_ssl mod_perl mod_auth_mysql
One-time paste installation:
Install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-x yum-y ML php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel
3. Start Service Configuration
Copy Code code as follows:
/sbin/chkconfig httpd on [set Apache to self start]
/sbin/chkconfig–-add mysqld [MySQL service]
/sbin/chkconfig mysqld on [Mysqld Services]
/sbin/service httpd start [self-starter httpd service]
/sbin/service mysqld start [self-starter mysqld service]
4. Set the MySQL database root account password.
mysqladmin-u root password ' new password ' [Password in quotes]
Make MySQL database more secure
Copy Code code as follows:
Mysql-u Root-p [This will require you to enter the password just set, enter the back can be
mysql> DROP DATABASE test; [Delete test database]
Mysql> DELETE from mysql.user WHERE user = "; [Delete Anonymous Account]
mysql> FLUSH privileges; [Overload permissions]
Mysql> Grant all privileges "*.* to ' root" @ ' 192.168.1.13′identified by ' password ' with GRANT OPTION; [Add remote link user]
According to the installation method above, the configured default site directory is/var/www/html/
Test environment
Rpm-qa |grep MySQL
Rpm-qa |grep httpd
Rpm-qa |grep PHP
I recommend that you browse the next article.