shell之路--LAMP一键安装yum版

#!/bin/bash

公司主营业务:成都网站制作、做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出江安免费做网站回馈大家。

cat <

# 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 $2}'|sed 's/addr://g'`

if [ -Z $1 ];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 $0 '@1 arg 1|2|3|4}"

        exit 0

fi

############################

if [ $1 == "1" ];then

        # install apache

        yum -y install $APACHE_SOFT

fi

if [ $1 == "2" ];then

        # install mysql

        yum -y install $MYSQL_SOFT

fi

if [ $1 == "3" ];then

        # install php

        yum -y install $PHP_SOFT

fi

if [ $1 == "4" ];then

        # lamp config

        yum -y install $APACHE_SOFT $MYSQL_SOFT $PHP_SOFT

        # touch index,php

        cat >/var/www/html/index.php<

       

        phpinfo();

        ?>

EOF

        systemctl restart httpd

        systemctl restart mariadb-service

        echo "----------------------------"

        echo "You can to use http://$IP/ to access."

fi


本文标题:shell之路--LAMP一键安装yum版
网页URL:http://pwwzsj.com/article/jjspis.html