From FreeBSDwiki
Jump to: navigation, search

apachectl is a simple tool used to make it easier to start and stop the apache webserver.

apachectl start - starts the webserver. Reports whether or not it successfully started the server, but DON'T take its word for it - apachectl often lies through its bloody teeth. Use ps ax | grep http to double-check that apache is really running.

apachectl stop - stops the webserver. You can probably trust this. =)

apachectl restart - similar to apachectl stop immediately followed by apachectl start. However note that the master process does not die thus different parameters passed on the command line will take effect e.g. -DSSL.

apachectl graceful - very handy for high-traffic production webservers. Works like apachectl restart, except that it does not kill any existing processes until they've finished what they're doing - net effect being that even if you have 100 concurrent users accessing websites on the machine, none of them should have any idea that you restarted apache, no matter when they click to try to load a page. See above re: believing what it tells you - do NOT assume that it really did restart successfully without checking behind it with a ps ax | grep http.

apachectl configtest - will either return Syntax OK or a detailed description of what it thinks is wrong with your httpd.conf. Use this if you can't get Apache started.

Personal tools