是否有可能在该Apache版本上设置多个域的SSL?
我有站点A – > ssl证书A站点B – >证书B
那么每个文件都有这样的虚拟主机,但它不工作:只有网站A有正确的申请证书,浏览器说siteB有siteA证书..
<Virtualhost *:8888> ServerName www.siteA.com DocumentRoot /var/www/siteA/ RewriteEngine On <Directory /var/www/siteA/> Options -Indexes +FollowSymLinks AllowOverride all Order allow,deny allow from all </Directory> Loglevel warn ErrorLog /var/log/apache2/siteA-error.log CustomLog /var/log/apache2/siteaA combined </VirtualHost> NameVirtualHost *:443 # Go ahead and accept connections for these vhosts # from non-SNI clients SSLStrictSNIVHostCheck off <IfModule mod_ssl.c> <Virtualhost *:443> ServerName siteA.com DocumentRoot /var/www/siteA/ RewriteEngine On <Directory /var/www/siteA/> Options -Indexes +FollowSymLinks AllowOverride all Order allow,deny allow from all </Directory> CustomLog /var/log/apache2/siteA combined # Some rewrite rules in this file were disabled on your HTTPS site, # because they have the potential to create redirection loops. # RewriteCond %{SERVER_NAME} =s # RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] SSLCertificateFile /etc/letsencrypt/live/siteA/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/siteA/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf </VirtualHost> </IfModule>
apachectl -S
*:443 is a NameVirtualHost default server siteA (/etc/apache2/sites-enabled/siteA:24) port 443 namevhost siteA (/etc/apache2/sites-enabled/siteA:24) port 443 namevhost siteB (/etc/apache2/sites-enabled/siteB:8)