2017-04-18 49 views
3

我是SSL加密新手,需要幫助! (使用cert bot)。如何爲單個啓用SSL的域激活2端口80和4000?

我最近啓用SSL上的Apache和端口80因此Linux上運行的網站,目前網站的樣子:

http://example.com --> https://example.com (done) 

不過,我已經後端端口4000上運行,並希望加密以避免「混合內容」頁錯誤:

http://example.com:4000 --> https://example.com:4000 (Not done yet) 

這正是我所需要的,沒有解決辦法將有所幫助。請指導。

在此先感謝! :-)

+0

嘿Vaibhav的, 您可以重定向一個子'subdomain.example.com '指向'example.com:4000',並請求來自LetsEncrypt的新證書,並在請求證書時指定多個子域。 'certbot certonly --webroot -w/var/www/example/-d www.example.com -d example.com -w/var/www/other -d other.example.net -d another.other.example .net' 查看官方的certbot文檔[這裏](https://certbot.eff.org/docs/using.html#webroot) –

回答

0

您可以創建一個新的子域subdomain.example.com並將其指向example.com:4000,然後從LetsEncrypt請求新的SSL證書,並在使用certbot請求證書時指定多個子域。

certbot certonly --webroot -w /var/www/example/ -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net 

當你有證書和密鑰,它加入你的網絡服務器配置

查看官方certbot文檔here