Skip to content

Instantly share code, notes, and snippets.

@kngvamxx
Created March 25, 2021 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kngvamxx/68c9fbedd14f6dee5f5ff224506d7007 to your computer and use it in GitHub Desktop.
Save kngvamxx/68c9fbedd14f6dee5f5ff224506d7007 to your computer and use it in GitHub Desktop.
Install LAMP Stack Ubuntu 20.04 LTS
#!/bin/sh
# FORK THIS GIST AND UPDATE FOR YOU BEFORE USE
#Things To Do After Installing Ubuntu 20.04 LTS Desktop
sudo -i
apt update -y
apt upgrade -y
apt install build-essential checkinstall
apt install ubuntu-restricted-extras
apt install software-properties-common
add-apt-repository ppa:nilarimogard/webupd8
apt update
apt install launchpad-getkeys
launchpad-getkeys
add-apt-repository ppa:git-core/ppa
apt update
apt install git
git config --global user.name "YourName"
git config --global user.email youremail@gmail.com
apt upgrade -y
apt -f install
apt autoremove
apt -y autoclean
apt -y clean
apt update
reboot
# Install Apache to check from web browser using 0.0.0.0 or localhost, check version, start,stop & restart Apache into Ubuntu
apt update
apt upgrade
apt install apache2
ufw allow in "Apache Full"
apache2 -v
service apache2 restart
systemctl enable apache2
service apache2 stop
nano /etc/apache2/apache2.conf
# Add
ServerName localhost
ctrl+s and sctr+x
service apache2 start
service apache2 restart
service apache2 reload
apt install curl
ufw allow ssh
ufw allow 2222/tcp
# Visit: http://localhost/
# Install MySQL & check version, start,stop & restart Apache
apt install mysql-server
mysql_secure_installation
mysql --version
nano /etc/mysql/mysql.conf.d/mysqld.cnf
# update
bind-address = 0.0.0.0
ctrl+s and sctr+x
service mysql start
service mysql enable
service mysql restart
service mysql status
ufw allow from any to any port 3306 proto tcp
systemctl restart mysql
systemctl enable mysql
mysql
CREATE DATABASE lamp;
CREATE USER 'netadmin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NEt@dmin2121';
ALTER USER 'netadmin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'NEt@dmin2121';
GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT on *.* TO 'netadmin'@'localhost' WITH GRANT OPTION;
use lamp;
FLUSH PRIVILEGES;
exit
service mysql restart
# Install PHP & check version
apt install software-properties-common
add-apt-repository ppa:ondrej/php
apt install php7.2-fpm php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-mysql php7.2-cli php7.2-zip php7.2-curl
php --version
apt install mlocate
locate php
whereis php
# Install PHPmyAdmin
apt update -y
apt upgrade -y
apt update -y
apt install phpmyadmin
apt install -y php-mbstring
apt install gettext
### nano /etc/apache2/apache2.conf
# Then add the following line to the end of the file:
### Include /etc/phpmyadmin/apache.conf
# For save press ctrl+x then y and hit enter. Then restart apache:
nano /etc/phpmyadmin/apache.conf
# update
Alias /phpmyadmin "/usr/share/phpmyadmin/"
# save ctrl+x then y and hit enter. Then restart apache:
apt-get install php7.4-mysqli
service apache2 restart
service apache2 reload
# visit: http://localhost/phpmyadmin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment