posted by Sebastien Jourdain at Oct 26, 2007 12:24 PM
Quote
Great to hear that...Thanks for your feed back.
! SOLVED ! RE : Configure Libresource through apache reverse proxy
posted by Alexandre Neubert at Oct 24, 2007 12:09 PM
Quote
Hello,I solved my problem by:
The problem was that not all resources were redirected, so I got partial information (and as result the ugly result).RegardsA.
- Configuring my apache to have a libresource virtual host
- Configure the rules of the reverse proxy with a regular expression to redirect every request with the same path to Libresource server
- Not changing the libresourceConfig.properties file
The problem was that not all resources were redirected, so I got partial information (and as result the ugly result).RegardsA.
posted by Alexandre Neubert at Oct 15, 2007 5:37 PM
Quote
Yet another test; if I access directly in my web browser http://ip_machine_name_B:9000 (the url where the libresource server is deployed), I get the same ugly page (the kernel.serverUrl is still configured as you sayed in your previous post).
So, this does obviously not come from the reverse proxy configuration but from the kernel.serverUrl value.
If I add kernel.serverUrl with subcontext, I get the right page, and if the value has no subcontext I get the page mentionned before.Is this a DNS problem? To answer your question, a nslookup from the Libresource server machine to the apache gives me the right answer.
I also compared the generated html between the two configs (local access which works and with kernel.serverUrl pointing to the reverse proxy which does not work):
which seems normal. I really don't see why this does not work except a DNS problem. But, in that case, why do I get the ugly page when i access the server locally (with kernel.serverUrl pointing to the reverse server)?A.
- The only difference is one html tag:
<base href="http://ip_machine_name_B:9000/"/> vs <base href="http://libresource_dns_name_machine_A:80//"/>
posted by Sebastien Jourdain at Oct 15, 2007 4:58 PM
Quote
You should keep
But I was wondering if the libresource server has access to your specific DNS ? (in order to resolved libresource_dns_name_machine_A)Another way of checking of what is going wrong :
kernel.serverUrl=http://libresource_dns_name_machine_A/
- Check the html page if it tries to retrieve stylesheet in a wrong location.
- Check the url in another browser on the server and on another computer...
posted by Alexandre Neubert at Oct 15, 2007 4:40 PM
Quote
Hello, thanks again for your help.
Unfortunately it was'nt possible to proceed as you suggested since we did not want to rebuild the application from sources.
So, we simply added a libresource dedicated name to our DNS and configured the apache server to have one more virtual host (also dedicated to libresource). So, the configuration I described becomes:
where libresource_dns_name_machine_A is the libresource dedicated name in our DNS. Basically, libresource_dns_name_machine_A is libresource.dns_name_machine_A, so it has the same domain.
Now, I should be able to call http://libresource_dns_name_machine_A which should redirect me to the libresource default page. Instead, I get very ugly page with no stylesheets and all libresource menus aligned on the left, no images.
I tried rechange the kernel.serverUrl=http://ip_machine_name_B:9000, just for test and now I get the expected page (but of course, this solution isn't satisfying since only the first request will get through the reverse proxy).
It seems to me as if the error would come from the value I set to the kernel.serverUrl
but I don't see what. Any idea?ThanksRegardsA.
- In the apache proxy.conf file
ProxyPass / http://ip_machine_B:9000 ProxyPassReverse / http://ip_machine_B:9000
- In libresourceConfig.properties on the Libresource server
kernel.serverUrl=http://libresource_dns_name_machine_A/
- In server.xml of the Libresource server:
<Connector port="9000" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="9043" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" proxyName="libresource_dns_name_machine_A" proxyPort="80"/>
posted by Sebastien Jourdain at Oct 8, 2007 11:19 AM
Quote
Libresource as been thought at the beginning to be deployed at a context root.So to do the thing you want to do, I would recommend:
- Edit the file Distribution/build.properties and change the property "services.web.context=/libresource"
- Set the kernel.serverUrl=http://dns_name_machine_A
- change the proxy to point to http://dns_name_machine_B:9000/libresource
posted by alexandreneubert at Oct 8, 2007 10:59 AM
Quote
Hi,
Thanks for your answer. I added the proxy info, but I still have the same problem. Maybe I develop a little bit more the conf I made:
So, reverse proxy is sending to Libresource server if I call: http://dns_name_machine_A/libresource and Libresource server is calling the reverse proxy via the kernel.serverUrl. Now the behavior I get in the menu for example:
- Apache 2.2 reverse proxy is running on machine A and port 80
- Libresource server is running on machine B and port 9000
- In the apache proxy.conf file
ProxyPass /libresource http://ip_machine_B:9000 ProxyPassReverse /libresource http://ip_machine_B:9000
- In libresourceConfig.properties on the Libresource server
kernel.serverUrl=http://dns_name_machine_A/libresource
- In the server.xml of the Libresource server:
<Connector port="9000" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="9043" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" proxyName="dns_name_machine_A" proxyPort="80"/>
So, reverse proxy is sending to Libresource server if I call: http://dns_name_machine_A/libresource and Libresource server is calling the reverse proxy via the kernel.serverUrl. Now the behavior I get in the menu for example:
- For generated links like children tag, I get http://dns_name_machine_A/libresource/projects/myproject which works since he uses the kernel.serverUrl
- For hard coded links like ! forum ! I get urls like: http://dns_name_machine_A/projects/myproject/forum
- This behavior is on other links, too (like login and logout and which are not on the menu)
posted by Sebastien Jourdain at Oct 5, 2007 5:46 PM
Quote
You forgot to specify in Tomcat the proxyname and proxy port.To do so just edit the file JONAS_ROOT/conf/server.xml
<Connector port="9000" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="9043" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" proxyName="www.toto.org" proxyPort="80"/>
posted by alexandreneubert at Oct 5, 2007 5:36 PM
Quote
Hello,I want to configure libresource to be available on a machine A through an apache reverse proxy located on a machine B.I added in proxy.conf of the apache following rule:and in LibreSource/JONAS_4_7_6/conf/libresourceConfig.properties
kernel.serverUrl=http://ip_machine_A/libresourceThis works except for hard coded paths. But I have the feeling this is not the right way.Does anyone has done such a configuration yet and if yes, what am I doing wrong? Or is there somewhere a documentation or simply a link?Thanks a lotRegardsA.
ProxyPass /libresource http://ip_machine_A:port ProxyPassReverse /libresource http://ip_machine_A:port