Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 15 down vote accepted
$ /etc/init.d/httpd reload

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

share|improve this answer
Oh, cool! I new about the start|stop|restart options, but not about the reload one. Thanks. – augustin Aug 28 '10 at 15:43
Some change also requires force-reload rather than reload. – ℝaphink Aug 28 '10 at 16:11
and make sure you do a: service httpd configtest before your reload - it won't get all config errors, but it catches some. – Jason Tan Aug 28 '10 at 19:01
@Jason, at least on Debian/Ubuntu, the above command runs a config test (and ensures that it exits cleanly) before issuing the apache2ctl graceful. – EEAA Aug 29 '10 at 0:06

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

share|improve this answer
Thanks. I'll certainly check them out. How does this compare to the other solution: <code>$ /etc/init.d/httpd reload </code> – augustin Aug 28 '10 at 15:44
@augustin: the init script is a wrapper around apache2ctl. I would rather use the init script because it might also launch apache2 as a specific user, which you'd have to know in order to use apache2ctl. Trust in the tools that come with your distribution :-) – ℝaphink Aug 28 '10 at 16:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.