CentOS 6.5yum install and configure the lamp server (Apache + PHP + MySQL)

Source: Internet
Author: User

Author's note:

Not entirely original

I want to find a tutorial,

However, according to a tutorial, you have made thousands of commands,

Half left,

I can't afford it anymore.

Based on lnmp configuration experience,

Try it by yourself.

Lucky success.

The following is the text

Certificate -----------------------------------------------------------------------------------------------------------------------------------

Configure a third-party yum source for CentOS 6.2 (no nginx software package exists in the default standard source for CentOS)
Yum install wget # install the download tool wget
Wget http://www.atomicorp.com/installers/atomic # download atomic yum Source
Sh./atomic # Installation
Yum check-update # update yum Software Package

1. install and configure MySQL

1.1 run the yum command to install MySQ

Yum-y install mysql-server

1.2 add MySQL to the startup Item and start MySQL immediately

Chkconfig -- levels 235 mysqld on
/Etc/init. d/mysqld start

1.3 set the MySQL root Account Password

Mysql_secure_installation

Press enter and enter Y as prompted.

Enter the password twice and press Enter.

Enter Y as prompted

Thanks for using MySQL!

After setting the MySql password, restart MySQL:

Service mysqld restart

# Restart

Ii. install Apache

2.1 use the yum command to install Apache

Yum-y install httpd

2.2 set Apache startup

Chkconfig -- levels 235 httpd on

2.3 start Apache

/Etc/init. d/httpd start

2.4 enter http: // localhost or http: // local IP in the browser. The Apache test page is displayed.

3. install and configure PHP

3.1 Use the yum command to install PHP

Yum-y install php

3.2 restart the Apache server

/Etc/init. d/httpd restart

3.3 install related modules using PHP to support MySQL: To enable PHP to support MySQL, we can install the php-mysql software package, or use the following command to search for available php modules

Yum search php

Select the required module for Installation

Yum-y install php-mysql php-common php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

3.4 restart the Apache server

/Etc/init. d/httpd restart

Ps: apache default website directory/var/www/html

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.