Hôte virtuel Apache pour Impilo

NOTE: Mise à jour pour Ubuntu 18.04

Idéalement, toute la documentation d'Impilo est basé sur du contenu Web, centralisé à un seul endroit qui est spécifique à Impilo. Pour permettre à un serveur Impilo de redéployer un matériel alternatif, j'ai crée un profil de serveur virtuel pour Apache selon la procédure suivante:

% cd /opt/bio/docs
% sudo mkdir ./wiki
% sudo chown -R www-data:www-data ./wiki

% cd /etc/apache2/sites-available
% sudo cp 000-default.conf impilo.conf

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
        # On change la localisation du point d'entrée dans le matériel
#	DocumentRoot /var/www/html
	DocumentRoot /opt/bio/docs/wiki
	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf

        # Addition pour redirection vers HTTPS
        # To force redirect toward https from http
	RewriteEngine On
	RewriteCond %{HTTPS} off
	RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

# Ceci créera un certificat SSL on-the-fly
% sudo apt-get install ssl-cert
# Il faut ensuite parametrer Apache
% sudo a2enmod ssl
% sudo a2enmod rewrite
% cd /etc/apache2/sites-available
% sudo cp default-ssl.conf impilo-ssl.conf 

# Remarque l'addition du commentaire...
#               DocumentRoot /var/www/html
                DocumentRoot /opt/bio/docs/wiki

# Lorsque vous trouverez cette section... 
# À commenter!!
#<Directory /var/www/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>

# Nouvel addition pour notre installation
<Directory /opt/bio/docs/wiki>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

# Ne nous concerne pas...
#<Directory /srv/>
#       Options Indexes FollowSymLinks
#       AllowOverride None
#       Require all granted
#</Directory>

% sudo a2dissite 000-default.conf
% sudo a2ensite impilo
% sudo a2ensite impilo-ssl.conf
% sudo /etc/init.d/apache2 restart