Skip to content

Instantly share code, notes, and snippets.

@moshiurse
Last active August 24, 2023 02:47
Show Gist options
  • Save moshiurse/c9665f100db607f5936a04d83714910a to your computer and use it in GitHub Desktop.
Save moshiurse/c9665f100db607f5936a04d83714910a to your computer and use it in GitHub Desktop.
Lamp Stack Installation

Apache

sudo apt update
sudo apt install apache2
sudo ufw app list
sudo ufw allow in “Apache”
sudo systemctl start apache2 // to start apache server
sudo systemctl status apache2 // to know the status 
sudo systemctl stop apache2 // to stop the server
sudo systemctl restart apache2 // to restart the server

MySQL

sudo apt install mysql-server
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345';
sudo mysql_secure_installation
remove anonymous users - y
disallow remote login - y
sudo systemctl enable --now mysql.service  // to enable mysql
systemctl status mysql.service  // to check the status
sudo ufw allow mysql

sudo ufw enable // to enable the ufw status 

PHP

sudo apt install php libapache2-mod-php php-mysql

PHPMYADMIN

sudo apt update
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

Troubleshooting Phpmyadmin & mysql-workbench If you get blowfish_secret error: Choose and set a phrase for cryptography in the file /etc/phpmyadmin/blowfish_secret.inc.php and copy the line (not the php tags) into the file /etc/phpmyadmin/config.inc.php or you will receive an error.

If you get a 404 error upon visiting http://localhost/phpmyadmin: You will need to configure apache2.conf to work with Phpmyadmin.

$ sudo gedit /etc/apache2/apache2.conf
Include the following line at the bottom of the file, save and quit.
$ Include /etc/phpmyadmin/apache.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment