How to restart apache with serveradmin environment variables set?
Hi,
With any Unix machine, one can run at the command line:-
apachectl -S
This will show all virtual servers configured in Apache, and will break if there are any obvious problems in the httpd .conf files. It's very handy for testing a new configuration before restarting the server.
With Mac OS X Server though, this doesn't work properly. Sure, I can run that command and see a virtual server or two, but with the introduction of the server Apache wrappers, the command line tools read a very different configuration than the `serveradmin` tool does.
e.g. Wrappers like:-
<IfDefine MACOSXSERVER>
....
</IfDefine>
or
<IfDefine WEBSERVICE_ON>
Include /etc/apache2/sites/*.conf
</IfDefine>
There's loads of these, and they mean that I can't use any of my favourite apache command line tools.
A really critical command that I'm pretty sure doesn't work with these wrappers is:-
sudo apachectl graceful
So, how can I use apachectl under Mac OS X server? There's a couple of quite large plist files in the /etc/apache2 directory, but I don't know how to read plist settings into the environment before executing a program. The Developer documentation seems directed towards ObjC developers, which I am not.
Any help much appreciated.
Cheers,
Alex
ps. Running `sudo serveradmin stop web && sudo serveradmin start web` really ***** compared to `apachectl graceful`; it's painfully slow and doesn't provide a way to test a custom configuration before attempting to restart.
Mac Pro mid-2010, Mac OS X (10.6.4)