Page 1 of 1

Login returns to localhost

PostPosted:Wed Mar 30, 2011 5:58 pm
by seanwhe
Hi,

When I log out of OpenKM it return me to http://localhost:8080/OpenKM/com.openkm ... /index.jsp

But I access OpenKM from http://F.Q.D.N/

Where do I set it so that logout return to the login screen at http://F.Q.D.N/

Sean

Re: Login returns to localhost

PostPosted:Thu Mar 31, 2011 3:27 pm
by lucas.santana
Probally this is a problem in your server.xml file, verify if the settings are correct.
This file is located at your-jboss-installation\server\default\deploy\jboss-web.deployer\server.xml.
:D

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 5:35 am
by seanwhe
Hi,

Would you have any idea on what to modify. There are two instances where localhost is referenced.

Do I use the FQDN or the IP address and do I need to modify both instances of localhost?

Sean

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 1:52 pm
by lucas.santana
Please, do two tests to me understand the problem:

Firstly Add this line in your OpenKM.cfg: application.url=http://the-name-of-your-host:8080/OpenKM/index.jsp
Restart the Jboss server and try again.

If don't work, replace the localhost reference in your server.xml file to IP of your server, also in your OpenKM.cfg ( application.url=http://your-IP-address:8080/OpenKM/index.jsp ).

Try now! :D

Greetings from new world.

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 6:00 pm
by seanwhe
Hi,

The application.url=http://the-name-of-your-host/OpenKM/index.jsp was always set in the OpenKM.cfg

So I tried replace all instances of localhost in server.xml with IP-address of server.

I try service jboss restart but end up rebooting the server
http://forum.openkm.com/viewtopic.php?f ... 673#p10003

I try to bring up OpenKM and this time all I get is a blank page. No login, no nothing. Blank.

So I go back to OpenKM.cfg and
Set application.url=http://the-name-of-your-host:8080/OpenKM/index.jsp

I reboot server.

Try access the web and still get blank. Now I hard refresh browser to see if it is a cache problem, I am no not using proxy so it cannot be proxy. Hmmm.

I go back to server/default/deploy/jboss-web.deployer/server.xml
and change ip-address back to localhost

I reboot server

Open URL and walla it is back. So it means that it does not matter whether
application.url=http://the-name-of-your-host/OpenKM/index.jsp
or
application.url=http://the-name-of-your-host:8080/OpenKM/index.jsp

But I still have logout to localhost.
Version is 5.0.3

Hope this helps.

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 6:23 pm
by seanwhe
Got it!!!

I am using Apache and therefore have integrated the AJP in accordance with
http://wiki.openkm.com/index.php/Apache

I used this VirtualHost configuration
Code: Select all
<VirtualHost *:80>
  ServerName openkm.your-domain.com
  ProxyPass / ajp://localhost:8009/OpenKM/
  ProxyPassReverse / http://openkm.your-domain.com/OpenKM/
  ErrorLog /var/log/apache2/your-domain.com-error.log
  CustomLog /var/log/apache2/your-domain.com-access.log combined
 
  RewriteEngine on
  RewriteCond %{REQUEST_URI} /OpenKM*
  RewriteRule ^(/.*)$ http://localhost:8080$1 [P]
 
  RequestHeader edit X-GWT-Module-Base ^(http://openkm.your-domain)/frontend/(.*)$ $1/OpenKM/frontend/$2
</VirtualHost>
The example has a slight error and should be
Code: Select all
<VirtualHost *:80>
  ServerName openkm.your-domain.com
  ProxyPass / ajp://localhost:8009/OpenKM/
  ProxyPassReverse / http://openkm.your-domain.com/OpenKM/
  ErrorLog /var/log/apache2/your-domain.com-error.log
  CustomLog /var/log/apache2/your-domain.com-access.log combined
 
  RewriteEngine on
  RewriteCond %{REQUEST_URI} /OpenKM*
  RewriteRule ^(/.*)$ http://F.Q.D.N:8080$1 [P]
 
  RequestHeader edit X-GWT-Module-Base ^(http://openkm.your-domain)/frontend/(.*)$ $1/OpenKM/frontend/$2
</VirtualHost>
Once I changed this the RewriteRule to this RewriteRule ^(/.*)$ http://F.Q.D.N:8080$1 [P] and service apache2 restart I can login and on logout I am returned to the home login at http://F.Q.D.N:8080/OpenKM/com.openkm.f ... /index.jsp

Now the only issue is that I login at
http://F.Q.D.N/com.openkm.frontend.Main/index.jsp and am logged out to
http://F.Q.D.N:8080/OpenKM/com.openkm.f ... /index.jsp

Any hint on how to fix that?

Thanks

I modified http://wiki.openkm.com/index.php/Apache in accordance.

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 6:38 pm
by lucas.santana
But... Why are you using virtual host with OpenKM?

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 6:45 pm
by seanwhe
OpenKM is on the internet and I would rather access from http://F.Q.D.N than http://F.Q.D.N:8080/OpenKM/

Re: Login returns to localhost

PostPosted:Fri Apr 01, 2011 7:21 pm
by lucas.santana
Interesting... In this case i don't know how to help, because i never tried to use OpenKM with virtual host.

Sorry!

Re: Login returns to localhost

PostPosted:Sat Apr 02, 2011 6:38 am
by seanwhe
No problem I do appreciate the effort to try help.

Re: Login returns to localhost

PostPosted:Sun Apr 03, 2011 8:16 am
by jllort
It might be the same using virtual host than dedicated, you must have the same apache control level. Try the apache proxy configuration.

Re: Login returns to localhost

PostPosted:Tue Apr 05, 2011 10:23 am
by pavila
@seanwhe I'm not sure there is an error in the corresponding VirtualHost configuration. I think you are mixing two different deploy scenarios. The configuration with the X-GWT-Module-Base header modified is use to obtain an OpenKM access URL without the /OpenKM context. In my test, this is working fine but keep on mind that this is intended to be used only on 5.1 as a experimental feature.

I can't really see this configuration is not working, so I have reverted your wiki modification. A better place to discuss this would be the "discussion" tab in the Third-party software integration: Apache page.