echo -e " 33[32m=========download about php or php-fpm soure package======== 33[0m"
wget http://xcache.lighttpd.net/pub/Releases/3.0.3/xcache-3.0.3.tar.bz2
wget http://pecl.php.net/get/memcache-2.2.7.tgz
wget http://downloads.php.net/stas/php-5.4.19.tar.bz2
echo -e " 33[32m======download about memcached source package======== 33[0m"
wget http://nchc.dl.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.21-stable.tar.gz
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
echo -e " 33[32m======download about mysql source package========= 33[0m"
wget http://mysql.llarian.net/Downloads/MySQL-5.5/mysql-5.5.33.tar.gz
}
function install_apache {
cd /root
yum -y install pcre-devel
tar xf apr-1.4.6.tar.bz2
tar xf apr-util-1.5.2.tar.bz2
tar xf httpd-2.4.6.tar.bz2
cd /root/apr-1.4.6
./configure --prefix=/usr/local/apr && make && make install
echo -e " 33[32m=========apr is ok======== 33[0m"
cd /root/apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install
echo -e " 33[32m=========apr-util is ok======== 33[0m"
cd /root/httpd-2.4.6
./configure --prefix=/usr/local/apache --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib
--with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most
--enable-mpms-shared=all --with-mpm=event && make && make install
echo -e " 33[32m=========httpd is ok======== 33[0m"
}
function config_apache {
echo -e " 33[32m frist,Associated system path 33[0m"
echo "PATH=/usr/local/apache/bin/:$PATH" >/etc/profile.d/httpd.sh
source /etc/profile.d/httpd.sh
ln -sv /usr/local/apache/include/ /usr/include/httpd
echo -e " 33[32m second,Modify configuration files and provided systemV scripts 33[0m"
IP=`ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk -F: '{print $2}' | cut -d' ' -f1`
cp /root/httpd-2.4.6/build/rpm/httpd.init /etc/rc.d/init.d/httpd
sed -i '/httpd/s/usr/sbin/httpd/usr/local/apache/bin/httpd/g' /etc/rc.d/init.d/httpd
sed -i '/^httpd/aprog=httpd' /etc/rc.d/init.d/httpd
sed -i '/^pidfile/s/var/run/usr/local/apache/logs/g' /etc/rc.d/init.d/httpd
sed -i 's/etc/httpd/conf/httpd.conf/usr/local/apache/conf/httpd.conf/g' /etc/rc.d/init.d/httpd
sed -i '$a ServerName '$IP':80' /usr/local/apache/conf/httpd.conf
chkconfig --add httpd
chkconfig --level 35 httpd on
service httpd start
}
function install_nginx {
cd /root
yum -y install pcre-devel
tar xf nginx-1.4.2.tar.gz
groupadd nginx
useradd -r -g nginx nginx
cd /root/nginx-1.4.2
./configure
--prefix=/usr
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx/nginx.pid
--lock-path=/var/lock/nginx.lock
--user=nginx
--group=nginx








