2

I usually:

  1. Update my local near-replica ( ServerName directive and Logs will obviously be different ) of the production conf file and make my changes for things like rewrite rules.
  2. /etc/init.d/apache2 restart or graceful locally and ensure it's working
  3. scp the conf file to the production server
  4. apache2ctl configtest
  5. apache2ctl graceful

I never really followed any sort of guide, just picked up some commands. Is this usually the way it's done? I almost always use graceful on the production server since I don't want to lose clients with a full restart - graceful restarting is fairly common, right? Are there any circumstances where graceful isn't sufficient and I need to do a full restart?

1 Answer 1

2

It depends on the scale you're at -- you've got the basic steps down, the main differences would be in how the config file is propagated to the production servers (bigger sites would involve things like checking it into revision control and waiting for or forcing Puppet, Chef, CfEngine, etc. to propagate the change out) and the degree of automation that is used (again, bigger sites hopefully have more automated procedures, since they'll be dealing with more than one server).

AS for graceful versus hard restart -- in the graceful, the "main" Apache parent process doesn't exit, just the worker child processes. I've seen circumstances where the primary process had some sort of cached state -- old DNS, whatever -- that didn't get flushed with a graceful, only a full stop/start cycle.

2
  • so would you recommend using graceful? would it help invoking graceful multiple times regarding the caching issue? Commented Sep 3, 2009 at 19:56
  • if you're just putting a new config in place, graceful will be sufficient. you can save the full bore stop/start cycle for troubleshooting strange happenings. 8^)
    – genehack
    Commented Sep 3, 2009 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .