Hi. I just started up a webserver on my Ubuntu machine using lighttpd. It's serving several websites perfectly. But then one of the virtual hosts refuses to work and I can't figure out why.

Every other virtual host, whether serving static or dynamic content, works perfectly, except for this *one. * The problematic virtual host will serve the .html pages but nothing else. You get a 404 for the .css files, or any of the image files, and that all you get when you look at the .html page is plain looking text without any of the formatting from the .css.

I have no idea why this is happening. The permissions on the folders of the problematic site are exactly the same as the permissions on the working sites, and the lighttpd.conf file looks the same to me. If you have any idea why this might be happening, your ideas will be very appreciated. Thanks!

Below are my lighttpd.conf file and some command line grabs. Names have been changed to protect the innocent. The problematic virtual host has been code-named "yellow". The working static virtual host is named "blue." Thanks!

lighttpd.conf

-----

# Debian lighttpd configuration file
#

############ Options you really have to take care of ####################

## modules to load
# mod_access, mod_accesslog and mod_alias are loaded by default
# all other module should only be loaded if neccesary
# - saves some time
# - saves memory

server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
# "mod_rewrite",
# "mod_redirect",
# "mod_status",
# "mod_evhost",
# "mod_compress",
# "mod_usertrack",
# "mod_rrdtool",
# "mod_webdav",
# "mod_expire",
# "mod_flv_streaming",
# "mod_evasive",
"mod_fastcgi"
)

## a static document-root, for virtual-hosting take look at the
## server.virtual-* options
server.document-root = "/var/www/"

## where to send error-messages to
server.errorlog = "/var/log/lighttpd/error.log"

## files to check for if .../ is requested
index-file.names = ( "index.php", "index.html" )

mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".torrent" => "application/x-bittorrent",
".gz" => "application/x-gzip",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".ogg" => "audio/x-wav",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".xml" => "text/xml",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf"
)

## Use the "Content-Type" extended attribute to obtain mime type if possible
mimetype.use-xattr = "enable"

#### accesslog module
accesslog.filename = "/var/log/lighttpd/access.log"

## deny access the file-extensions
#
# ~ is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
# of the document-root
url.access-deny = ( "~", ".inc", ".bak" )

$HTTP["host"] =~ "www\.red\.com" {
server.indexfiles = ( "index.php" )
server.document-root = "/var/www/red/"
server.error-handler-404 = "/index.php"
fastcgi.server = (
".php" =>
((
"bin-path" => "/usr/lib/cgi-bin/php5",
"socket" => "/tmp/php.socket"
))
)
}

$HTTP["host"] =~ "www\.orange\.net" {
server.indexfiles = ( "index.php" )
server.document-root = "/var/www/orange/"
server.error-handler-404 = "/index.php"
fastcgi.server = (
".php" =>
((
"bin-path" => "/usr/lib/cgi-bin/php5",
"socket" => "/tmp/php.socket"
))
)
}

$HTTP["host"] =~ "www\.yellow\.com" {
server.document-root = "/var/www/yellow/"
server.indexfiles = ( "index.html" )
}

$HTTP["host"] =~ "www\.green\.com" {
server.document-root = "/var/www/green/"
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
}

$HTTP["host"] =~ "www\.blue\.com" {
server.document-root = "/var/www/blue/"
server.indexfiles = ( "index.html" )
}

######### Options that are good to be but not neccesary to be changed #######

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"

## virtual directory listings
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"

## send unhandled HTTP-header headers to error-log
#debug.dump-unknown-headers = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to <uid> (default: don't care)
server.username = "lighttpd"

## change uid to <uid> (default: don't care)
server.groupname = "lighttpd"


#### expire module
# expire.url = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")

## this is a hack
alias.url = ("___invalid___" => "___invalid___")

#### handle Debian Policy Manual, Section 11.5. urls
#### and by default allow them only from localhost

