ip/httpd/httpd doesn't dynamically create web pages indexing directories the way some other httpd's can be configured to (apache is an obvious example here). This is probably to the good; it prevents people from snooping around your directory structure unnecessarily. However, it can also be annoying; for instance, if you want to expose the contents of a directory hierarchy to the world. A simple solution there is to simply write a script that creates directory listings for you, and then use it to generate static HTML pages, and create links to those. However, that's annoying because (a) you have to maintain the pages, and (b) they clutter up your namespace with things you ordinarily wouldn't have there. But nothing is stopping us from implementing a tool to do that automatically, so I did just that. Here is webls, a server in the same vein as man2html (indeed, I started with the man2html source when building webls), to be run via the /magic, er, magic, and which generates ls-like output for a directory on the fly. So far, it seems to work rather well. I've only tested it myself, I guess, and rather lightly, but it's simple enough to not be a big deal. It also has support for specifying two files, /sys/lib/webls.allowed and /sys/lib/webls.denied for restricting access to what parts of the web space it will create listings for (the two files fit together in a pretty obvious way, but the rules for them are specified in the source). In a nutshell, add lines to webls.allowed with regular expressions for what you want to be visible, and regular expressions in webls.denied for what you don't want to be visible. Webls.allowed overrides webls.denied. If webls.allowed exists and webls.denied does not, then access is only granted for filenames match regular expressions explicitly listed in webls.allowed. If webls.denied exists and not webls.allowed, then access is only denied for requests for directories explicitly listed in webls.denied. If neither exists, access is granted everywhere; the rationale here is that only things in your publically viewable web namespace are visible, anyhow.. A safe thing to do is simply, ``echo '.*' > /sys/lib/webls.denied' and then explicitly list those things you want to be listable. Anyway, a patch to /sys/src/cmd/ip/httpd/mkfile follows, as well as the default `turn everything off' webls.denied and webls.c itself. This is, I think, useful enough to go in the base distribution. - Dan C. brahma% ape/diff -c /n/sources/plan9/sys/src/cmd/ip/httpd/mkfile mkfile *** /n/sources/plan9/sys/src/cmd/ip/httpd/mkfile Wed Nov 27 19:23:25 2002 --- mkfile Mon Sep 29 01:44:15 2003 *************** *** 10,15 **** --- 10,16 ---- man2html\ save\ wikipost\ + webls\ LIB=libhttps.a.$O brahma%