Forum Moderators: phranque
Having read thru httpd.conf I cannot understand how to list several directories. Lets say I have drives D:\ and E:\ with files I wish to share. I added D:\, it works, I add E:\ it doesn't work. How do I do this?
Also, the listing shows alphabetical list. I'd prefer to list with directories at the top, files beneath. Please advise!
For the index formatting questions, see Apache mod_autoindex [httpd.apache.org]. See especially the note about the DescriptionWidth directive added in Apache1.3.10.
Jim
[edited by: jdMorgan at 12:53 am (utc) on April 24, 2007]
Reading this config file it mentions something about Aliases but not sure how to use them, to add another drive? Sym links may work in Linux servers but not in windows, all you get is a F:\File.lnk and no functionality.
Any tips?
Thanks.
So you could, for example, alias "D:\" as "/widgets/blue-green" and "E:\" as "/widgets/red-yellow" and thereby hide any disk drive information for the URL-space. These are just dumb examples; I'm sure there is some better and more-descriptive URL-naming convention you can use to look at the requested URL and decide which drive the requested content is stored on.
Design this URL-to-filesystem "mapping" with an eye toward expansion: Make sure your mapping approach will accommodate both growth of the directories stored on any given disk -- meaning you may have to add a disk and change the Alias structure, and also the growth in the size of inexpensive disks -- meaning you may want to combine the contents of the two drives onto a single larger one.
See Apache mod_alias documentation for more info.
Jim
I looked at [spinbox.techtracker.com...] to read more on this and tried to add your examples and as always, if the syntax is wrong, apache won't start. I added the following to httpd.conf:
Alias "L:\Pictures" as "/Pictures"
Alias "J:\General" as "/General"
This naturally failed to work.
The above link used this example:
Alias /image /ftp/pub/image
<Directory /ftp/pub/image>
Order allow,deny
Allow from all
</Directory>
But I don't know hot to use this with a route to L:\Pictures and J:\General. I know I'm asking the wrong questions but until I 'get' what I'm doing, I'm afraid I'm just fumbling around scratching my head.
Alias /General "J:\General"
<Directory "J:\General">
Order allow,deny
Allow from all
</Directory>
This lists the contents of the drive IF I put the full path down in the url, so mysite.com/General
I want/am trying to list all my files on one page, so General and Pictures would just be a directory on the main Fancy Index page, the default page or www.mysite.com
Also when I added:
Alias /Video "L:\Pictures"
<Directory "L:\Pictures">
Order allow,deny
Allow from all
</Directory>
And typed this into the url or www.mysite.com/Pictures this DIDN'T work?
To do that, you'd need either SymLinks (not available on Windoze, as you stated), or a script to "virtualize" the filesystem. That is, write a script to output a "directory" that includes the other drives as if they were really in this directory of one drive, thereby creating a 'meta directory' of all drives and folders.
Bad news: It's more complicated. Good news: Since your script will 'write' the HTML to present the directory listing, you are free to format it in any way you like, free of mod_autoindex's restrictions and limitations.
I think I've read some discussion of this here in the past -- try a search in the WebmasterWorld PERL forum.
Jim