Skip to content

Instantly share code, notes, and snippets.

@thatal
Forked from ondrejh/lamp_install.md
Created April 8, 2021 08:47
Show Gist options
  • Save thatal/3011d64c06cc15845f3e531bbb206a71 to your computer and use it in GitHub Desktop.
Save thatal/3011d64c06cc15845f3e531bbb206a71 to your computer and use it in GitHub Desktop.
LAMP installation

Install Apache

sudo apt update
sudo apt install apache2

Install MySQL

sudo apt install mariadb-server
mysql_secure_installation

sudo mysql

Create database

CREATE DATABASE devices;
SHOW DATABASES;
CREATE USER devAdmin@localhost IDENTIFIED BY 'devAdm123';
SELECT User FROM mysql.user;
GRANT ALL PRIVILEGES ON devices.* to devAdmin@localhost;
FLUSH PRIVILEGES;
SHOW GRANTS FOR devAdmin@localhost;
SELECT user,authentication_string,plugin,host FROM mysql.user;

Install PHP

sudo apt install php libapache2-mod-php
sudo apt install php-mysql php-gd
sudo systemctl restart apache2.service

Set privileges

cd /var/www
sudo chown -R www-data:www-data html
sudo chmod 775 html
cd html
sudo chmod 664 *

Add user into www-data group

sudo usermod -aG www-data <username>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment