Tmcat Apache ssl subsonic

Need help? Post your questions here.

Moderator: moderators

Tmcat Apache ssl subsonic

Postby john42 » Tue Jun 21, 2011 9:51 am

Hi,

my setup ist a dedicated tomcat with the subsonic war + a apache2 webserver with ssl activated in front which is used as a proxy for the tomcat.

Added the following mod rewrite rules to the Apache ssl config

RewriteEngine On

ProxyPass /subsonic http://localhost:8080/subsonic
ProxyPassReverse /subsonic http://localhost:8080/subsonic

Which works perfectly.

But i dont really like to have it under mydomain.com/subsonic.

So i changed the Rule to:

ProxyPass /myxy http://localhost:8080/subsonic
ProxyPassReverse /myxy http://localhost:8080/subsonic

But now i get when i try to login a:

Not Found

The requested URL /subsonic/j_acegi_security_check;jsessionid=690CB1206B841B4E0A690D00D1FC71EF was not found on this server.


Anyone know how to fix this?
john42
 
Posts: 2
Joined: Tue Jun 21, 2011 9:42 am

Postby nullchar » Thu Jun 23, 2011 7:02 pm

Could you have an old cookie or something cached in your browser that had the old URL somehow?

The rules look good to me...

You shouldn't need the RewriteEngine unless you have rewrite conditions and rules (RewriteCond / RewriteRule).

Before the ProxyPass / ProxyPassReverse lines, try adding "ProxyRequests Off" which disables any arbitrary proxying. (Good to have even if this doesn't fix your issue.)

You might also try the Location directive...

Code: Select all
ProxyRequests Off
<Location /myxy>
  ProxyPass http://localhost:8080/subsonic
  ProxyPassReverse http://localhost:8080/subsonic
</Location>


However, the "best" way to proxy tomcat behind apache is mod_jk. Enable the module, then add this to your virtual host:

Code: Select all
  # mod_jk / AJP 1.3
  JkOptions +ForwardURICompatUnparsed +ForwardDirectories
  JkMount /myxy/* tomcat


(Where 'tomcat' above is the name of your 'worker'.) Then in your workers.properties (under apache conf somewhere, like /etc/apache2), try this:

Code: Select all
  worker.list=tomcat
  worker.tomcat.host=localhost
  worker.tomcat.port=8009
  worker.tomcat.type=ajp13
  worker.tomcat.lbfactor=1
  worker.tomcat.mount=/myxy /subsonic/*  # should only need if changing from/to mount points, if just using /subsonic to /subsonic, remove this line.


I've not ever tried changing the from/to mount point under mod_jk. I've only needed to pass apache /foo to tomcat /foo. When using mod_jk, you also have to instruct tomcat to enable the AJP protocol.

In server.xml: (e.g. /etc/tomcat6/server.xml)

Code: Select all
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />



On last thing to try: rename subsonic.war to myxy.war, then deploy it. (Don't have both wars deployed!)
nullchar
 
Posts: 9
Joined: Tue Nov 16, 2010 5:13 am
Location: Idaho, US


Return to Help

Who is online

Users browsing this forum: No registered users and 28 guests