标签:centos lamp
#!/bin/bash
yum -y install gcc-c++ library ncurses-devel libxml2-devel libtomcrypt-devel libtool libtool-ltdl-devel bzip2-devel
cd /tmp&&tar -zxf httpd-2.2.11.tar.gz&&cd httpd-2.2.11&&./configure --prefix=/usr/local/apache -with-included-apr --with-pcre --enable-mods-shared=moost
make &&make install
if [ $? -eq 0 ];then
echo "/usr/local/apache/bin/apachectl restart" >> /etc/rc.d/rc.local
/usr/local/apache/bin/apachectl restart
else
echo "apache compile instal error"
exit 1
fi
useradd -M -s /sbin/nologin mysql
cd /tmp/&&tar -zxf mysql-5.1.55.tar.gz&&cd mysql-5.1.55&& ./configure --prefix=/usr/local/mysql --with-charset-utf8 --with-extra-charsets=gbk,gb2312
make &&make install
if [ $? -eq 0 ];then
yes|cp -r support-files/my-medium.cnf /etc/my.cnf
yes|cp -f support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chmod 755 /etc/init.d/mysqld
ln -s /usr/local/mysql/bin/* /bin
else
echo "mysql compile install error"
exit 1
fi
if [ -e /usr/local/mysql/bin/mysql_install_db ];then
/usr/local/mysql/bin/mysql_install_db --user=mysql
else
echo "chu shi hua shi bai"
exit
fi
chown -R root:mysql /usr/local/mysql/
chown -R mysql /usr/local/mysql/var/
echo "/etc/init.d/mysqld restart" >> /etc/rc.d/rc.local
/etc/init.d/mysqld restart
echo "install php please waiting"
cd /tmp/&&tar -zxf php-5.3.6.tar.gz&&cd php-5.3.6&&./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --enable-soap --enable-mbstring --enable-sockets --enable-exif --disable-ipv6
make&&make install
if [ $? -eq 0 ];then
echo "php compile ok"
yes|cp -f /tmp/httpd.conf /usr/local/apache/conf/
/usr/local/apache/bin/apachectl restart
else
echo "php compile error"
exit 1
fi
#yes|cp -f /tmp/httpd.conf /usr/local/apache/conf/
#/usr/local/apache/bin/apachectl restart
##AddType application/x-httpd-php .php .phtml 添加对“.php”类型网页支持
##DirectoryIndex index.php index.html 识别常见的php首页文件
#<?php
#phpinfo ();
#?>
#curl 192.168.9.122/index.php
#iptables -X -F
标签:centos lamp
原文地址:http://qing1994.blog.51cto.com/10695242/1754105