申請SSL憑證http與https共存

申請SSL憑證

https://manage.sslforfree.com/dashboard

ZeroSSL RSA Domain Secure CA

(Let’s Encrypt Authority X3)

申請時http與https需共存,因此要修改httpd.conf

apache 設定檔httpd.conf 位於etc/httpd/conf

因這台主機有兩個網域名稱,故httpd.conf設定檔如下:

<VirtualHost *:80>
ServerAdmin tygfriber@gmail.com
DocumentRoot “/var/www/html2”
ServerName lohas.ddns.net
ServerAlias www.lohas.ddns.net
ErrorLog “logs/lohas/error_log”
CustomLog “logs/lohas/access_log” common
</VirtualHost>
<virtualhost *:443>
DocumentRoot “/var/www/html2/”
ServerName lohas.ddns.net
<directory “/var/www/html2/”>
AllowOverride All
Options FollowSymLinks
AddDefaultCharset UTF-8
Order allow,deny
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin tygfriber@gmail.com
DocumentRoot “/var/www/html”
ServerName tygtw.ddns.net
ServerAlias www.tygtw.ddns.net
ErrorLog “logs/error_log”
CustomLog “logs/access_log” common
</VirtualHost>
<virtualhost *:443>
DocumentRoot “/var/www/html/”
ServerName tygtw.ddns.net
<directory “/var/www/html/”>
AllowOverride All
Options FollowSymLinks
AddDefaultCharset UTF-8
Order allow,deny
</Directory>
</VirtualHost>

friber

By friber