How to set up Apache on Armbian

1. Install apache and php
sudo apt install apache2
sudo apt install php

2. Enable user directory
sudo a2enmod userdir
in /etc/apache2/mods-enabled/
sudo ln -s ../mods-available/userdir.conf userdir.conf
(for CentOS, edit /etc/httpd/conf.d/userdir.conf)

3. Remove Indexes for securiety in /etc/apache2/apache2.conf
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>

4. Enable php engine for user directory in /etc/apache2/mods-enable/php7.3.conf
<FilesMatch “^\.ph(ar|p|ps|tml)$”>
# Require all denied
</FilesMatch>
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
# php_admin_flag engine Off
</Directory>
</IfModule>