Did anyone help you with this? I am interested in this as well but in relation to Mountain Lion Server.
I wanted to specify something like:
Order Allow, Deny
Allow from 192.168.0/255.255.255.0
Deny from 192.168.0.1
so as to restrict apache to responding to users on the Local Area Network but not responding to the Internet gateway/NAT router on 192.168.0.1.
For virtual host websites, i.e. additional websites created via the Websites service in Server app, and also for the default "Server Website" and "Server Website (SSL)" well:
The latter are controlled. "somewhat", by an httpd_server_app.conf file and you are meant to be able to include files for your personal settings although I have had trouble getting that to work (everything seems so sensitive for some reason).
For the former, the generated virtual host files created by the Server app are stored in:
I have tried including a file into my virtual host files in this location but everytime I do so all of the websites stop working. In Mountain Lion Server you are also recommended to use the webapp mechanism instead of modifying virtual host config files directly. And, like you I cannot find an example of how to do this and to do so in a manner which won't upset the Server app. Maybe the documentation needs expanding?
I am surprised at this "adding another layer of work" when we should be able to safely include a file and for the thing to work.
If you get an answer from someone who knows how to do the webapp thing with a simple example could you please let me know. Thanks
no I didn't get any response.
Somewhere I have read that one should add aditional conf files in the /etc/apache2/sites directory
and include those in the 0000_any_80_[...].conf file.
This works but only as long as you don´t open the webserver tab of Server.app because this results in rewriting the 0000_any_80_[...].conf files an droping the Include directives.
I _do_ know how to manage apache but in OS X Server this becomes a real drag.
It´s not only more complicated but it is also lousily documented in the manpages.
I have been playing around with .htaccess files for virtual host sites on Mountain Lion Server. Note, Server app on Mountain Lion Server is different to Lion Server.
I enabled "Allow overrides using .htaccess files" via the Mountain Lion Server Server app's Websites service and added a .htaccess file into the root directory of the virtual host under sites. Mountain Lion Server didn't get upset. I'm not sure what the performance hit will be by doing this but it's probably no big deal for sites that would use OSX server.