Centos6.5 Installation Configuration Apache+php+mysql environment

Source: Internet
Author: User
Tags install php

1. Preparatory work

# yum-y Update && yum-y install vim make cmake gcc gcc-c++ bison bison-devel ncurses ncurses-devel autoconf Auto Make wget unzip Lrzsz zlib libgcrypt* libtool*

  

2. Installing apache2.2

# wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.31.tar.gz# tar zxf httpd-2.2.31.tar.gz# cd httpd-2.2.31#./ Configure--prefix=/usr/local/apache2.2--enable-modules=all--enable-mods-shared=all--enable-so# make && Make install

  

3.php dependent Software Installation (omit tar zxf, cd command)

3.1 Installing LIBXML2

  

3.2 Installing Libjpeg

# wget http://www.ijg.org/files/jpegsrc.v8.tar.gz#/configure--prefix=/usr/local/jpeg--enable-shared-- Enable-static && make && make install

 

3.3 Installing Libpng

# wget http://ncu.dl.sourceforge.net/project/libpng/libpng14/older-releases/1.4.3/libpng-1.4.3.tar.gz#./ configure&& make && make install

 

3.4 Installing FreeType

# wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz#/configure--prefix=/usr/local/ FreeType && make && make install

  

3.5 Installing LIBGD

# wget https://github.com/libgd/libgd/archive/GD_2_0_33.tar.gz#/configure--prefix=/usr/local/gd--with-jpeg=/usr /local/jpeg--with-png=/usr/local--with-zlib--with-freetype=/usr/local/freetype && make && make Install

  

4. Install PHP

# wget http://cn2.php.net/distributions/php-5.3.28.tar.gz#/configure--prefix=/usr/local/php5328-- With-config-file-path=/usr/local/php5328/lib/php.ini--with-apxs2=/usr/local/apache2.2/bin/apxs--with-mysql= Mysqlnd--with-pdo-mysql=mysqlnd--with-freetype-dir=/usr/local/freetype--with-gd=/usr/local/gd--with-zlib-- WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2--with-jpeg-dir=/usr/local/jpeg--with-png-dir--enable-mbstring=all-- Enable-mbregex--enable-shared# make && make install# CP php.ini-development/usr/local/php5328/lib/php.ini# Vim/usr/local/apache2.2/conf/httpd.conf  1. Under the last LoadModule, add AddType application/x-httpd-php. php. phtml    2. Find  <ifmodule dir_module>directoryindex index.html  </IfModule>  add index.php after index.html

  

5. Install MySQL by compiling the source code

# Groupadd mysql# useradd-r-g MySQL mysql# mkdir-p/usr/local/mysql/usr/local/mysql/data/usr/local/mysql/logs/usr/lo cal/mysql/tmp# rm-f/etc/my.cnf# vim/etc/profile add 2 rows path=/usr/local/mysql/bin:/usr/local/mysql/lib: $PATH export PAT h# source/etc/profile# wget http://downloads.mysql.com/archives/get/file/mysql-5.6.16.tar.gz# tar zxf mysql-5.6.16.tar.gz# CD mysql-5.6.16# cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_unix_addr=/usr/local/ Mysql/mysql.sock-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_myisam_storage_engine=1-dwith_ Innobase_storage_engine=1-dwith_archive_storage_engine=1-dwith_blackhole_storage_engine=1-dwith_memory_storage _engine=1-dwith_readline=1-denabled_local_infile=1-dmysql_datadir=/usr/local/mysql/data-dmysql_user=mysql- dmysql_tcp_port=3306-denable_downloads=1-dsysconfdir=/etc# make && make install # CHOWN-RF Mysql:mysql/usr/lo cal/mysql# cd/usr/local/mysql# scripts/mysql_install_db--user=mysql--basedir=/Usr/local/mysql--datadir=/usr/local/mysql/data# rm-f my.cnf 

Edit/ETC/MY.CNF

# vim/etc/my.cnf[client]port = 3306socket =/usr/local/mysql/mysql.sock[mysqld]character-set-server = Utf8collation-server = Utf8_general_ciskip-external-lockingskip-name-resolveuser = Mysqlport = 3306basedir =/usr/ Local/mysqldatadir =/usr/local/mysql/datatmpdir =/usr/local/mysql/tmpsocket =/usr/local/mysql/mysql.socklog-error =/usr/local/mysql/logs/mysql_error.logpid-file =/usr/local/mysql/mysql.pidopen_files_limit = 10240back_log = 600max _connections=500max_connect_errors = 6000wait_timeout=605800#open_tables = 600#table_cache = 650#opened_tables = 630max_allowed_packet = 32msort_buffer_size = 4mjoin_buffer_size = 4mthread_cache_size = 300query_cache_type = 1query_ Cache_size = 256mquery_cache_limit = 2mquery_cache_min_res_unit = 16ktmp_table_size = 256mmax_heap_table_size = 256Mkey_ Buffer_size = 256mread_buffer_size = 1mread_rnd_buffer_size = 16mbulk_insert_buffer_size = 64Mlower_case_table_names= 1default-storage-engine = Innodbinnodb_buffer_pool_size = 2ginnodb_log_buffer_sizE = 32minnodb_log_file_size = 128minnodb_flush_method = o_direct#################### #thread_concurrency = 32long_query _time= 2slow-query-log = Onslow-query-log-file =/usr/local/mysql/logs/mysql-slow.log[mysqldump]quickmax_allowed_ Packet = 32m[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid

Configure MySQL

# cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql# service MySQL start # chkconfig MySQL on#/usr/local/ Mysql/bin/mysql_secure_installation change the root user password to root# mysql-uroot-proot  >use MySQL;  >grant all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;  >flush privileges;  >exit;

  

  

Centos6.5 Installation Configuration Apache+php+mysql environment

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.