3

I configured lighttpd 1.4.74 on ubuntu 24.04 to allow directory browsing, via .conf file:

dir-listing.activate="enable"

I have also tried

server.dir-listing = "enable"

They both seem to give me the same results, where static files' links have a trailing /. Here is an example of a directory's contents:

results of "ll" showing list of mp3 and jpg files in a directory

And here is what lighttpd serves up:

web page showing the mp3 and jpg files, but each link has a trailing slash

The links to those mp3 and jpg files works correctly even though they have the erroneous /. But even with them working correctly, I need to get it generating correct link text because there is a process parsing these href values, and it thinks they're directories.

It may be worth noting that elsewhere I have a raspberry pi running Raspbian and lighttpd 1.4.59. It is working correctly:

results of ls -la on raspberry pi showing same files as in previous mentioned device running ubuntu

web page showing the mp3 and jpg files, correctly, without a trailing slash

What could I have wrong on my new Ubuntu/lighttpd server to cause these extra / characters?

Giacomo1968
  • 58,727
hmqcnoesy
  • 194

1 Answers1

2

The issue of the trailing slash appended to files was introduced as a regression in lighttpd 1.4.74.

Upstream Bug # 3242 Report

Upstream Patch

I created an personal Ubuntu PPA with the patch. Unfortunately even I am unable to add my own PPA such that it permits me to install the updated binary .deb file.

To work around this issue I did the following:

  1. Visit
    https://launchpad.net/~gedakc/+archive/ubuntu/lighttpd-1.4.74-1ubuntu3-fix-trailing-slash/+build/30604552

  2. Locate the file lighttpd_1.4.74-1ubuntu3_amd64.deb and download it.

  3. Install the .deb package (assuming ~/Downloads directory)

    sudo dpkg -i ~/Downloads/lighttpd_1.4.74-1ubuntu3_amd64.deb

  4. Restart lighttpd

    sudo systemctl restart lighttpd

This fixed the problem for me.