httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R Mills" <rebe...@newcars.com>
Subject [users@httpd] sessions with mod_proxy? (RE: mod_proxy+ PHP as an output filter not working)
Date Thu, 18 Aug 2005 17:05:42 GMT
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@webthing.com] 
Sent: Thursday, August 18, 2005 3:28 AM
To: users@httpd.apache.org
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message