Installing Apache MySQL PHP on Centeros 6.5

Source: Internet
Author: User

Configure the lamp environment on the Centeros 6.5 64-bit condition if you want to turn off the firewall
First, the preparatory work
1. Check for system updates

update

2. Installation of the compilation environment

-y install gcc  gcc  gcc-c

3. Need to unload the httpd that comes with your own

erase httpd

4. Install Zlib-devel Libtool ncurses-devel libxml2-devel

yum install zlib-devel libtool ncurses-devel libxml2-devel

Second, install MySQL
1. Direct MySQL Installation

[root@localhost ~]# yum install mysql mysql-server

2. When the installation is complete, let MySQL boot with the system

[root@localhost ~]# chkconfig --levels 235 mysqld on[root@localhost ~]# /etc/init.d/mysqld start

3. Set the MySQL password

[root@localhost ~]# mysql_secure_installation

Press ENTER directly when prompted as follows:

for root

Appear as follows enter again

Setrootpassword[Y/n]

Next, after entering the password, press ENTER

New password:

The next four options, all press ENTER

Removeanonymoususers[Y/n]Disallowrootloginremotely[Y/n]Removetestdatabaseandaccesstoit[Y/n]Reloadprivilegetablesnow[Y/n]

4. Restart MySQL

/etc/init.d#重启/etc/init.d#停止/etc/init.d#启动

Third, install Apache
1. Since CentOS has already encapsulated Apache, run the installation directly

[root@localhost ~]# yum install httpd

2. Configure the system to boot Apache with the system:

[root@localhost ~]# chkconfig --levels 235 httpd on

3. Launch Apache

[root@localhost ~]# /etc/init.d/httpd start

If it appears during the startup process

not reliably determine the server‘sfor ServerName [  OK  ]

Then modify the httpd.conf, in fact, do not modify it does not matter

4. After configuration, start Apache:

[root@localhost ~]# vi /etc/httpd/conf/httpd.conf

Find #servername www.example.com:80 and add the following below

ServerName 127.0.0.1:80

5. Restart Apache

/etc/init.d/httpd restart

6. Now that Apache is installed, access your IP address (server address) is OK
Iv. Installation of PHP

1. Install PHP

[root@localhost ~]# yum install php

2. Restart Apache

[root@localhost ~]# /etc/init.d/httpd restart

Iv. Testing PHP Related information
You can create a new PHP page to test and create a new one using the VIM editor:

[root@localhost ~]# vi /var/www/html/test.php

Press "I" key to edit, enter:

<?php   echo"test";    ?>

In the press: Wq exit
Finally enter on the browser

你的ip/test.php

If you see the test page, it works.

Installing Apache MySQL PHP on Centeros 6.5

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.