aspose file tools*
The moose likes JForum and the fly likes apache - RewriteRule - local tomcat = no login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "apache - RewriteRule - local tomcat = no login" Watch "apache - RewriteRule - local tomcat = no login" New topic
Author

apache - RewriteRule - local tomcat = no login

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hello,

is there anyone who switch on the light?

I ltry to do the following:
http://official.de/Intern/forum (apache) redirect to http://127.0.0.1:8081/forum (tomcat)

httpd.conf:
...
RewriteEngine on
RewriteRule ^.*/Intern/forum/(.*)$ http://127.0.0.1:8081/forum/$1 [P]
...

SystemGlobals.properties:
...
forum.link = /forum/
homepage.link = http://official.de/Intern/forum
redirect.absolute.paths = true
redirect.base.url =/Intern/forum/
proxied.context.path = /Intern/forum
...

Ok everything seems ok, but I'm unable to login.
If I type in username and password the page reload - but there is no 'your Profile'-page etc.
I can jump arround in the forum - quite nice but if i answer a topic or something like that I'm 'Anonymous'.

For testing I connect direct to the forum not over the apache, after disableing the redirect and proxied statement in the SystemGlobals.properties file - everything is ok. Login works the management Menue is available ...

Any hint?



[originally posted on jforum.net by humptydumpty1]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Apache proxy rules aren't one of my Forte's... it may be related to cookies and making sure you're config file has the right URL for jForum.

Alternatively, I strongly recommend using the jk_module to connect TomCat and the Apache HTTPD servers. IMHO, it's far more seamless and trouble free than trying to keep all the proxy rules straight. Plus there are a lot of bonus stuff like a Tomcat ApacheConfig listener that can automatically create the Apache HTTPD config statements for ALL your webapps that just has to be included in your HTTPD config file.

The best place to start is http://tomcat.apache.org/connectors-doc/ But there are also a bunch of nice articles floating around on the Inet to help as well.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I think the problem is that you are changing the hostname, and that cookies are associated with it, so that when you log in your session gets stuck with the old server name.

I would suggest as monroe says to switch to using mod_jk to pass the request from apache httpd to tomcat, or using tomcat directly without apache. I should also point out that using mod_jk would also resolve possible problems your clients might have accessing port 8081.
[originally posted on jforum.net by andune76]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hello,

sorry I had forget to tell you that everything works if the forum is direct below the main url

official.de/forum - works
official.de/Intern/forum - ist not working

Mybe I have na error in my SystemGlobals.properties?

Hmm, any Idea?

[originally posted on jforum.net by humptydumpty1]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: apache - RewriteRule - local tomcat = no login
 
Similar Threads
Apach integrate with Tomcat problem(urgent)
Using JForum SSO - a kludger's tale
404 error - JSESSIONID - Apache2 - Tomcat 6.0.18
jforum behind htacces unable to login
Unable to see Tomcat 5.5 welcome page,manager,host manager