How to add virtual hosts without having to restart apache?

When I read tutorial on how to create /add virtual hosts, the last sentence is always something like:

... now restart apache and you are done!

Now, many (most|all) web hosts have a panel that allow you to create new virtual hosts which are activated almost instantly... and I am sure they didn't restart apache (inconveniencing hundreds of other users) just for my pleasure!

So how to change apache settings / adding virtual hosts, etc. and reloading the new settings without actually restarting the apache server?


$ /etc/init.d/httpd reload

This will run a config syntax check and then will make apache reload its config files without interrupting traffic.


Most linux distros have a small utility called apachectl or apache2ctl, which you can use to just reload the configuration. This will also activate any new virtual hosts. The command you are looking for is apache2ctl graceful