2017年8月

#!/bin/sh
echo 'LAMP Setup'
echo '1.Setup'
echo '2.Remove'
echo '3.Quit'
read a
if [ $a -eq 1 ]; then
    echo "----------------------------------------------------"
    echo "Setup"
    echo "----------------------------------------------------"
    echo "Apt-get update"
    echo "----------------------------------------------------"
    echo "Do you want to continue?"
    echo "1.yes"
    echo "2.no"
    read b
    if [ $b -eq 1 ];then
        apt-get update
    fi
    echo "----------------------------------------------------"
    echo "Apache2 Setup"
    echo "----------------------------------------------------"
    sudo apt-get -y install apache2
    echo "----------------------------------------------------"
    echo "PHP5 Setup"
    echo "----------------------------------------------------"
    sudo apt-get -y install php5
    echo "----------------------------------------------------"
    echo "MySQL Setup"
    echo "----------------------------------------------------"
    sudo apt-get -y install mysql-server
    sudo apt-get -y install php5-mysql
    echo "----------------------------------------------------"
    echo "Apache2 Restart"
    echo "----------------------------------------------------"
    sudo service apache2 restart
    echo "Apache2 Restart OK!"
    echo "----------------------------------------------------"
    echo "OK!"
    echo "----------------------------------------------------"
elif [ $a -eq 2 ];then
    echo "----------------------------------------------------"
    echo "Remove"
    echo "----------------------------------------------------"
    echo "Apache2 Remove"
    echo "----------------------------------------------------"
    apt-get autoremove --purge -y apache2
    echo "----------------------------------------------------"
    echo "PHP Remove"
    echo "----------------------------------------------------"
    apt-get autoremove --purge -y php5
    echo "----------------------------------------------------"
    echo "MySQL Remove"
    echo "----------------------------------------------------"
    apt-get autoremove --purge -y mysql-server
    apt-get autoremove --purge -y php-mysql
    echo "----------------------------------------------------"
    echo "OK!"
    echo "----------------------------------------------------"
else
    echo "-----Quit-----"
fi

#Powered by <?php echo"test-2"?>

1.安装编译环境

sudo apt-get install -y make gcc g++

1.png

2.安装依赖

sudo apt-get install -y libreadline5 libreadline-gplv2-dev

2.png

3.下载源码

wget http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar zxf lua-5.3.4.tar.gz

3.png
4.png

4.编译lua

cd lua-5.3.4
make linux
sudo make install

5.png
6.png

(编译可能时间较长,等待一下就好,出现警告无视就好)

5.安装完毕,输入 lua 进入lua环境

8.png

6.删除源码

编译过后源码就没有用了,可以删除掉。

cd ../
rm -r lua-5.3.4

7.png