我幾乎是設置服務器的新手,並且遇到問題。我有一個Ubuntu 16.04 VPS並安裝了Apache2和Tomcat7。我正在使用LetsEncrypt和Certbot進行SSL。我有一個單獨的webapp,作爲ROOT.war進行部署。這個webapp爲2個不同的用戶組提供服務,我實現了一個「多站點」解決方案,用於檢查傳入的DNS並相應地過濾數據(以及UI更改)。所以我有www.sitea.com和www.siteb.com都指向本地主機。這裏是我的000-default.comf帶有Apache/Tomcat的ReverseProxy多個DNS,帶有SSL的單個webapp
Listen 80
<VirtualHost *:80>
ServerName www.sitea.com
ProxyPreserveHost On
ProxyPass/http://127.0.0.1:8080/
ProxyPassReverse/http://127.0.0.1:8080/
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.sitea.com
RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
ServerName www.siteb.com
ProxyPreserveHost On
ProxyPass/http://127.0.0.1:8080/
ProxyPassReverse/http://127.0.0.1:8080/
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.siteb.com
RewriteRule^https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
而我的000默認-LE-ssl.conf中
<IfModule mod_ssl.c>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass/http://127.0.0.1:8080/
ProxyPassReverse/http://127.0.0.1:8080/
SSLCertificateFile /etc/letsencrypt/live/www.sitea.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.sitea.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName www.sitea.com
</VirtualHost>
<VirtualHost *:443>
ProxyPreserveHost On
ProxyPass/http://127.0.0.1:8080/
ProxyPassReverse/http://127.0.0.1:8080/
SSLCertificateFile /etc/letsencrypt/live/www.siteb.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.siteb.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName www.siteb.com
</VirtualHost>
</IfModule>
因此,對於初始配置我用Certbot的Apache的插件配置站點A SSL( siteb在不同的服務器上生產)。這似乎工作正常。現在,當我更改A記錄以將siteb的DNS指向新服務器時,我從Apache獲得了503。我確實回去並使用Certbot獲取2個證書,每個DNS一個。任何幫助,將不勝感激。