How to configure mod_autoindex on Mac OS X server

apache-2.2mac-osx-server

I'm using Mac OS X server 10.6.6. I want to have a custom configuration for mod_autoindex. There is a mod_autoindex section in the httpd.conf, however, if I edit the httpd.conf file manually (/private/etc/apache2/httpd.conf), some of the changes I make there get overwritten when the server restarts, sometimes.

OS X server doesn't really intend for you to manually edit httpd.conf, I take it. It wants to maintain httpd.conf on it's own. Is it possible to make custom configurations for a module, specifically the mod_autoindex module? I've looked around in the documentation but see no support for how to do something like this on mac OS X server:

<IfModule mod_autoindex.c> 
##
Options Indexes FollowSymLinks
IndexOptions FancyIndexing 
IndexOptions VersionSort 
IndexOptions HTMLTable 
IndexOptions FoldersFirst 
IndexOptions IconsAreLinks 
IndexOptions IgnoreCase 
IndexOptions SuppressDescription 
IndexOptions SuppressHTMLPreamble 
IndexOptions XHTML 
IndexOptions IconWidth=16 
IndexOptions IconHeight=16 
IndexOptions NameWidth=*
IndexOrderDefault Descending Name
HeaderName /index-style/header.html
ReadmeName /index-style/footer.html
#
Blah blah blah
</IfModule>

Best Answer

it's perfectly fine to control apache on OSX Server using direct edits of httpd.conf and its counterparts. The problem comes in case you're partially using Server Admin (or another control panel) and direct editing of conf files.

Regarding your autoindex feature: This is from httpd.conf

#### For Mac OS X Server: Note that indexing is further controlled                                                            
#### by the Server Admin application, which adds "Options +/-Indexes                                                          
#### in the virtual host scope.                                                                                               

So you need to check your virtual host conf file and also to check included files on the bottom.

Related Topic