Shell Road--lamp Install Yum version with one click

Source: Internet
Author: User
Tags install php

#!/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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.