virtual_host_httpd

naos 2017/10/26 23:20

Virtual host Httpd

testé sur CentOS 7

Exemple de configuration de virtual host sur Httpd avec redirection automatique du port 80 à 443 avec certificat autosigné.

<VirtualHost *:80>
        ServerName wiki.DOMAIN.TLD
        Redirect permanent / https://wiki.DOMAIN.TLD
</VirtualHost>
<VirtualHost *:443>
        ServerAdmin admin@DOMAIN.TLD
        ServerName wiki.DOMAIN.TLD
        RewriteRule ^(.*)$ https://wiki.DOMAIN.TLD/%{REQUEST_URI} [L,R=301]
        SSLEngine on
        SSLCompression off
        SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
        SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
        SSLVerifyClient None
        ErrorLog /var/log/httpd/DOMAIN.TLD/wiki.error.log
        CustomLog /var/log/httpd/DOMAIN.TLD/wiki.access.log combined
        DocumentRoot /var/www/html/wiki
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/html/wiki>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride none
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>
  • virtual_host_httpd.txt
  • Dernière modification: 2017/11/01 22:44
  • par naos