$HTTP["host"] == "localhost" {
global {
alias.url += (
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
}
dir-listing.activate = "enable"
}

#### variable usage:
## variable name without "." is auto prefixed by "var." and becomes "var.bar"
#bar = 1
#var.mystring = "foo"

## integer add
#bar += 1
## string concat, with integer cast as string, result: "www.foo1.com"
#server.name = "www." + mystring + var.bar + ".com"
## array merge
#index-file.names = (foo + ".php") + index-file.names
#index-file.names += (foo + ".php")


#### external configuration files
## mimetype mapping
#include_shell "/usr/share/lighttpd/create-mime.assign.pl"

## load enabled configuration files,
## read /etc/lighttpd/conf-available/README first
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

------

Thanks for reading this far! Here are some command line grabs, just to show you that the permissions on both static sites are the same.

------

user@compy:/var/www$ ls -la blue/
total 40
drwxr-xr-x 4 user lighttpd 4096 2006-01-13 19:13 .
drwxr-xr-x 14 root daemon 4096 2006-08-22 21:27 ..
drwxr-xr-x 2 user lighttpd 4096 2005-11-16 12:40 images
-rw-r--r-- 1 user lighttpd 12107 2006-03-13 04:33 index.html
-rw-r--r-- 1 user lighttpd 8098 2005-11-11 07:37 lucky.jpg
-rw-r--r-- 1 user lighttpd 767 2006-01-14 09:08 style.css
drwxr-xr-x 2 user lighttpd 4096 2006-06-11 07:20 table
user@compy:/var/www$ ls -la yellow/
total 276
drwxr-xr-x 4 user lighttpd 4096 2006-08-24 16:56 .
drwxr-xr-x 14 root daemon 4096 2006-08-22 21:27 ..
-rw-r--r-- 1 user lighttpd 2424 2006-08-05 02:45 contact.html
-rw-r--r-- 1 user lighttpd 2458 2006-08-04 15:57 contact.html~
-rw-r--r-- 1 user lighttpd 2266 2006-08-05 17:34 contact.safari.html
-rw-r--r-- 1 user lighttpd 2299 2006-08-05 17:33 contact.safari.html~
-rw-r--r-- 1 user lighttpd 12732 2006-08-04 15:23 costume-design.html
-rw-r--r-- 1 user lighttpd 12332 2006-08-02 22:48 costumedesign.html~
-rw-r--r-- 1 user lighttpd 6429 2006-08-02 21:57 costume-design-photos.html
-rw-r--r-- 1 user lighttpd 7510 2006-08-05 17:34 costume-design.safari.html
-rw-r--r-- 1 user lighttpd 7554 2006-08-05 17:34 costume-design.safari.html~-rw-r--r-- 1 user lighttpd 7522 2006-08-04 21:42 fine-arts.html
-rw-r--r-- 1 user lighttpd 7065 2006-08-02 22:48 finearts.html~
-rw-r--r-- 1 user lighttpd 3279 2006-08-02 23:26 fine-arts-photos.html
-rw-r--r-- 1 user lighttpd 5027 2006-08-05 17:34 fine-arts.safari.html
-rw-r--r-- 1 user lighttpd 5071 2006-08-03 20:52 fine-arts.safari.html~
drwxr-xr-x 4 user lighttpd 4096 2006-08-04 15:59 images
-rw-r--r-- 1 user lighttpd 1782 2006-08-09 19:00 index.html
-rw-r--r-- 1 user lighttpd 1848 2006-08-02 22:41 index.html~
-rw-r--r-- 1 user lighttpd 1772 2006-08-05 17:33 index.safari.html
-rw-r--r-- 1 user lighttpd 1816 2006-08-05 17:33 index.safari.html~
drwxr-xr-x 2 user lighttpd 4096 2006-08-04 15:59 javascript
-rw-r--r-- 1 user lighttpd 2606 2006-08-02 23:02 lilywasik.css
-rw-r--r-- 1 user lighttpd 2215 2006-08-02 23:01 lilywasik.css~
-rw-r--r-- 1 user lighttpd 2074 2006-07-16 12:07 lilywasik-new.css~
-rw-r--r-- 1 user lighttpd 3297 2006-08-15 16:02 lily-wasik-resume.html
-rw-r--r-- 1 user lighttpd 2628 2006-08-02 23:20 lilywasik.safari.css
-rw-r--r-- 1 user lighttpd 252 2006-08-04 15:18 mail.php
-rw-r--r-- 1 user lighttpd 521 2006-08-04 16:50 mail-test.html
-rw-r--r-- 1 user lighttpd 535 2006-07-01 01:56 main.html
-rw-r--r-- 1 user lighttpd 11574 2006-08-04 15:23 makeup.html

-----

Thanks for any ideas you might have!