• Reverse proxy issues

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #4781  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.
 #4808  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)?
 #4810  by pavila
 
No, I say that you can't change the /OpenKM to /dms without lots of problems as far as I know.
 #4812  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?
 #4814  by pavila
 
What is the problem with /OpenKM? Why do you need to switch to /dms?
 #4815  by akorn
 
The management wants /dms, for cosmetic reasons I suppose.
 #4827  by pavila
 
Well, you may contact us and we will provide support for your special configuration.
 #4830  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.
 #5156  by akorn
 
Apparently it didn't, because I received no reply. Have you fixed that contact form in the meantime? :)

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.