Centos 5.4 server configuration Yum install Apache + PHP + MySql

Source: Internet
Author: User
Tags gpg ldap php mysql

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 .

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.