微信开发之——Ubuntu Apache2的https域名配置
我的網站是騰訊云服務器的,根據官網的SSL證書安裝配置指示:https://cloud.tencent.com/document/product/400/4143
下載騰訊頒發的SSL證書:有3個文件,分別是:
1_root_bundle.crt,2_www.域名.com.crt,3_www.域名.com.key
1、添加監聽端口
編輯Apache端口配置(/etc/apache2/ports.conf),加入443端口(SSL缺省使用):
Listen 80
Listen 443
B、設置site-enabled
上文安裝完后,會在/etc/apache2/sites-available/目錄下生成一個缺省的default-ssl文件。缺省的網頁目錄仍然是/var/www/。我們可以創建一個鏈接到site-enabled目錄。
ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/001-ssl
C、修改配置文件
HTTPS監聽端口缺省443:
把端口改為443,在<Virtualhost>下加入SSL認證配置,其它的根據需要自己定制 與普通配置無異:
vim /etc/apache2/sites-enabled/000-default.conf,修改以下內容
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博客問問題的
總結
以上是生活随笔為你收集整理的微信开发之——Ubuntu Apache2的https域名配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Openshift 4.4 静态 IP
- 下一篇: Ubuntu作为服务器其tomcat被远