########################################################################## File Name: lamp_yum_install.sh# Author: xxx# Mail: xxx@qq.com# Created Time: 2015年10月09日 星期五 06时13分20秒# Description : this is scripts use to lamp install# Version : v1.0##########################################################################!/bin/bash. /etc/init.d/functionsRED_COLOR='\E[1;31m'GREEN_COLOR='\E[1;32m'YELLOW_COLOR='\E[1;33m'BLUE_COLOR='\E[1;34m'RES='\E[0m'apache_install(){yum -y install httpd httpd-develcp /etc/httpd/conf/httpd.conf{,.`date +%Y%m%d`}sed -i s'/#ServerName www.example.com:80/ServerName 127.0.0.1:80/g' /etc/httpd/conf/httpd.conf/etc/init.d/httpd startchkconfig httpd on}mysql_install(){yum -y install mysql mysql-server mysql-devel/etc/init.d/mysqld start/usr/bin/mysqladmin -u root password '123456'chkconfig mysqld on}php_install(){yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap}lamp_test(){/etc/init.d/httpd restartcat>>/var/www/html/index.php< EOFcat >/var/www/html/mysql.php< EOF}main(){apache_installmysql_installphp_installlamp_test}main
########################################################################## File Name: lnmp_yum_install.sh# Author: xxx# Mail: xxx@qq.com# Created Time: 2015年10月09日 星期五 06时17分02秒# Description : this is scripts use to lnmp install# Version : v1.0##########################################################################!/bin/bash. /etc/init.d/functionsRED_COLOR='\E[1;31m'GREEN_COLOR='\E[1;32m'YELLOW_COLOR='\E[1;33m'BLUE_COLOR='\E[1;34m'RES='\E[0m'nginx_install(){yum -y install nginx/etc/init.d/nginx startchkconfig nginx on}mysql_install(){yum -y install mysql mysql-server mysql-devel/etc/init.d/mysqld start/usr/bin/mysqladmin -u root password '123456'chkconfig mysqld on}php_install(){yum install -y php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm/etc/init.d/php-fpm startchkconfig php-fpm on#nginx setupcp /etc/nginx/conf.d/default.conf{,.`date +%Y%m%d`}sed -i '17s/index.html/index.php index.html/g' /etc/nginx/conf.d/default.confsed -i '39,46s/#//g' /etc/nginx/conf.d/default.confsed -i '44s/\/scripts/$document_root/g' /etc/nginx/conf.d/default.conf#php-fpm setupcp /etc/php-fpm.d/www.conf{,.`date +%Y%m%d`}sed -i 's/user = apache/user = nginx/g' /etc/php-fpm.d/www.confsed -i 's/group = apache/group = nginx/g' /etc/php-fpm.d/www.conf }lnmp_test(){/etc/init.d/nginx restartcat>>/usr/share/nginx/html/index.php< EOFcat >/usr/share/nginx/html/mysql.php< EOF}main(){nginx_installmysql_installphp_installlnmp_test}main