Project

General

Profile

[UserError] dir-listing doesn´t work

Added by Anonymous almost 8 years ago

I have a problem with the dir listing: I have a directory /history. In that there are several pictures (and no index file). I want lighttpd to list all that files, but I always get a 404 when I open .../history/. I added the line dir-listing.activate = "enable" to the config file but it still doesn´t work. What am I doing wrong? The whole config is:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_cgi",
        "mod_fastcgi",
)

server.document-root        = "/var/www/html" 
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log" 
server.pid-file             = "/var/run/lighttpd.pid" 
server.username             = "www-data" 
server.groupname            = "www-data" 
server.port                 = 80

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/" 
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl" 
include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 

dir-listing.activate = "enable" 
dir-listing.encoding = "utf-8" 

Replies (3)

RE: dir-listing doesn´t work - Added by gstrauss almost 8 years ago

That might be your lighttpd.conf, but it is not your "whole config" since your lighttpd.conf has include files.
Use lighttpd -f /etc/lighttpd/lighttpd.conf -p to see your whole config.

The way to troubleshoot this is to disable parts of your config, get simple things working, and then one-by-one re-enable a feature and test.

If you comment out include_shell "/usr/share/lighttpd/include-conf-enabled.pl", do things start working? There is probably some config that is included there which intercepts requests before mod_dirlisting gets a chance.

You can also use debug.* configuration options for lighttpd.conf to possibly see which module is handling the request.

RE: [UserError] dir-listing doesn´t work - Added by Anonymous almost 8 years ago

Thanks for the help. I coudn´t find anything important for this in the whole config. Commenting out the include line didn´t help either.

RE: [UserError] dir-listing doesn´t work - Added by gstrauss almost 8 years ago

mod_dirlisting is a core module of lighttpd. It works.

Use lighttpd -f /etc/lighttpd/lighttpd.conf -p to see your whole config.

Comment out everything that is not server.* and dir-listing.*, and comment out the entirety of server.modules

Then, test your config. You need to start simple. Get mod_dirlisting working then start uncommenting things one-at-a-time, and testing as you go.

Make sure to restart lighttpd each time you change the config, check the lighttpd error.log as you go to see if there are warnings or errors, and make sure the server that you are hitting is actually using the lighttpd.conf you think you're using.

killall -TERM lighttpd if you are not sure. Then start up lighttpd again. Better, change server.port and test your config on a non-standard port, where nothing else should accidentally be running.

    (1-3/3)