Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: b1ackmai1er on February 13, 2011, 05:05:52 AM

Title: lighttpd - web page to display directory listing in html format
Post by: b1ackmai1er on February 13, 2011, 05: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



Title: Re: lighttpd - web page to display directory listing in html format
Post by: tinypoodle on February 13, 2011, 05:27:19 AM
Perhaps edna.tcz might serve your purpose, in case all you want is to share mp3 and ogg files.
Title: Re: lighttpd - web page to display directory listing in html format
Post by: danielibarnes on February 14, 2011, 01:16:02 PM
lighttpd looks in $HTTPD_ROOT/htdocs for web pages. You will need to put index.php in /mnt/sdc1/music/htdocs.