微信开发之——Ubuntu Apache2的https域名配置
我的網(wǎng)站是騰訊云服務(wù)器的,根據(jù)官網(wǎng)的SSL證書安裝配置指示:https://cloud.tencent.com/document/product/400/4143
下載騰訊頒發(fā)的SSL證書:有3個文件,分別是:
1_root_bundle.crt,2_www.域名.com.crt,3_www.域名.com.key
1、添加監(jiān)聽端口
編輯Apache端口配置(/etc/apache2/ports.conf),加入443端口(SSL缺省使用):
Listen 80
Listen 443
B、設(shè)置site-enabled
上文安裝完后,會在/etc/apache2/sites-available/目錄下生成一個缺省的default-ssl文件。缺省的網(wǎng)頁目錄仍然是/var/www/。我們可以創(chuàng)建一個鏈接到site-enabled目錄。
ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/001-ssl
C、修改配置文件
HTTPS監(jiān)聽端口缺省443:
把端口改為443,在<Virtualhost>下加入SSL認(rèn)證配置,其它的根據(jù)需要自己定制 與普通配置無異:
vim /etc/apache2/sites-enabled/000-default.conf,修改以下內(nèi)容
DocumentRoot "/var/www/html"ServerName www.域名.comSSLEngine onSSLCertificateFile /home/axxxx/2_www.域名.com.crtSSLCertificateKeyFile /home/axxxx/3_www.域名.com.keySSLCertificateChainFile /home/axxxx/1_root_bundle.crt
2、重啟APACHE
# /etc/init.d/apache2 restart
?
如有問題,請咨詢我的qq:1290851757,備注:csdn博客問問題的
總結(jié)
以上是生活随笔為你收集整理的微信开发之——Ubuntu Apache2的https域名配置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Openshift 4.4 静态 IP
- 下一篇: 怎么修改RO服务器版本,谁知道build