You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sam Carleton <sc...@gmail.com> on 2007/03/26 14:40:02 UTC

[users@httpd] reverse proxy configuration help needed

I am working on setting up apache as a reverse proxy for a kiosk
system I am developing.  The basic reverse proxy is working, but it
does not appear to be caching the requests to the hard drive. I have
included my httpd.conf, I was hoping that someone might point out to
me what I have configured wrong.  Also, do you see anything that is
not needed?  I am looking for a bare bones setup, like I said it is
for a tightly controlled kiosk system.
-----------------------------------------------------------------
ThreadsPerChild 250
MaxRequestsPerChild  0
ServerRoot "C:/Apache2.2"

Listen 80

LoadModule authz_host_module modules/mod_authz_host.so
LoadModule dir_module modules/mod_dir.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule log_config_module modules/mod_log_config.so

LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so

ProxyRequests Off

ProxyPass        /   http://127.0.0.1:8042/
ProxyPassReverse /   http://127.0.0.1:8042/

CacheRoot "C:/Apache2.2/proxy"
CacheMaxExpire 24
CacheLastModifiedFactor 1
CacheDefaultExpire 1
CacheMinFileSize 1
CacheMaxFileSize 10240000
CacheDirLength 4
CacheDirLevels 5

<Directory "C:/Apache2.2/proxy">
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

ServerAdmin admin@miltonstreet.com
ServerName basement.miltonstreet.com
DocumentRoot "C:/Apache2.2/htdocs"

<Directory />
   Options FollowSymLinks
   AllowOverride None
   Order deny,allow
   Deny from all
   Satisfy all
</Directory>

ErrorLog logs/error.log

LogLevel warn

DefaultType text/plain

---------------------------------------------------------------------
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


Re: [users@httpd] reverse proxy configuration help needed

Posted by Joshua Slive <jo...@slive.ca>.
On 3/26/07, Sam Carleton <sc...@gmail.com> wrote:
> On 3/26/07, Joshua Slive <jo...@slive.ca> wrote:
> > On 3/26/07, Sam Carleton <sc...@gmail.com> wrote:
> > > I am working on setting up apache as a reverse proxy for a kiosk
> > > system I am developing.  The basic reverse proxy is working, but it
> > > does not appear to be caching the requests to the hard drive.
> >
> > Take a look at the HTTP response headers being sent with the content.
> > They may be preventing apache from caching.
>
> Joshua,
>
> Here is the response header (got to LOVE firefox):
>
> Date: Mon, 26 Mar 2007 23:18:39 GMT
> Server: Apache/2.2.3 (Win32) PHP/5.2.1
> X-Powered-By: PHP/5.2.1
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: public, must-revalidate
> Pragma: no-cache
> Last-Modified: Thu, 05 Jan 2006 14:12:23 GMT
> Etag: "e91c6503142404320aa1fc645d6949cd"
> Content-Transfer-Encoding: binary
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: image/jpg
>
> 200 OK
>
> here are ALL the headers that I am writing out in PHP:
>
> header("Cache-Control: public, must-revalidate");
> header("Content-Type: image/jpg");
> header("Content-Transfer-Encoding: binary\n");
>
> When looking at the HTTP document about Pragma: no-cache, it looks to
> me like it should be ignored.  My whole objective is that I want the
> proxy to always *check* to see if the data is out of data, ie use the
> Last-Modified and Etag, but if it is not out of date, I want the proxy
> to serve up the content from it's cache.

I don't recall off-hand the details of the caching rules, but it seems
like a pretty good bet that the cache is not going to touch something
with Pragma: no-cache and an Expires date in the past. Get rid of
those things.

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] reverse proxy configuration help needed

Posted by Sam Carleton <sc...@gmail.com>.
On 3/26/07, Joshua Slive <jo...@slive.ca> wrote:
> On 3/26/07, Sam Carleton <sc...@gmail.com> wrote:
> > I am working on setting up apache as a reverse proxy for a kiosk
> > system I am developing.  The basic reverse proxy is working, but it
> > does not appear to be caching the requests to the hard drive.
>
> Take a look at the HTTP response headers being sent with the content.
> They may be preventing apache from caching.

Joshua,

Here is the response header (got to LOVE firefox):

Date: Mon, 26 Mar 2007 23:18:39 GMT
Server: Apache/2.2.3 (Win32) PHP/5.2.1
X-Powered-By: PHP/5.2.1
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: public, must-revalidate
Pragma: no-cache
Last-Modified: Thu, 05 Jan 2006 14:12:23 GMT
Etag: "e91c6503142404320aa1fc645d6949cd"
Content-Transfer-Encoding: binary
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/jpg

200 OK

here are ALL the headers that I am writing out in PHP:

header("Cache-Control: public, must-revalidate");
header("Content-Type: image/jpg");
header("Content-Transfer-Encoding: binary\n");

When looking at the HTTP document about Pragma: no-cache, it looks to
me like it should be ignored.  My whole objective is that I want the
proxy to always *check* to see if the data is out of data, ie use the
Last-Modified and Etag, but if it is not out of date, I want the proxy
to serve up the content from it's cache.

I know each web browser will cache the image, I just want the proxy to
serve up the cached image when a second browser comes along.  At the
same time, the operator can be changing the images real time, such as
rotating them or cropping them, so the proxy always needs to check the
images.

Sam

---------------------------------------------------------------------
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


Re: [users@httpd] reverse proxy configuration help needed

Posted by Joshua Slive <jo...@slive.ca>.
On 3/26/07, Sam Carleton <sc...@gmail.com> wrote:
> I am working on setting up apache as a reverse proxy for a kiosk
> system I am developing.  The basic reverse proxy is working, but it
> does not appear to be caching the requests to the hard drive.

Take a look at the HTTP response headers being sent with the content.
They may be preventing apache from caching.

Joshua.

---------------------------------------------------------------------
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