Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am including the following fragment (/etc/lighttpd/sites/local) from the top-level config file (/etc/lighttpd/lighttpd.conf) on a Ubuntu 10.04 LTS (x64) machine with Lighty 1.4.26 (1.4.26-1.1ubuntu3.1 according to apt):

  alias.url += (
    "/Music" => "/huge/Music/"
  $HTTP["url"] =~ "^/Music/" {
    dir-listing.activate         = "enable"
    dir-listing.hide-dotfiles    = "enable"
    dir-listing.show-header      = "enable"
    dir-listing.show-readme      = "enable"
    dir-listing.hide-header-file = "enable"
    dir-listing.hide-readme-file = "enable"
    dir-listing.encoding         = "utf-8"
    url.access-deny             += ( ".htaccess" )

The group www-data has read-access on the folder /huge/Music and can descend into the folder and subfolders (o=rwX,g=rX with ownership www-data:www-data). I cannot tinker with the permissions as they are also required for the Samba share at the same physical location. The lighttpd process is running as user www-data.

When I now try to access the URL I end up getting HTTP error 403 (Forbidden) and I just cannot see why.

I've enabled plenty of debugging options in the main config file, but the output in the error.log isn't helpful at all in tracking down the reason for the denied access.

debug.log-request-header-on-error = "enable"
debug.log-response-header         = "enable"
debug.log-request-handling        = "enable"
debug.log-file-not-found          = "enable"
debug.log-condition-handling      = "enable"
auth.debug                        = "on"

The above fragments are all included at the top-level and the two other fragments (not given) are wrapped by $HTTP["host"] selectors. I can also see from the error.log output that the host selector is matched correctly.

How can I track down what is causing the denied access given that the debug log features don't provide much more help here?

Note: I am restarting the lighttpd (service lighttpd restart) process after each configuration file change as this is a system that has no particular uptime requirements. Also note that this doesn't involve any kind of script issues. It's purely about mapping a physical folder to be accessible as folder listing via HTTP.

share|improve this question
Would the downvoter(s) be so kind to point out the flaw(s) in my question, so I can improve on it? Thanks :) –  0xC0000022L Nov 19 '12 at 20:45
Did you ever find a solution for this? –  razzmataz Jan 14 at 21:30
@razzmataz: nope, unfortunately not. –  0xC0000022L Jan 15 at 0:46
I had a similar problem, where I had moved a file using mv from my home directory to the directory that lighttpd was serving out of, and kept getting 403s when trying to access the file thru the webserver. I had copied the file I got the 403 on, to another file name, and strangely I was able to get the newly copied file thru the webserver. Weird. –  razzmataz Jan 15 at 14:29

1 Answer 1

I would try using a bind mount: http://docs.1h.com/Bind_mounts

Real differences between binding and symlinks: http://unix.stackexchange.com/questions/35084/what-is-the-difference-between-a-symlink-and-binding-with-fstab

share|improve this answer
I know what bind-mounts are, what the differences to symlinks are and I am using them already extensively. But what does your answer have to do with my question? –  0xC0000022L Jun 21 '13 at 15:10
You're right, probably answered too fast ;) Have you tried enabling the debug module (/etc/lighttpd/conf.d/debug.conf), specifically "conditionals handling"? I've used it to track down problems like yours –  Juanga Covas Jul 5 at 16:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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