Voici mes prises de notes pour configurer un site Internet http. Le configuration est destinée pour un site Internet dont le sous-domaine est srv195.
Configurer Apache 2 pour un site Internet
http://srv195.acego.fr
La configuration du site Internet s'effectue dans un fichier de configuration.
srv195.acego.fr.
On configure un site web à partir d'un fichier conf qui contient des directives. Dans notre exemple de fichier conf, il sera configuré le site Internet srv195.acego.fr.
Le fichier à créer est /etc/apache2/sites-available/100-fr.acego.srv195.conf :
<VirtualHost *:80>
ServerName srv195.acego.fr
Protocols h2 http/1.1
DocumentRoot /var/www/acego.fr/srv195
<Directory /var/www/acego.fr/srv195>
Options -Indexes
AllowOverride all
Order allow,deny
allow from all
</Directory>
<Location />
Require all granted
</Location>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/srv195.acego.fr-error.log
CustomLog ${APACHE_LOG_DIR}/srv195.acego.fr-access.log combined
</VirtualHost>
On active la configuration du site en utilisant le binaire a2ensite
sudo a2ensite 100-fr.acego.srv195
Et si tout se passe bien, on recharge la configuration d'Apache 2 sans avoir besoin de redémarre le service :
sudo service apache2 reload
— Cédric ABONNEL dit Cédrix 2020/05/03 16:59