[users@httpd] sessions with mod_proxy? (RE: mod_proxy+ PHP as an output filter not working)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What I'm really trying to do is add a session capability (cookie-setting +
associated storage) to the reverse proxy server, so I can store certain
information about the user throughout their session, including as they go
through several of the reverse-proxy vhosts.

I couldn't find an obvious way to do this.  One thing I was unsuccessfully
experimenting with is trying to make use of PHP's built-in session
capabilities by the method described below.  Of course, if there is an
easier way, that would be lovely.  Is anyone already doing this and can
point me in the right direction?

Thanks,
-Rebekah


-----Original Message-----
From: Nick Kew [mailto:nick@xxxxxxxxxxxx] 
Sent: Thursday, August 18, 2005 3:28 AM
To: users@xxxxxxxxxxxxxxxx
Subject: Re: [users@httpd] mod_proxy + PHP as an output filter not working

R Mills wrote:
> Kind of an interesting problem:
> I am using mod_proxy to reverse proxy a site.  In addition I am trying 
> to use PHP as an output filter to do session tracking on the proxy server.
> PHP by itself as an output filter works fine.  But when it is combined 
> with mod_proxy, it does not appear to be called.

I've steered well clear of PHP for some time, so anything I say here may be
ill-informed nonsense.  But my understanding is that PHP doesn't really work
as a filter.

> Anyone have any idea why, and is there anything I can tweak to get it 
> to work?

I don't know, but I might be able to suggest alternatives.  For example,
mod_publisher will give you auto_prepend_file and do a better job than PHP.

> <VirtualHost *>
> ## it works here - the contents of page_prepend.inc are processed with 
> each request ## note: not using mod_proxy, no proxying for this vhost 
> ##
>     ServerName search.example.com
>     DocumentRoot /etc/apache/htdocs
> 
>     php_value include_path ".:/etc/apache/phpmods"
>     php_value auto_prepend_file "/etc/apache/page_prepend.inc"
>     SetOutputFilter PHP
>     SetInputFilter PHP
> </VirtualHost>

Indeed, that looks like evidence of it working in a filter (assuming there
are no messages to the contrary in your error log).  But could it really be
faking it?  The difference in a proxy - or with local contents from another
dynamic source - is that it's much harder to 'fake it'.

Another possibility is that PHP's abuse of Content-Type (originally
introduced by Apache but fixed since 199?) is screwing you up.
You'd have to ask the php folks about a workaround.

--
Nick Kew




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux