Apache Virtualhost Entries Work After a Graceful Restart

Turns out that you can apply virtual host changes in Apache config (httpd.conf) with a graceful apache restart, rather than a full restart which forcibly kicks (which means kicking users off your web server).

Here’s how to do a graceful change:

  • Change the httpd.conf file accordingly
  • Check your config with sudo service httpd configtest (make sure you get syntax OK)
  • Issue sudo service httpd graceful (most Linux variants)

Note quite a few other Apache changes take effect with a graceful restart. Well worth trying this first, before resorting to a full restart.