环境:centos6.6;httpd-2.2.34;mysql-5.5.55;php5.6.31

#!/bin/bash#2017-08-12#author by Tan Wen Xin#Auto install LAMP#create DNS servercat>>/etc/resolv.conf<
 /dev/nullmkdir /download && cd /downloadwget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.2.34.tar.gztar zxf httpd-2.2.34.tar.gz && cd httpd-2.2.34 && ./configure prefix=/usr/local/apache2 -enable-rewrite --enable-so --enable-cgi --enable-modules=most --enable-mpms-shared=allif [ $? -eq 0 ];then  make && make install  echo "apache install successful!!!!!"else  echo "apache install failed"  exit 2fi###cp /usr/local/apache2/bin/apachectl /etc/init.d/httpdecho "/usr/local/apache2/bin/apachectl start">>/etc/rc.local##cp /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf.bcksed -i 's#index.html#index.html index.php#g' /usr/local/apache2/conf/httpd.confsed -i -e '/Group daemon/a\ServerName localhost' /usr/local/apache2/conf/httpd.confcat>>/usr/local/apache2/htdocs/index.php<
EOFcat>>/usr/local/apache2/conf/httpd.conf<