Restart httpd after changes in the httpd.conf
Asked Answered
G

3

51

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

Gingerly answered 31/10, 2010 at 10:18 Comment(2)
@svisstack true, but apache and apache-config is not related to programming either.Gingerly
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.Crassulaceous
H
38

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

Hoyt answered 31/10, 2010 at 10:20 Comment(7)
You can do service httpd reload, so apache will not be down.Curse
@narkoz service does not exist so useing /etc/init.d/httpd status/restartGingerly
I did a redirect, but restarting also does not solve the issue...what could be wrong. I have logged in as root.Gingerly
If your changes are not taking effect after restart, it is possible that your httpd.conf is incorrect.Hoyt
Jean, /etc/init.d/httpd reloadCurse
Are the certificate changes in ssl.conf also picked up by reload of httpd ?Maladjusted
@vishnu Yes, it should be.Hoyt
S
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.

Scission answered 18/6, 2015 at 8:10 Comment(1)
You can do a graceful restart which does not require "restart the server" @Raghunandan JDumuzi
P
4

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.

Potiche answered 7/4, 2017 at 19:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.