HTTPS多網站1個IP多個SSL證書的Apache設定辦法
原文網址:https://itw01.com/5OXHE2Q.html
Using Multiple SSL Certificates in Apache with One IP Address
https://www.digicert.com/ssl-support/apache-multiple-ssl-certificates-using-sni.htm
How To Set Up Multiple SSL Certificates on One IP with Apache on Ubuntu 12.04
https://www.digitalocean.com/community/tutorials/how-to-set-up-multiple-ssl-certificates-on-one-ip-with-apache-on-ubuntu-12-04
資料權限設定
SSL => chmod 755
private => chmod 710 private
檔案:
The .crt file (chown root:root and chmod 644)
private key location; (chown root:ssl-cert and chmod 640)
---------------------------------------------------------
Note:chmod 710 supports ssl-cert group under Ubuntu. (See comments)
Setting permission to 700 on /etc/apache2/ssl/private will also work fine.
Place SSL files:
Put public www ssl certificate(s) along with intermediate certificate(s) in
/etc/apache2/ssl
Put private ssl key(s) in/etc/apache2/ssl/private
Set owner:
sudo chown -R root:root /etc/apache2/ssl/
sudo chown -R root:ssl-cert /etc/apache2/ssl/private/
Note:
If you do not have ssl-cert group, just use 'root:root' on line above or skip 2nd line.
Set permissions:
Public Certificate(s)
sudo chmod 644 /etc/apache2/ssl/*.crt
Private Key(s)
sudo chmod 640 /etc/apache2/ssl/private/*.key
Note:
The group permission is set to READ (640) due to Ubuntu ssl-cert group. '600' is fine as well.
Enable the Apache SSL module
sudo a2enmod ssl
Edit any Apache site files and enable
(see last paragraph) *
sudo nano /etc/apache/sites-available/mysiteexample-ssl.conf
sudo a2ensite mysiteexample-ssl
# ^^^^^^^^^^^^^^^^^ <-Substitute your ".conf" filename(s)
Restart Apache2 service
sudo service apache2 restart
or
sudo systemctl restart apache2.service