Controlling Apache

At times you will need to restart Apache - for example, after changing on of Apache’s configuration files or adding a virtual host to your server. The apachectl supercommand is available to anyone in the webadmin group and is used to start, stop, and restart the apache application.  It can also be used to test your Apache configuration for correct syntax.  

If Apache is currently running, it can be restarted with the following command:

> apachectl restart

 

NOTE: You must restart the apache application whenever you make changes to your Apache configuration files; otherwise, the changes will not take effect.

The apachectl command can also be used to stop Apache completely, and to start it up again in one of two different modes – with SSL support and without. To stop your Apache server completely, type:

> apachectl stop

If Apache is stopped, your Web service will not be running and no one will be able to get to any of the Web sites hosted on your server.

To start Apache when it is stopped, you again use the apachectl command. Because your Freedom server comes enabled with SSL, you should always tell Apache to start with SSL support if it is ever stopped completely. This is done with the following command:

> apachectl startssl

Finally, the apachectl command can be used to test your Apache configuration, to ensure that there are no errors in your configuration files that would prevent Apache from starting or restarting. To use apachectl in this way, type:

> apachectl configtest

If there are errors in your Apache configuration, they will be reported.

NOTE: In the provided default Apache configuration, it is normal to see the following warning message when Apache is started from a stop:

[warn] NameVirtualHost ip.add.re.ss:443 has no VirtualHosts

...where ip.add.re.ss is replaced with your actual IP address. This warning can be safely ignored.