Page 1 of 1

Reverse proxy issues

PostPosted:Mon Apr 26, 2010 9:00 pm
by akorn
Hi,

I'd like to use an apache reverse proxy with URL rewriting in front of OpenKM 4.1RC1. This appears to mostly work as intended, but in the log I see messages like these:
Code: Select all
22:33:55,616 INFO  [[/OpenKM]] ERROR: The module path requested, /dms/es.git.openkm.frontend.Main/, is not in the same web application as this servlet, /OpenKM.  Your module may not be properly configured or your client and server code maybe out of date.
22:33:55,616 INFO  [[/OpenKM]] WARNING: Failed to get the SerializationPolicy '6B9DF8C4DDF966DC04215E0FDD070F70' for module 'https://mydomain.net/dms/es.git.openkm.frontend.Main/'; a legacy, 1.3.3 compatible, serialization policy will be used.  You may experience SerializationExceptions as a result.
Should I be worried?

Also, what's the correct solution to this problem? Analysing the http traffic between apache and openkm, I can see stuff like this:
Code: Select all
POST /OpenKM/OKMAuthServlet HTTP/1.1
Host: openkm.host.internal:8080
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; de-de) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7
Origin: https://mydomain.net
Content-Type: text/x-gwt-rpc; charset=utf-8
Referer: https://mydomain.net/dms/es.git.openkm.frontend.Main/6BCA55867A700DFC0FE70E88A199EDC9.cache.html
Accept: */*
Accept-Language: de-de
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=7D0E4CFA74BB25681DFF10B62551EDB0
Via: 1.1 mydomain.net
X-Forwarded-For: 172.18.24.48
X-Forwarded-Host: mydomain.net
X-Forwarded-Server: mydomain.net
Connection: Keep-Alive
Content-Length: 256

5|0|6|https://mydomain.net/dms/es.git.openkm.frontend.Main/|225BFC1814D68B2C24521C8732E099F1|es.git.openkm.frontend.client.service.OKMAuthService|getGrantedUsers|java.lang.String|/okm:root/STR/somefile.DOC|1|2|3|4|1|5|6|
Now, apparently jboss is troubled that the apparent path of the webapp, /dms, doesn't match the hard-coded default of /OpenKM. It only learns of the apparent path because the browser actually submits a POST request where the content includes it. (Does this behaviour serve a useful purpose?)

What would be the best way to tell jboss to accept /dms as equivalent to /OpenKM in these POST requests? (The _target_ of the request is correctly rewritten by apache to /OpenKM, only the content isn't.)

Or do I need to find some way to rewrite the content of the HTTP requests before submitting them to jboss? That would not be nice.

Thanks.

Re: Reverse proxy issues

PostPosted:Wed Apr 28, 2010 8:23 pm
by pavila

Re: Reverse proxy issues

PostPosted:Wed Apr 28, 2010 9:19 pm
by akorn
I've had trouble with ajp before and am using simple HTTP proxying. Are you saying that is what's causing my problem?

The relevant part of my apache configuration looks like this:
Code: Select all
	RewriteRule		^/dms(.*)		http://internal.hostname:8080/OpenKM$1	[P,L]
	ProxyPassReverse	/dms/		http://internal.hostname:8080/OpenKM/
Are you saying that simply replacing this with:
Code: Select all
<Location /dms>
	ProxyPass ajp://internal.hostname:8009/OpenKM
	ProxyPassReverse http://internal.hostname/OpenKM
</Location>
would solve the problem (provided I make jboss bind to 0.0.0.0:8009 instead of just localhost)?

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 8:16 am
by pavila
No, I say that you can't change the /OpenKM to /dms without lots of problems as far as I know.

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 11:31 am
by akorn
And I absolutely can't make the same OpenKM instance visible under two different path names?

That's inconvenient. Just out of curiosity: why does OpenKM need to know what path is used to access it? Normally the reverse proxy would hide this from a web application; OpenKM only knows because the location is revealed in POST requests made by the user. Why is this needed?

Also, what manner of problems should I expect if I use /dms instead of /OpenKM?

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 2:13 pm
by pavila
What is the problem with /OpenKM? Why do you need to switch to /dms?

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 2:23 pm
by akorn
The management wants /dms, for cosmetic reasons I suppose.

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 8:08 pm
by pavila
Well, you may contact us and we will provide support for your special configuration.

Re: Reverse proxy issues

PostPosted:Thu Apr 29, 2010 10:35 pm
by akorn
I just tried and received an error message stating that I am "not authorized to view this resource". I don't know if my message got through.

Re: Reverse proxy issues

PostPosted:Thu May 27, 2010 9:20 am
by akorn
Apparently it didn't, because I received no reply. Have you fixed that contact form in the meantime? :)