2、解包安装apache
2.1 编译安装apr-1.5.0
# tar xvf apr-1.5.0.tar.bz2
# cd apr-1.5.0 && ./configure --prefix=/usr/local/apr
# make && make install
2.2 编译安装apr-util-1.5.3
# tar xvf apr-util-1.5.3.tar.bz2
# cd apr-util-1.5.3 && ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install
2.3 编译安装httpd-2.4.9
# tar xvf httpd-2.4.9.tar.bz2
# cd httpd-2.4.9
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewirte --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-moudles=most --enable-mpms-shared=all --with-mpm=event
# make && make install
3.2 新建用户以安全的方式运行进程
# groupadd -r mysql
# useradd -g mysql -r -s /sbin/nologin -M -d /mydata/data mysql
# chown -R mysql:mysql /mydata/data
3.3 安装并初始化
# tar xvf mariadb-5.5.43-linux-x86_64.tar.gz -C /usr/local/
# cd /usr/local/
# ln -s mariadb-5.5.43-linux-x86_64 mysql
# cd mysql && chown -R mysql.mysql .
测试页:
# vi /usr/local/apache/htdoc/index.php
<?php
$link = mysql_connect('127.0.01','root','');
if ($link)
echo 'Success...';
else
echo 'Failure...';
mysql_close();
?>
5、安装xcache, 为php加速:
5.1 安装
# tar zxvf xcache-3.2.0.tar.gz
# cd xcache-3.2.0
# /usr/local/php/bin/phpize
# ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
# make && make install