配置apache服务器代理SSL连接时出现问题

配置apache服务器代理SSL连接时出现问题,ssl,apache2,virtualhost,mod-proxy,mod-ssl,Ssl,Apache2,Virtualhost,Mod Proxy,Mod Ssl,我用Apache Portable Runtime在Tomcat7上运行应用程序,我购买了一个SSL证书并正确配置了它-当我尝试通过ip:port组合进行连接时,它连接良好,但警告我证书颁发给域名,而不是ip 我所在的VPS没有SELinux(安装时有一个问题),这是在apache中配置SSL所必需的,所以我只想将请求路由到Tomcat,Tomcat会在其一端进行配置 我将apache配置为代理连接,首先使用工作正常的端口80: NameVirtualHost www.mysite.com:80

我用Apache Portable Runtime在Tomcat7上运行应用程序,我购买了一个SSL证书并正确配置了它-当我尝试通过ip:port组合进行连接时,它连接良好,但警告我证书颁发给域名,而不是ip

我所在的VPS没有SELinux(安装时有一个问题),这是在apache中配置SSL所必需的,所以我只想将请求路由到Tomcat,Tomcat会在其一端进行配置

我将apache配置为代理连接,首先使用工作正常的端口80:

NameVirtualHost www.mysite.com:80
<VirtualHost www.mysite.com:80>
ProxyPreserveHost On
ProxyRequests Off
ServerName http://www.mysite.com
ServerAlias http://www.mysite.com
ProxyPass / http://localhost:8180/MYSITE/
ProxyPassReverse / http://localhost:8180/MYSITE/
ProxyPassReverseCookiePath /MYSITE/ /
</VirtualHost>
虚拟主机www.mysite.com:443的指令,根据:

以下是Tomcat的server.xml中配置的Tomcat APR连接器-

<Connector port="8443" maxHttpHeaderSize="16500"
                 maxThreads="150"
                 enableLookups="false" disableUploadTimeout="true"
                 acceptCount="100" scheme="https" secure="true"
                 SSLEnabled="true"
                 SSLCertificateFile="x509-cert-path"
                 SSLCertificateKeyFile="key-file-path"
 />
在铬中:

Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
Apache的error.log显示以下警告消息:

[warn] [client 216.58.38.90] proxy: no HTTP 0.9 request (with no host line) on incoming request and preserve host set forcing hostname to be www.mysite.com for uri /
我已经花了好几天的时间尝试配置它,如果有人解释发生了什么以及如何修复它,我将不胜感激

非常感谢。
Victor。

您不需要Tomcat中的8443 HTTPS连接器。apachehttpd应该终止SSL连接,并通过
ProxyPass/http://localhost:8080/MYSITE/.
您只需要一个带有
端口=8080
地址=127.0.0.1
的纯文本HTTP连接器,这样就没有外人可以使用它了

更好的是,不要在Tomcat中使用任何HTTP连接器,只使用AJP连接器,
address=127.0.0.1
still,并在Apache中使用mod_proxy_AJP

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)
Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.
[warn] [client 216.58.38.90] proxy: no HTTP 0.9 request (with no host line) on incoming request and preserve host set forcing hostname to be www.mysite.com for uri /