Restarting Apache on OSX from the Command Line

OSX Web Server Grayed Out

This managed to perplex me for some time...

For some reason, the Web Sharing checkbox which I would normally use to restart Apache under OSX became grayed out. I have since realised that I could have just clicked the lock (DOH!)… but I found a way of restarting Apache from the command line:

[cc lang='text' line_numbers='false']sudo apachectl restart[/cc]

will restart Apache, reloading all php.ini/httpd.conf changes.