CentOS 5.4 Server configuration yum installation Apache+php+mysql_linux

Source: Internet
Author: User
Tags gpg install php ldap mirror website odbc pear php mysql centos
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.

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.