Restart Apache the Safe Way

I’ve established a good reputation with being careless with restarting services. For those that can’t afford a second of downtime, you can check if your configuration is sane. This ensures your service won’t go down longer than expected while you look for that syntax error:

apachectl -t

I remember running across that before but forgot how to do it. Found it again while trying to trim down Apache’s Fancy Indexing.

Update: Ha ha! Silly me. I was going to add this to the init script so that it won’t restart if the syntax check failed. It turns out that it’s already in the script under the reload function (I’m using CEntOS).

  • http://spaceheaterbuy.com/ Ben

    hey there, this might be little offtopic, but i am hosting my site on hostgator and they will suspend my hosting in 4days, so i would like to ask you which hosting do you use or recommend?

  • http://NONE Ashley

    hey, nice blog…really like it and added to bookmarks. keep up with good work