Install LAMP on yum in CentOS
Install LAMP on yum in CentOS
#! /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 [31 m Now, we start install LAMP! \ 033 [0 m"
Echo-e "\ 033 [32 m'date' \ 033 [0 m"
Yum install-y gcc-c ++ libtool lib ntp libtool-ltdl make httpd-devel mysql-server mysql-devel php-mysql
Echo-e "\ 033 [35 m Yum install LAMP is OK! \ 033 [0 m"
Sed-I's/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
If [$? = 0]; then
Kill 'netstat-tnlp | grep 80 | awk' {print $7} '| cut-d "/"-f1'
Service mysqld restart
Else
Service mysqld start
Fi
Echo-e "\ 033 [32 m Over! \ 033 [0 m"
The above script is successfully tested in my Centos6.4 _ x86_64! Enter http: // ip in the browser to access the php page!
I have limited capabilities. If you have any shortcomings, please kindly advise !!!
You may also like the following LAMP-related content:
Install Xcache and Memcached on the LAMP platform to accelerate website operation
Build a LAMP platform environment in CentOS 7
CentOS 6.5 system installation and configuration LAMP (Apache + PHP5 + MySQL) server environment
Configure the LAMP + phpMyAdmin PHP (5.5.9) development environment in Ubuntu 14.04
Install LAMP in Ubuntu 14.10
LAMP combines NFS to build a small blog site
This article permanently updates the link address: