52

Do I need to restart httpd after changes in the httpd.conf file for changes to take effect?

John Conde
  • 217,595
  • 99
  • 455
  • 496
X10nD
  • 21,638
  • 45
  • 111
  • 152
  • 1
    @svisstack true, but apache and apache-config is not related to programming either. – X10nD Oct 31 '10 at 10:31
  • 2
    this should be asked on serverfault.com not stackoverflow.com, on serverfault you will get better results, on stackoverflow is not for peoples who interesting with this things. – Svisstack Oct 31 '10 at 10:59

3 Answers3

39

Yes. HTTPD.conf is read on apache start-up, so for any changes to take affect you need to restart it.

Codemwnci
  • 54,176
  • 10
  • 96
  • 129
8

Yes you need to restart the server by

sudo service httpd restart

You can check errors in your config files by

apachectl -t

Changes may take some time to reflect.

Jens
  • 69,818
  • 15
  • 125
  • 179
Raghunandan J
  • 584
  • 1
  • 6
  • 22
3

You can have apache re-read its config files without restarting by sudo apachectl graceful (or apache2ctl on debian).

From the Apache docs:

Gracefully restarts the Apache httpd daemon. If the daemon is not running, it is started. This differs from a normal restart in that currently open connections are not aborted. [...] This command automatically checks the configuration files as in configtest before initiating the restart to make sure Apache doesn't die.

Brian Minton
  • 3,377
  • 3
  • 35
  • 41