Webserver Setup - Debian9 for Wordpress & Joomla

apt install sudo

adduser USERNAME sudo


(opt) visudo
apt install apache2 adminer vim mc
source /etc/apache2/envvars
apache2 -M
apache2 -v
a2enmod http2
systemctl restart apache2
apache2 -M

 
vi /etc/apache2/conf-enabled/security.conf
 
ServerTokens 
Prod

 apt install adminer
echo "Alias /adminer /usr/share/adminer/" | sudo tee /etc/apache2/conf-available/adminer.conf
a2enconf adminer
systemctl restart apache2

 

apt install mariadb-server

mysql_secure_installation

mysql -p

 

-- LVM

 apt install lvm2

fdisk /dev/sdb/

n =>new

p=>primary

1 (1st partition)

default start/end

w => write

 

pvcreate /dev/sdb1

vgcreate VG_VAR /dev/sdb1

lvcreate -n LV_VAR -L 19g VG_VAR

mkfs -t ext4 /dev/mapper/VG_VAR-LV_VAR

3934d4f3-baef-437b-9f22-96e65cf9b72e var
0e618be1-bc1e-4e5d-9af6-6a0b6a99cdb8 nxt

 SSHFS

apt install sshfs

 

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php

php composer-setup.php
export COMPOSER_HOME="$HOME/.config/composer";
php composer-setup.php
php -r "unlink('composer-setup.php');"

 

apt install certbot