Skip to content

Instantly share code, notes, and snippets.

@LinuxPlaner
Created December 27, 2020 17:12
Show Gist options
  • Save LinuxPlaner/c02d6ad2f55f9e3b2fb6f2f94c18066e to your computer and use it in GitHub Desktop.
Save LinuxPlaner/c02d6ad2f55f9e3b2fb6f2f94c18066e to your computer and use it in GitHub Desktop.
How To Install LAMP Stack Ubuntu
# Install Apache to check from web browser using 0.0.0.0 or localhost, check version, start,stop & restart Apache into Ubuntu
sudo apt update
sudo apt upgrade
sudo apt install apache2
sudo ufw allow in "Apache Full"
apache2 -v
sudo service apache2 start
sudo systemctl enable apache2
sudo service apache2 stop
sudo service apache2 start
sudo service apache2 restart
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
sudo apt install curl
curl http://icanhazip.com
sudo ufw allow ssh
sudo ufw allow 2222/tcp
# Visit: http://localhost/
# Install MySQL & check version, start,stop & restart Apache
sudo apt install mysql-server
sudo mysql_secure_installation
mysql --version
sudo service mysql start
sudo service mysql enable
sudo service mysql start
sudo service mysql restart
# Create MySQL DB, User
sudo mysql -u root -p
CREATE DATABASE eight DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON eight.* TO 'netadmin'@'localhost' IDENTIFIED BY 'Eight@20';
use eight;
FLUSH PRIVILEGES;
EXIT;
# Install PHP & check version
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo 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
sudo apt install mlocate
locate php
whereis php
# Install PHPmyAdmin
sudo apt update
sudo apt install phpmyadmin
sudo apt install -y php-mbstring
sudo apt-get install gettext
sudo nano /etc/apache2/apache2.conf
# Then add the following line to the end of the file:
Include /etc/phpmyadmin/apache.conf
# save ctrl+x then y and hit enter. Then restart apache:
sudo service apache2 restart
# visit: http://localhost/phpmyadmin/
Use user= netadmin
pass= Eight@20
=========================================================================================================
DEBUGING
# When you attempt to logon, you see the error “#1698 – Access denied for user ‘root’@’localhost’“ OR Access denied for user ‘pma’@’localhost’“
sudo mysql -u root -p
CREATE DATABASE pmadb DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON pmadb.* TO 'pma'@'localhost' IDENTIFIED BY 'P@Ma33336@';
use pmadb;
FLUSH PRIVILEGES;
EXIT;
sudo service mysql restart
sudo nano /etc/phpmyadmin/config.inc.php
* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'P@Ma33336@';
save and exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment