Create a directory, fetch its contents over HTTP from localhost (using curl, wget -O /dev/stdout, lynx -dump, w3m -dump, elinks -dump) and look for the file list. Example for Apache2, which normally shows Index of /directory:
if curl "http://localhost/$name/" | fgrep -qs "Index of /$name"; then
If you are using Lighttpd, nginx or something else, adjust the grep pattern.
Alternative: Learn some grep or perl and parse the hell out of your configuration files. The exact process depends on the HTTP daemon you are using – their configuration formats are very different.