Last active
August 29, 2015 14:00
-
-
Save yamishi13/ddfb027f513ebcda1e64 to your computer and use it in GitHub Desktop.
lamp installer for ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script must be run as root | |
if [[ $EUID -ne 0 ]] | |
then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
function uninstall() { | |
apt-get purge php5 libapache2-mod-php5 mysql-server -y | |
service apache2 restart | |
apt-get purge apache2 -y | |
apt-get autoremove -y | |
exit 0 | |
} | |
while test $# -gt 0 ; do | |
case $1 in | |
-u | --uninstall) uninstall ; shift 1 ;; | |
esac | |
done | |
#Update from repositories | |
apt-get update | |
#Apache 2 | |
apt-get install apache2 -y | |
#PHP | |
apt-get install php5 libapache2-mod-php5 -y | |
service apache2 restart | |
# MySQL | |
apt-get install mysql-server -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment