Install
# apt update
# apt install apache2
Configure
# nano /etc/apache2/apache2.conf
<Directory /srv/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /home/berladyn/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# a2enmod rewrite
# systemctl restart apache2
Create 'webmaster' usergroup and add user for file access.
# addgroup webmaster
# usermod -a -G webmaster dan
Log out and back in for the Group change to take effect.
Create 'webserver' generic webhost.
# mkdir /srv/www/webserver
# chgrp -R webmaster /srv/www/webserver.home
# chown -R dan:webmaster /srv/www/webserver.home
Configure 'webserver' virtualhost.
# nano /etc/apache2/sites-available/webserver.conf
<VirtualHost 192.168.0.1:80>
ServerName www.demo.berladyn.home
ServerName webserver.home
ServerAdmin webmaster@webserver.home
DocumentRoot /srv/www/webserver.home/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.1.200:80>
ServerName www.webserver.home
ServerName webserver.home
ServerAdmin webmaster@webserver.home
DocumentRoot /srv/www/webserver.home/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.220:80>
ServerName www.berladyn.home
ServerName berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /home/berladyn/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.221:80>
ServerName www.api.berladyn.home
ServerName api.berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /home/berladyn/public_api
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.222:80>
ServerName www.dev.berladyn.home
ServerName dev.berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /home/berladyn/public_dev
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.223:80>
ServerName www.dan.berladyn.home
ServerName dan.berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /home/berladyn/public_dan
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.224:80>
ServerName www.his.berladyn.home
ServerName his.berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /home/berladyn/public_his
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost 192.168.0.251:80>
ServerName www.sql.berladyn.home
ServerName sql.berladyn.home
ServerAdmin webmaster@berladyn.home
DocumentRoot /var/www/phpmyadmin
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# systemctl status apache2
# systemctl reload apache2
# systemctl restart apache2
# a2ensite webserver.conf
https://docs.boltcms.io/5.2/howto/making-sure-htaccess-works