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

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

$HTTP["remoteip"] =~ "" {
    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
ProxyPass /imagehosting
ProxyPass /pictures
ProxyPassReverse /

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?


IMHO your created your configuration the wrong way. With your configuration, lighttpd is proxied by Apache httpd, which doesn't make much sense since your objective was utilizing the (supposedly) better performance of lighttpd.

So bind Apache httpd to another port and interface (e. g. and let lighttpd's mod_proxy do the dirty work.

See http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModProxy for configuration examples of mod_proxy for lighttpd.


Try changing these lines in apache:

ProxyPass /images
ProxyPass /imagehosting
ProxyPass /pictures
ProxyPassReverse /
  • Unfortunately, it does not help. The whole site is served right - apart from images. It seems to me that the problem with the paths - so if lighttpd not seen them in a good way. Just do not know where I make a mistake. – user36022 Feb 27 '10 at 12:48

I don't understand why your lighttpd.config has:

server.document-root       = "/www/"

Shouldn't that be the same as Apache?

server.document-root       = "/www/MYAPP/forum/"

Or am I missing something?

Also you probably want to remove the alias.url entry for images, as that will break things, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.