Apache. Два SSL сайта на одном сервере.

/ Просмотров: 521
Метки: , , ,
Apache. Два SSL сайта на одном сервере.

/etc/apache2/sites-enabled/default-ssl.conf

<IfModule mod_ssl.c>
        <VirtualHost *:443>
                ServerAdmin webmaster@localhost
                ServerName site01.domain.com
                DocumentRoot /var/www/site01
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLEngine on
                SSLCertificateFile      /etc/letsencrypt/live/site01.domain.com/cert.pem
                SSLCertificateKeyFile   /etc/letsencrypt/live/site01.domain.com/privkey.pem
                SSLCertificateChainFile /etc/letsencrypt/live/site01.domain.com/chain.pem
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
        </VirtualHost>
        <VirtualHost *:443>
                ServerAdmin webmaster@localhost
                ServerName site02.domain.com
                DocumentRoot /var/www/site02
                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined
                SSLEngine on
                SSLCertificateFile      /etc/letsencrypt/live/site02.domain.com/cert.pem
                SSLCertificateKeyFile   /etc/letsencrypt/live/site02.domain.com/privkey.pem
                SSLCertificateChainFile /etc/letsencrypt/live/site02.domain.com/chain.pem
                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>
        </VirtualHost>
</IfModule>