Apache:添加SSL时,站点变得不可用

时间:2017-08-02 04:22:03

标签: apache ubuntu tomcat ssl dns

我在ubuntu中使用Apache2将请求路由到tomcat webapp。我也在尝试添加SSL。以下是apache 000-default.conf文件。

<VirtualHost *:80>
    ProxyPreserveHost On

    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example:
    ProxyPass / http://0.0.0.0:8080/
    ProxyPassReverse / http://0.0.0.0:8080/

    ServerName localhost
</VirtualHost>

<VirtualHost *:443>
        ServerAdmin webmaster@localhost
        DocumentRoot /opt/apache-tomcat-7.0.79/webapps/myglukose_messaging_portal/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        SSLEngine On
        # Set the path to SSL certificate
        # Usage: SSLCertificateFile /path/to/cert.pem
        SSLCertificateFile /etc/apache2/ssl/STAR_myglukose_com.crt
        SSLCertificateKeyFile /etc/apache2/ssl/private_key.key
        ProxyPreserveHost On
        ProxyPass / http://<my-ip>/:8080/
        ProxyPassReverse / http://<my-ip>/:8080/
        ServerName localhost
</VirtualHost>

在我为端口443进行配置之前,一切都很好。完成后,网站就会变得不可用,浏览器会说“#34;无法访问此网站”。拒绝联系。&#34;。我的tomcat Web应用程序部署为&#34; ROOT&#34;所以可以通过端口80配置访问。这有什么不对吗?

0 个答案:

没有答案