Server Admin 10.4 Help
Starting and Stopping Web Service Using the apachectl Script
The default way to start and stop Apache on Mac OS X Server is to use the web module of Server Admin.
If you want to use the apachectl script to start and stop web service instead of using Server Admin, be aware of the following behaviors:
- The web performance cache is enabled 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 disabled 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 Admin raises this limit when it starts Apache. If your web server receives a lot of traffic and relies on CGI scripts, web service may fail to run when it reaches the soft process limit.
- The apachectl script does not start Apache automatically when the server restarts.
Because of the issue noted above, if you need to control Apache from a script, the recommended approach is to use the serveradmin command-line tool. To start Apache, and the performance cache if appropriate, and mark /etc/hostconfig to start web service on reboot, issue the following command from a script:
- serveradmin start web
To stop Apache, and to stop the performance cache if appropriate, and to mark /etc/hostconfig not to start web service on reboot, issue the following command from a script:
- serveradmin stop web
When Apache is started using the apachectl script, the soft process limit is 100, the default limit.
When you use CGI scripts, this limit may not be high enough. In this case, you can start web service using Server Admin, which sets the soft process limit to 2048. Alternatively, you can type "ulimit -u 2048" before using apachectl.