Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a large filesystem full of files that I am 'sharing' via apache2 using mod_autoindex.

The root level folder of the server contains five directories and I would like to have a comment against each folder in the Description column at the root level, and only at the root level. For example, the root folder could look like this:

Index of /

Name       Last modified      Size   Description
george/    27-Feb-2011 15:50     -   
john/      27-Feb-2011 16:05     -   
paul/      19-Jun-2011 19:12     -   
pete/      12-Mar-2011 18:57     -   
ringo/     31-Oct-2011 18:42     -   

If I add AddDescription "Can't do a drum roll" /ringo/ to httpd.conf nothing happens.

In digging around with Google I have found that you should drop the leading slash. I add AddDescription "Can't do a drum roll" ringo/ and I then get that description against every single file and subdirectory in the 'ringo' directory, which I don't want.

Furthermore, I don't get that description against the ringo/ folder in the root level listing, which is what I actually want.

I noted that in the apache2 documentation, the file descriptor in that directive is "a file extension, partial filename, wild-card expression or full filename for files to describe", so I can see why it's going through the full directory structure, but what I really want is to be able to have a description against the five top level directories and no-where else.

I'm assuming that regular expressions aren't part of the syntax, because the documentation doesn't mention it and also because it didn't work. Mind you, the documentation says that you need the leading slash and that isn't the case either.

share|improve this question
add comment

1 Answer

Is the structure of the root level static and will have those five directories, and only those five directories?

Then the easiest way might be to fake it. Just create a static HTML page that looks like it was generated by mod_autoindex. Add the descriptions by hand to that static page. Let the rest of the pages be generated by mod_autoindex.

share|improve this answer
    
That's not a bad idea actually. In fact I will probably do that. I would still like to see if this can be done via mod_autoindex for the sake of a web service that is simpler to operate (in case I do change the root directory), but that's pretty good! –  GarnerCX Oct 31 '11 at 13:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.