#!/bin/bash
Cat <<eof
# Auto Install lamp env
# by author Max
# 2017-03-20
Eof
apache_soft= "HTTPd httpd-devel"
mysql_soft= "Mariadb-server mariadb mariadb-devel"
php_soft= "PHP php-mysql php-devel"
ip= ' ifconfig eno16777736|grep 192|awk ' {print $} ' |sed ' s/addr://g '
If [-Z $];then
Echo-e "\033[36mplease se;ect Install menu:\033[0m"
echo "1) Install httpd"
echo "2) install MySQL"
echo "3) Install PHP"
echo "4) install lamp and access lamp"
Echo-e "\033[32m----------------------------\033[0m"
echo "Usage:{please enter $ @1 arg 1|2|3|4}"
Exit 0
Fi
############################
if [= = = "1"];then
# Install Apache
Yum-y Install $APACHE _soft
Fi
if [= = = "2"];then
# install MySQL
Yum-y Install $MYSQL _soft
Fi
if [= = = "3"];then
# Install PHP
Yum-y Install $PHP _soft
Fi
if [= = = "4"];then
# lamp Config
Yum-y Install $APACHE _soft $MYSQL _soft $PHP _soft
# Touch index,php
Cat >/var/www/html/index.php<<eof
<?php
Phpinfo ();
?>
Eof
Systemctl Restart httpd
Systemctl Restart Mariadb-service
echo "----------------------------"
echo "You can to use http://$IP/to access."
Fi
Shell Road--lamp Install Yum version with one click