Apache2 with lighttpd as proxy

Posted by andrzejp on Server Fault See other posts from Server Fault or by andrzejp
Published on 2010-02-27T01:18:15Z Indexed on 2010/04/09 17:03 UTC
Read the original article Hit count: 500

Filed under:
|
|

Hi, I am using apache2 as web server. I would like to help him lighttpd as a proxy for static content. Unfortunately I can not well set up lighttpd and apache2. (OS: Debian)

Important things from lighttpd.config:

server.modules              = ( 
            "mod_access",
            "mod_alias",
            "mod_accesslog",
        "mod_proxy",
        "mod_status",
 )


server.document-root       = "/www/"
server.port               = 82
server.bind                = "localhost"

$HTTP["remoteip"] =~ "127.0.0.1" {
    alias.url += ( 
        "/doc/" => "/usr/share/doc/",
        "/images/" => "/usr/share/images/"
    )
    $HTTP["url"] =~ "^/doc/|^/images/" {
        dir-listing.activate = "enable"
    }
}

I would like to use lighttpd in only one site operating as a virtual directory on apache2. Configuration of this virtual directory:

ProxyRequests Off
ProxyPreserveHost On
ProxyPass /images http://0.0.0.0:82/
ProxyPass /imagehosting http://0.0.0.0:82/
ProxyPass /pictures http://0.0.0.0:82/
ProxyPassReverse / http://0.0.0.0:82/

ServerName MY_VALUES
ServerAlias www.MY_VALUES
UseCanonicalName Off
DocumentRoot /www/MYAPP/forum
<Directory "/www/MYAPP/forum">
DirectoryIndex index.htm index.php
    AllowOverride None 

...

As you can see (or not;)) my service is physically located at the path:

/ www / myapp / forum

and I would like to support lighttpd dealt with folders:

/ www / myapp / forum / images
/ www / myapp / forum / imagehosting
/ www / myapp / forum / pictures

and left the rest (PHP scripts) for apache

After running lighttpd and apache2 working party, but did not show up any images of these locations. What is wrong?

© Server Fault or respective owner

Related posts about apache2

Related posts about lighttpd