我在我的服務器中創建了一個虛擬主機,我想爲它設置HTTPS。 我抄另一個虛擬主機文件,但我得到爲我的虛擬主機設置SSL
「您的連接不安全」
文件正常工作與其他站點(站點1)。我是否應該爲第二個網站創建不同的證書(mywebsite.com)?如果是的話,那我該怎麼做。 這裏是我的/etc/apache2/sites-available/www.mywebsite.com.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.dev.clevvermail.com
DocumentRoot /var/www/vhosts/ww.mywebsite.com-dev/current
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Redirect 301/https://www.mywebsite.com/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /var/www/vhosts/mywebsite.com-dev/current
ServerName www.dev.clevvermail.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/www2.site1.com-0001/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www2.site1.com-0001/privkey.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /var/www/vhosts/mywebsite.com-dev/ >
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
SSLCertificateChainFile /etc/letsencrypt/live/www2.site1.com-0001/chain.pem
</VirtualHost>
</IfModule>
您需要每個虛擬主機/域的SSL證書。您不能將abc.com的SSL證書用於xyz.com域,反之亦然。您必須爲域xyz.com添加另一個虛擬主機,等等...... –