apache2 - Trouble configuring apache server to proxy an SSL connection -
i'm running application on tomcat7 apache portable runtime, bought ssl certificate , configured correctly - when try connect through ip:port combination, connects fine warns me certificate issued domain name, not ip.
the vps i'm on doesn't have selinux (and there's issue installing), afaik required have ssl configured in apache, want route requests tomcat, on end.
i configured apache proxy connections, first port 80 works perfectly:
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>
and ssl port doesn't want work reason:
namevirtualhost www.mysite.com:443 <virtualhost www.mysite.com:443> sslproxyengine on proxypreservehost on proxyrequests off servername https://www.mysite.com serveralias https://www.mysite.com proxypass / https://localhost:8443/mysite/ proxypassreverse / https://localhost:8443/mysite/ proxypassreversecookiepath /mysite/ / cachedisable * </virtualhost>
edit: added the
requestheader set front-end-https "on"
directive virtualhost www.mysite.com:443, per: http://www.gossamer-threads.com/lists/apache/users/396577
here tomcat apr connector configured in tomcat's server.xml -
<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" />
there no errors/warnings enabling virtual hosts , restarting apache. when try https, see in ffox:
ssl received record exceeded maximum permissible length. (error code: ssl_error_rx_record_too_long)
and in chromium:
error 107 (net::err_ssl_protocol_error): ssl protocol error.
apache's error.log shows warning message:
[warn] [client 216.58.38.90] proxy: no http 0.9 request (with no host line) on incoming request , preserve host set forcing hostname www.mysite.com uri /
i've spent days trying configure it, , grateful if explained what's going on , how fix it.
many thanks. victor.
you don't need 8443 https connector in tomcat. apache httpd should terminate ssl connection, , speak plaintext tomcat, via proxypass / http://localhost:8080/mysite/.
need plaintext http connector port=8080
, , address=127.0.0.1
no outsiders can @ it.
better still, dont' have http connectors in tomcat, ajp connector, address=127.0.0.1
still, , use mod_proxy_ajp in apache.
Comments
Post a Comment