Skip to content

Instantly share code, notes, and snippets.

@ondrejh
Created December 24, 2020 07:38
Show Gist options
  • Save ondrejh/c1df59c4e6e8c8cb88a95b12bdac447b to your computer and use it in GitHub Desktop.
Save ondrejh/c1df59c4e6e8c8cb88a95b12bdac447b 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