centos install:

#!/bin/bash
cd apr-1.5.1
 ./configure --prefix=/opt/apache2/apr-1.5.1
make
sudo make install
make clean
cd ../apr-util-1.5.3 
 ./configure --prefix=/opt/apache2/apr-util-1.5.3 --with-apr=/opt/apache2/apr-1.5.1
make
sudo make install
make clean
cd ../httpd-2.4.9 
 ./configure --prefix=/opt/apache2 --sysconfdir=/home/qihua/.myconf/apache2 --enable-so --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/opt/apache2/apr-1.5.1 --with-apr-util=/opt/apache2/apr-util-1.5.3 --enable-mpms-shared=all --with-mpm=event 
make
sudo make install
make clean
edit config in apache2, 
ServerName 127.0.0.1:8080
Listen 8080
#mysql installation
sudo groupadd -r -g 306 mysql
sudo useradd -g 306 -r -u 306 mysql
sudo chown -R mysql.mysql /opt/mysql-5.6.17-linux-glibc2.5-x86_64/*
sudo chown -R mysql.mysql /home/qihua/Documents/appdata/database
sudo ./scripts/mysql_install_db --user=mysql --datadir=/home/qihua/Documents/appdata/database
sudo chown -R root /opt/mysql-5.6.17-linux-glibc2.5-x86_64/*
mkdir /home/qihua/.myconf/mysql

vi /home/qihua/.myconf/mysql/my.cnf with below content.
[client]
#password       = your_password
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
[mysqld]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K

cp suppor-files/mysql.server /home/qihua/.myconf/mysql/mysqld
ln -s /home/qihua/.myconf/mysql/my.cnf /etc/my.cnf

update user set password=PASSWORD('a') where User='root'
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'a' WITH GRANT OPTION;

./configure --prefix=/opt/php-5.5.13 --with-mysql=/opt/mysql-5.6.17-linux-glibc2.5-x86_64 --enable-mbstring --with-zlib --enable-sockets --with-apxs2=/opt/apache2/bin/apxs --with-config-file-path=/home/qihua/.myconf/php --with-config-file-scan-dir=/home/qihua/.myconf/php/php.d --disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear --without-sqlite3

cp php.ini-production ~/.myconf/php/php.ini