CentOS6.5 installing MySQL, Apache, PHP

Source: Internet
Author: User

First, install MySQL


1. Uninstall the MySQL that comes with CentOS


Get root permissions First, Uninstall the CentOS comes with MySQL

Yum Remove MySQL


2, installation CMake

Download CMake

wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz


Installation

CD cmake-2.8.5./configure  --prefix=/usr/local/cmakemakemake Install


3. Install MySQL

Download the mysql.tar.gz package, this is mysql-5.6.17.tar.gz


So here we're going to build a MSYQL user and group

/usr/sbin/groupadd mysql/usr/sbin/useradd-g MySQL MySQL


Create a Directory

Mkdir/usr/local/mysql   

Unzipmysql-5.6.17.tar.gz and install

Cmake-dcmake_install_prefix=/usr/local/mysqlmakemake INSTALL

Plus permissions

chmod +w/usr/local/mysqlchown-r Mysql:mysql/usr/local/mysql

Enter the/usr/local/mysql directory

scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql  // Initialize the MySQL database cp support-files/my-medium.cnf/usr/local/mysql/my.cnf     //copy configuration file


Modifying a configuration file/usr/local/mysql/my.cnf

[Mysqld]   Basedir =/usr/local/mysql   DataDir =/usr/local/mysql/data    


start MySQL

CD/USR/LOCAL/MYSQL/SUPPORT-FILES/CP./mysql.server/etc/init.d/mysqld/etc/init.d/mysqld Start


turn off MySQL

/etc/init.d/mysqld stop


Second, install Apache server


1, the unloading system comes with the httpd

Rpm-qa|grep httpdrpm-e  xxx


2. Download Apache-server

The APR, Apr-util (both http://apr.apache.org/download.cgi), and Pcre (http://ftp.exim.llorien.org/pcre/) must be installed before installation.

1) Install APR, otherwise./configure httpd occurs when error:apr not found.

MKDIR/USR/LOCAL/APRTAR-ZXF apr-1.5.1.tar.gz./configure--prefix=/usr/local/aprmakemake Install

2) Install Apr-util,otherwise./configure httpd occurs when theerror:apr-util not found. 

MKDIR/USR/LOCAL/APRTAR-ZXF apr-util-1.5.3.tar.gz./configure--prefix=/usr/local/apr-utilmakemake Install

3) Install Pcre, otherwise./configure httpd occurs when error:pcre-config for Libpcre is not found.

Mkdir/usr/local/pcreunzip-o pcre-8.35.zipcd pcre-8.35/configure--prefix=/usr/local/pcremakemake Install


4) Final installation of httpd

Mkdir/usr/local/apachetar zxvf httpd-2.4.9.tar.gzcd httpd-2.4.9./configure--prefix=/usr/local/apache--with-apr=/ usr/local/apr/--with-apr-util=/usr/local/apr-util/--with-pcre=/usr/local/pcre/makemake Install

5) Start

/usr/local/apache/bin/apachectl start

Browser Access http://localhost

Show it works! Yes, OK Apache server is configured.



Third, install PHP


1, download PHP, here is the php-5.5.12.tar.gz


2. Preparatory work

Yum Install Libxml2yum Install libxml2-devel-y
Miss this step, will be reported to later./configure PHP, will be reported xml2-config not found.

For details, please refer to here http://www.jsjtt.com/xitongyingyong/linux/17.html


Yum Install Libjpeg-devel
Miss this step, later./configure PHP, will be reported error:jpeglib.h not found.


If there is an error/configure PHP, you can refer to this solution http://www.cnlvzi.com/index.php/Index/article/id/143


3. Install PHP

1) Installation

Tar zxvf php-5.5.12.tar.gzcd php-5.5.12./configure--with-apxs2=/usr/local/apache/bin/apxs--with-zlib-dir-- With-libxml-dir--with-jpeg-dir--with-png-dir--with-gd--with-mysql=/usr/local/mysql--with-pdo-mysql=/usr/local/ MySQL--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-mbstring make make and install


2) Configure the php.ini file,operation is located in the decompression directory



3) Configure Apache to support PHP

Modify Vi/usr/lcoal/apache/conf/httpd.conf

By "/" to find the AddType application/x-gzip. tgz, it is important to note that the # that is not tagged with the note, is added after finding the AddType application/x-gzip. tgz:

AddType application/x-httpd-php. php. Phtmladdtype application/x-httpd-php-source. Phps
indicates that PHP format files can be parsed in Apache service

Restart Apache

/usr/local/apache/bin/apachectrl start







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.