You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Johannes Jander <ja...@zedat.fu-berlin.de> on 2004/07/16 17:07:07 UTC

Problem with session tracking and mod_proxy

Hi,

I am currently trying to get Lenya working on a shared server where 
Apache httpd serves static content for some domains. I therefore 
installed the 1.2 binary release on a vanilla tomcat 5.0.25 listening 
on port 8080 and used mod_proxy/mod_rewrite rules to rewrite requests 
to:
- http://hierundda.de -> hierundda.de:8080/lenya/hierundda/live/
- http://admin.hierundda.de -> hierundda.de:8080/lenya/hierundda/authoring/

The proxy/rewrite rules are adapted from the modproxy howto in the 
Lenya wiki, however I had to add a ProxyPass because without, the 
connection would be refused completely.

PROBLEM:
a minor problem is that every request to http://hierundda.de 
generates a URL with a jsessionid attached. I'd like to get rid of 
it, but that's no showstopper. A second minor problem are some 
remaining .css and .js paths - nothing I couldn't fix with some work

The serious problem is in the authoring area. I can login via 
admin.hierundda.de, but clicking any of my links in the authoring 
area (not in the lenya menu bar, but to request a different page for 
authoring) throws me back to the login panel and I get a new 
jsessionid. This happens when the browser requests the menu.js, too.
The same does not happen when I access Lenya via 
hierundda.de:8080/lenya/hierundda/authoring/ - then the session is 
kept.

Any ideas? Thanks in advance :)

If you like to see the phenomenom, go to http://admin.hierundda.de 
and log in as
User: lenya
Pass: lenya1levi
and click on "Literatur"




The relevant parts of my httpd.conf:

<VirtualHost *>
         ServerName hierundda.de
         ServerAlias www.hierundda.de
         ProxyRequests    Off

         ProxyPassReverse / http://localhost:8080/lenya/hierundda/live/
         ProxyPass       / http://localhost:8080/lenya/hierundda/live/
</VirtualHost>


<VirtualHost *>
         ServerName       admin.hierundda.de
         ProxyRequests    Off
         RewriteEngine    On
         RewriteRule      ^/$ /index.html [R]
         RewriteLog       "/var/log/apache/cms.client.rewrite.log"
         RewriteLogLevel  9
         RewriteRule      ^/([^/\.]+)$  $1/   [R]
         RewriteRule   ^/([^/\.]+)/$ 
http://localhost:8080/lenya/$1/authoring/index.html [R,L]
         RewriteCond      %{QUERY_STRING} lenya\.usecase=login(.*)
         RewriteRule      ^/(.*)   http://%{SERVER_NAME}/$1 [R,L]
         RewriteRule      ^/(.*)   http://localhost:8080/lenya/$1  [P,L]

         ProxyPassReverse / http://localhost:8080/lenya/hierundda/authoring/
         ProxyPass       / http://localhost:8080/lenya/hierundda/authoring/
</VirtualHost>

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Problem with session tracking and mod_proxy

Posted by Jann Forrer <ja...@id.unizh.ch>.
On Wed, 21 Jul 2004, Johannes Jander wrote:

> At 18:46 Uhr +0200 16.07.2004, Jann Forrer wrote:
>
> >I had the same problem and wrote a mail about that sometimes ago. The
> >problem is that the cookie has the name of the webapp included i.e. lenya.
>
> Thanks, Jann, this indeed did the trick :)
>

I will try to find a problem concering URL and sessions. It would be nice
if you can use

http://whatever.org/index.html instead of
http://whatever.org/lenya/index.html

However, I found a temporary soltion by using another RewriteRule:

RewriteRule      ^/[^(lenya)](.*) /lenya$0  [R]

So that the client can use URL's like http://whatever.org/index.html


Jann

---------------------------------------------------------------
Jann Forrer
Informatikdienste
Universität Zürich
Winterthurerstr. 190
CH-8057 Zuerich

oooO   mail:  jann.forrer@id.unizh.ch
(  )   phone: +41 1 63 56772
 \ (   fax:   +41 1 63 54505
  \_)  http://www.id.unizh.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Problem with session tracking and mod_proxy

Posted by Johannes Jander <ja...@zedat.fu-berlin.de>.
At 18:46 Uhr +0200 16.07.2004, Jann Forrer wrote:

>I had the same problem and wrote a mail about that sometimes ago. The
>problem is that the cookie has the name of the webapp included i.e. lenya.

Thanks, Jann, this indeed did the trick :)


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org


Re: Problem with session tracking and mod_proxy

Posted by Jann Forrer <ja...@id.unizh.ch>.
On Fri, 16 Jul 2004, Johannes Jander wrote:

> Hi,
>
> I am currently trying to get Lenya working on a shared server where
> Apache httpd serves static content for some domains. I therefore
> installed the 1.2 binary release on a vanilla tomcat 5.0.25 listening
> on port 8080 and used mod_proxy/mod_rewrite rules to rewrite requests
> to:
> - http://hierundda.de -> hierundda.de:8080/lenya/hierundda/live/
> - http://admin.hierundda.de -> hierundda.de:8080/lenya/hierundda/authoring/
>
> The proxy/rewrite rules are adapted from the modproxy howto in the
> Lenya wiki, however I had to add a ProxyPass because without, the
> connection would be refused completely.
>
> PROBLEM:
> a minor problem is that every request to http://hierundda.de
> generates a URL with a jsessionid attached. I'd like to get rid of
> it, but that's no showstopper. A second minor problem are some
> remaining .css and .js paths - nothing I couldn't fix with some work
>
> The serious problem is in the authoring area. I can login via
> admin.hierundda.de, but clicking any of my links in the authoring
> area (not in the lenya menu bar, but to request a different page for
> authoring) throws me back to the login panel and I get a new
> jsessionid. This happens when the browser requests the menu.js, too.
> The same does not happen when I access Lenya via
> hierundda.de:8080/lenya/hierundda/authoring/ - then the session is
> kept.
>
> Any ideas? Thanks in advance :)
>

I had the same problem and wrote a mail about that sometimes ago. The
problem is that the cookie has the name of the webapp included i.e. lenya.
If you request a page like:
http://hierundda.de/index.html the client did not sent the cookie because
the lenya is not in the request. If you use
http://hierundda.de/lenya/index.html and change your RewriteRules
accordingly it should work. Up to know I did not  found a way to get rid
of the webapp path in the cookie.
By the way this problem is also mentioned in

http://cocoon.apache.org/2.1/faq/faq-configure-environment.html#faq-N10086

I will send a mail to the tomcat mailing list and ask for a solution. The
problem is already mentioned several times but i found no good solution
yet.

HTH

Jann

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-user-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-user-help@cocoon.apache.org