WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: lighttpd - web page to display directory listing in html format  (Read 3623 times)

Offline b1ackmai1er

  • Jr. Member
  • **
  • Posts: 95
lighttpd - web page to display directory listing in html format
« on: February 13, 2011, 08:05:52 AM »
Hi,

I want to share my music files by having it accessible as a web page.

I started with loading lighttpd and php5 extension and starting it with the following script:

#!/bin/sh
HTTPD=/usr/local/sbin/lighttpd
HTTPD_ROOT=/mnt/sdc1/music
HTTPD_CONF=$HTTPD_ROOT/lighttpd.conf
cat << EOF > $HTTPD_CONF
server.document-root = "/"
server.port = 8080
server.username = "nobody"
server.groupname = "nogroup"
server.chroot = "$HTTPD_ROOT"
index-file.names = ( "index.html", "index.php")
EOF
exec $HTTPD -D -f $HTTPD_CONF

and I saved a test file called index.php with the following contents in /mnt/sdc1/music

<?php
phpinfo();
?>

but when I try to view the web page with 192.168.2.7:8080 I get 404 - Not Found error.

For some reason it does  not seem to find the file and I can't see why.
I am also clueless on  how to get lighttpd to present a directory of all the subdirectories and files to download.

Can anyone suggest where to look to resolve this problem?  TIA




Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: lighttpd - web page to display directory listing in html format
« Reply #1 on: February 13, 2011, 08:27:19 AM »
Perhaps edna.tcz might serve your purpose, in case all you want is to share mp3 and ogg files.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: lighttpd - web page to display directory listing in html format
« Reply #2 on: February 14, 2011, 04:16:02 PM »
lighttpd looks in $HTTPD_ROOT/htdocs for web pages. You will need to put index.php in /mnt/sdc1/music/htdocs.