CentOS下yum安装LAMP

【广告位】文章头部(标题下方、正文上方)

CentOS下yum安装LAMP

#!/bin/bash
#
#Time:2013/07/23-13:37:03
#
#OS:Centos_6.4
#This is through the method of yum to install the LAMP!
#yum update -y  #If this is the first time to update, that will take you for a long time.So Please choose carefully!!!
echo -e "\033[31m Now,we start install LAMP! \033[0m"
echo -e "\033[32m `date` \033[0m"
yum install -y gcc gcc-c++ libtool lib ntp libtool libtool-ltdl libtool libtool-ltdl make httpd httpd-devel MySQL mysql-server mysql-devel php php-devel php-mysql
echo -e "\033[35m Yum install LAMP is Ok! \033[0m"
sed -i 's/DirectoryIndex index.html/DirectoryIndex index.html index.htm index.php/' /etc/httpd/conf/httpd.conf
cd /var/www/html
cat >index.php<<EOF
<?php
phpinfo();
?>
EOF
netstat -tnlp  | grep 80
if [ $? = 0  ];then
  kill `netstat -tnlp | grep 80 | awk '{print $7}' | cut -d"/" -f1`
  service httpd restart
else
  service httpd start
fi
netstat -tnlp | grep 3306

【广告位】文章正文中间
本文已展示 50% · 完整内容需验证码解锁

关注公众号,解锁完整文章

微信扫码关注 星哥玩云, 在公众号对话框回复关键词 星哥玩云博客 获取验证码。输入后即可阅读全文, 一次解锁全站文章通用。

星哥玩云 微信公众号二维码
微信扫一扫 / 长按识别,关注「星哥玩云」
【广告位】文章底部(正文结束、评论区上方)
评论功能已在静态化后停用 · 返回顶部 ↑