Skip to content

Instantly share code, notes, and snippets.

@MShahine
Created May 8, 2020 16:42
Show Gist options
  • Save MShahine/6734f4016659752649709cd55cb1bc03 to your computer and use it in GitHub Desktop.
Save MShahine/6734f4016659752649709cd55cb1bc03 to your computer and use it in GitHub Desktop.
Installation Of LAMP Server In Ubuntu
#!/bin/bash
# This Tool Is Aim Helping You Setup LAMP Server In Your System
# https://itstoss.blogspot.com/
# By MShahine1
clear
echo '[+] This Tool Is Maded For Automatization The LAMP INSTALATION'
sleep 2
clear
echo '[I] UPDATING SYSTEM ...'
sleep 2
clear
echo '[+] Updating The System ...'
sudo apt update && sudo apt upgrade
clear
echo '[II] INSTALLING APACHE2'
sleep 2
clear
echo '\n\n[+] Install Apche Web Server ....'
sudo apt -y install apache apache2-utils
echo '\n[!] APACHE2 LOG ... If You See Any Error After This You Should See Whats Wrong ...'
sudo systemctl status apache2
clear
echo '\n[x] Start & Enable The Apache2'
sudo systemctl start apache2
sudo systemctl enable apache2
echo '\n[x] Add Exception In The FireWall'
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
echo '\n[+] If Using UFW Then Allow It By Running : sudo ufw allow http '
echo '\n[+] Set www-data(Apache-user) As The Owner ....'
sudo chown www-data:www-data /var/www/html/ -R
clear
echo '[III] INSTALL MARIADB DATABASE SERVER'
sleep 2
clear
echo '\n[+] Install MariaDB (Srevr|Client)'
sudo apt install mariadb-server mariadb-client -y
echo '\n[+] Enable & Start MariaDB ...'
sudo systemctl start mariadb
sudo systemctl enable mariadb
clear
echo '\n[+] Start The Serure Installtion ....'
clear
echo"[!] BE CAREFUL OF WHAT YOU AFTER "
echo '\n-1 Just Hit Enter \n-2 Enter New Password \n-3 Git Enter \n-4 Hit Enter \n-5 Hit Enter \n-6 Hit Enter '
sleep 10
sudo mysql_secure_installtion
clear
echo '[!!!!] INSTALL PHP7.2'
sleep 2
echo '[+] Install PHP On The System ... '
sudo apt -y install php7.2 libapache2-mod-php7.2 php7.2-mysql php-common php7.2-cli php7.2-common php7.2-json php7.2-opcache php7.2-readline
clear
echo '\n[!] Enable & Start The PHP Module ...'
sudo a2enmod php7.2
sudo systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment