#!/bin/bash
#注意,安装前先安装mysql,mysql安装在/usr/local/mysql目录。
tar -jxvf httpd-2.2.11.tar.bz2
mkdir   /usr/local/apache2
cd httpd-2.2.11
./configure --prefix=/usr/local/apache2/ --enable-so
make && make install
echo "/usr/local/apache2/bin/apachectl start" >>  /etc/rc.d/rc.local
/usr/local/apache2/bin/apxs -c -i -a /root/httpd-2.2.11/modules/mappers/mod_rewrite.c
cd
tar -jxvf       php-5.2.10.tar.bz2
cd      php-5.2.10
./configure  --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache2/bin/apxs  --with-mysql=/usr/local/mysql/  --with-libxml-dir ---
with-iconv  --with-gd --with-freetype-dir  --with-jpeg-dir --with-png-dir --with-zlib --enable-mbstring --enable-sockets
make && make install
cp php.ini-dist /usr/local/php/etc/php.ini
echo "AddType application/x-httpd-php .php" >> /usr/local/apache2/conf/httpd.conf
/usr/local/apache2/bin/apachectl start