for src in gcc gcc-c++ gmake ncurses-devel gzip libXpm-devel libXext-deveb libXpm libXext libtool libtool-ltdl-devel
do
yum -y install $src ;
done
for file in $PWD/*.tar.gz
do
tar -zxf $file
done
#apache
cd apr-1*
./configure --prefix=$apr_dir;make;make install ;
cd ../
cd apr-u*
./configure --prefix=$aprutil_dir --with-apr=$apr_dir ;make;make install ;
cd ../
cd pcre*/
./configure --prefix=$pcre_dir ; make ; make install ;
cd ../
cd httpd-*
./configure --prefix=$apache_dir --enable-so --with-apr-util=$aprutil_dir --with-pcre=$pcre_dir -enable-rewrite ;make;make install ;
cd ../
cp $apache_dir/bin/apachectl /etc/rc.d/init.d/httpd
sed -i '1 i #chkconfig:345 66 33\n#description:Apache\n' /etc/rc.d/init.d/httpd
chkconfig --add httpd
chkconfig httpd --level 345 on
#mysql
cd mysql*
./configure --without-debug --with-mysqld-ldflags=--all-static --with-client-ldflags=--all-static --prefix=$mysql_dir ;make ;make install ;
groupadd mysql
useradd mysql -g mysql
chown -R mysql:mysql /usr/local/mysql/
$mysql_dir/bin/mysql_install_db --user=mysql
cp -pr support-files/my-medium.cnf /etc/init.d/my.cnf
cp -pr support-files/mysql.server /etc/init.d/mysqld
chmod 700 /etc/init.d/mysqld
chkconfig mysqld --level 345 on
cd ../