wok-current view busybox/stuff/busybox-1.18-httpd.u @ rev 10595

samba: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 26 12:47:25 2011 +0200 (2011-05-26)
parents ab162b37b187
children
line source
1 Httpd already support directory listing. Install both files and try !
3 ===>8=== /etc/httpd.conf ===>8===
4 H:/var/www
5 ===>8=== /var/www/cgi-bin/index.cgi ===>8===
6 #!/bin/sh
8 [ ! -d ..$QUERY_STRING ] && echo "HTTP/1.1 404 Not Found" || cat <<EOT
9 Content-type: text/html
11 <!DOCTYPE html>
12 <html xmlns="http://www.w3.org/1999/xhtml">
13 <head> <title>Index of $QUERY_STRING</title> </head>
14 <body>
15 <h1>Index of $QUERY_STRING</h1>
16 <ul>
17 $({ [ "$QUERY_STRING" != "/" ] && echo "../"; ls -p ..$QUERY_STRING; } | \
18 sed 's|.*| <li><a href="&">&</a></li>|')
19 </ul>
20 </body>
21 </html>
22 EOT