Some hacks to configure Apache on Mountain Lion server
The Server.app manages WebDAV shares and recreates the configuration files each time the File Server is restarted.
The only way I’ve found to customise the configuration is to prevent the Server.app from writing over the generated files once you have customised them.
###ENABLE INFINITE DEPTH QUERIES
A typical configuration may look like the following
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This file is auto-generated by the web configuration
# mechanism whenever WebDAV Sharing settings are modified.
# Updated: 2013-03-07 04:32:07 +0000
<Directory "/Data">
Allow from 127.0.0.1
DAV On
DavDepthInfinity on
AllowOverride None
</Directory>
RequestHeader edit Destination "^.*/Data(.*)$" "http://localhost:${UserPort}/Data$1"
<Directory "${UserHomeDir}">
Allow from 127.0.0.1
DAV On
AllowOverride None
</Directory>
RewriteRule ^/${UserUUID}/${UserName}(.*)$ "${UserHomeDir}$1" [NS]
RequestHeader edit Destination "^.*/${UserName}(.*)$" "http://localhost:${UserPort}${UserHomeDir}$1"
Substitute "s|${UserUUID}${UserHomeDir}|webdav/${UserName}|n"
Substitute "s|${UserHomeDir}|/webdav/${UserName}|n"
Then prevent any further changes by running the following command on the file from the console
1
chflags uchg httpd_webdavsharing_sharepoints.conf
In order to change the file again you need to reverse the setting
1
chflags nouchg httpd_webdavsharing_sharepoints.conf