The default way to start and stop Apache on Mac OS X Server is to use the Web module of Server Settings. When you start Web service using Server Settings, the Watchdog startup item starts several processes, including one named serversettingsd, which is part of Server Settings. The serversettingsd process includes several plugins, including one for Apache. The Apache plugin checks the #AutoStartServer pseudo-comment in /etc/httpd/httpd_macosxserver.conf; if it's set to On, it raises the soft process limit and does "apachectl start".
If you want to use the apachectl script to start and stop Web service instead of using Server Settings, be aware of the following behaviors:
- The Web performance cache is on by default. When Web service starts, both the main Web service process (httpd) and a webperfcache process start. (The webperfcache process serves static content from a memory cache and relays requests to httpd when necessary.) The apachectl script that comes with Mac OS X Server is unaware of webperfcache. So if you have not stopped the performance cache, you also need to use the webperfcachectl script to start and stop webperfcache.
- The apachectl script does not increase the soft process limit beyond the default of 100. Server Settings raises this limit when it starts Apache. If your Web server receives a lot of traffic and relies on CGI scripts, Web service may not work when it reaches the soft process limit. In this case, you can start Web service using Server Settings, which sets the soft process limit to 2048. Alternatively, you can type "ulimit -u 2048" before using apachectl.
- The apachectl script does not start Apache automatically whenever the server restarts. To make sure that Web service is on after startup, use Server Settings. This behavior differs on a Mac OS X computer, where an Apache Startup Item is used in conjunction with a flag in the /etc/hostconfig file. (If you install a Software Update, it may contain content intended only for a Mac OS X computer, a harmless side effect as long as you don't add the flag to /etc/hostconfig that uses that content.)