~$ sudo apt update
~$ sudo apt install {apache2,apache2-doc,libapache2-mod-php}
~$ sudo a2enmod vhost_alias
~$ sudo apt install {mariadb-server,}
~$ sudo apt install {php,php-{cli,curl,json,mysql,zip,pear,gd,mbstring,xml,bcmath,intl}}
~$ sudo systemctl status apache2.service
ServerName 127.0.0.1
# chateau.parc <VirtualHost *:80> UseCanonicalName Off ServerName chateau.parc DocumentRoot /var/www/html <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> # Wikis # doc.chateau.parc, doc0.chateau.parc, doc-old.chateau.parc # essai.chateau.parc # perso.chateau.parc, perso-old.chateau.parc, perso0.chateau.parc # kine.chateau.parc, magie.chateau.parc # adminer.chateau.parc <VirtualHost *:80> UseCanonicalName Off ServerName doc.chateau.parc ServerAlias doc0.chateau.parc doc-old.chateau.parc ServerAlias essai.chateau.parc kine.chateau.parc magie.chateau.parc ServerAlias perso.chateau.parc perso-old.chateau.parc perso0.chateau.parc VirtualDocumentRoot "/var/www/html/%-3" <Directory /var/www/html/> AllowOverride All Require all granted DirectoryIndex index.php index.html index.htm </Directory> <LocationMatch "/(data|conf|bin|inc|vendor)/"> Require all denied Satisfy All </LocationMatch> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> # adminer.chateau.parc, glpi.chateau.parc, php.chateau.parc <VirtualHost *:80> UseCanonicalName Off ServerName adminer.chateau.parc ServerAlias glpi.chateau.parc php.chateau.parc VirtualDocumentRoot "/var/www/html/%-3" <Directory /var/www/html/> AllowOverride All Require all granted DirectoryIndex index.php index.html index.htm </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> # dolibarr.chateau.parc <VirtualHost *:80> UseCanonicalName Off ServerName dolibarr.chateau.parc VirtualDocumentRoot /var/www/html/%-3/htdocs <Directory /var/www/html/> AllowOverride All Require all granted DirectoryIndex index.php index.html index.htm </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
# Ferme ferme.parc # fermier : dokuwiki # animaux : # doc.ferme.parc -> /doc # magie.ferme.parc -> /magie # perso.ferme.parc -> /perso # Ferme dokuwiki sur chateau <VirtualHost *:80> UseCanonicalName Off ServerName ferme.parc ServerAlias *.ferme.parc VirtualDocumentRoot /var/www/html/dokuwiki <Directory /var/www/html/> Require all granted DirectoryIndex index.php index.html index.htm </Directory> <LocationMatch "/(data|conf|bin|inc|vendor)/"> Require all denied Satisfy All </LocationMatch> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
~$ sudo apachectl configtest Syntax OK
~$ sudo a2enconf perso
~$ sudo a2ensite chateau.parc.conf
~$ sudo a2ensite ferme.parc.conf
~$ sudo systemctl reload apache2
~$ sudo systemctl status apache2