I'm trying to get started with lighttpd on Fedora 16 to run a RESTful api for development. Right now even with the most basic sample config file I'm getting 404 pages when I know the pages I'm pointing at exist. From reading other questions I'm leaning towards this being a permissions issue, but I'm confused about how lighttpd runs on Fedora.

There's a user called "lighttpd" not "www-data"? I can't see this user in the system-config-users tool and I can't su into it to check which permissions it has.

I'm trying to point lighttpd to "/var/www/lighttpd" which has some example pages in it. The permissions for the files inside are set to -rw-r--r-- and the permissions for the folder containing them are drwxr-xr-x. Doesn't that mean that any user can view these files?

I'm not sure what else I should be checking as I don't have much experience with server configuration. Any help would be appreciated.

Edit: I was following the tutorial configuration here so the lighttpd.conf file contains

server.document-root = "/var/www/lighttpd/" 

server.port = 3000

mimetype.assign = (
  ".html" => "text/html", 
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png" 

and I was just trying to get the basic example page working.

  • can you post your lighthttpd.conf file ? – silviud May 11 '12 at 2:30
  • If this looks like a permissions problem and the file permissions are set correctly, my gut instinct tells me it could be SELinux. Try disabling it to see if that fixes anything. You might need to change the security context of your webroot folder if SELinux turns out to be the culprit. – Kenny Rasschaert May 11 '12 at 5:45
  • @KennyRasschaert I just installed an Ubuntu virtual machine and am having similar issues so I'll look into this possibility. Thanks. – Isaac Gateno May 11 '12 at 21:38
  • 1
    Actually, while Fedora has SELinux installed and enabled by default, Ubuntu does not. – Kenny Rasschaert May 12 '12 at 10:10
  • @KennyRasschaert On ubuntu I just didn't notice lighttpd had started itself when I installed it so I was trying to start it again without stopping it. It's working now. Thanks. – Isaac Gateno May 14 '12 at 19:25

lighttpd doesn't serve directories by default. either enable dirlistings:

dir-listing.activate = "enable" 

or activate index files (and create one!)

index-file.names = ( "index.html" )

(or both. if an index file exists it has priority over dirlistings)

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.