Apache automatically reloading httpd.conf file?

Apache automatically reloading httpd.conf file?

Post by fnor » Tue, 14 Nov 2000 04:00:00



I've got a couple of Apache servers set up with JServ hosting servlet apps.

On Friday I had to pull a couple of the hosted sites, but I didn't have time
to edit the conf file, so I just pulled them from DNS to remove access to
the sites.

At some point this morning, the systems went down because Apache reloaded
the httpd.conf file and refused to run because it couldn't resolve a couple
of the VirtualHosts directives.

Is Apache supposed to reload the file periodically? If so, is there some
control over it? I'd like to turn it off, if possible, or at least know what
the interval is that it waits to reload....

thanks,
fnord

 
 
 

Apache automatically reloading httpd.conf file?

Post by David La Croi » Tue, 14 Nov 2000 04:00:00



> I've got a couple of Apache servers set up with JServ hosting servlet apps.
> On Friday I had to pull a couple of the hosted sites, but I didn't have time
> to edit the conf file, so I just pulled them from DNS to remove access to
> the sites.
> At some point this morning, the systems went down because Apache reloaded
> the httpd.conf file and refused to run because it couldn't resolve a couple
> of the VirtualHosts directives.
> Is Apache supposed to reload the file periodically? If so, is there some
> control over it? I'd like to turn it off, if possible, or at least know what
> the interval is that it waits to reload....
> thanks,
> fnord

On my system, to support log-rotation, a process called "newsyslog" is run
periodically which checks the size of the log files.  When certain
conditions are met, it rotates the logs, and issues a HUP signal to the
apache process.  (This makes Apache close the current filehandles and
start a new one)  A side effect of this could be that upon the HUP, it
re-loads the config file.

--


 
 
 

Apache automatically reloading httpd.conf file?

Post by fnor » Tue, 14 Nov 2000 04:00:00


That must be exactly what happens, as the new log file started at almost
exactly the same time. I'm going to have to look to see what I can do to
avoid the situation. Ideally, we'd be able to tell Apache to just not *load*
the VirtualHost zone if it can't be resolved, instead of dying completely.

There's probably such a setting somewhere, I'm going to go dig for it.

Thanks a lot,
fnord




> > I've got a couple of Apache servers set up with JServ hosting servlet
apps.

> > On Friday I had to pull a couple of the hosted sites, but I didn't have
time
> > to edit the conf file, so I just pulled them from DNS to remove access
to
> > the sites.

> > At some point this morning, the systems went down because Apache
reloaded
> > the httpd.conf file and refused to run because it couldn't resolve a
couple
> > of the VirtualHosts directives.

> > Is Apache supposed to reload the file periodically? If so, is there some
> > control over it? I'd like to turn it off, if possible, or at least know
what
> > the interval is that it waits to reload....

> > thanks,
> > fnord

> On my system, to support log-rotation, a process called "newsyslog" is run
> periodically which checks the size of the log files.  When certain
> conditions are met, it rotates the logs, and issues a HUP signal to the
> apache process.  (This makes Apache close the current filehandles and
> start a new one)  A side effect of this could be that upon the HUP, it
> re-loads the config file.

> --


 
 
 

Apache automatically reloading httpd.conf file?

Post by Joshua Sliv » Tue, 14 Nov 2000 04:00:00



> That must be exactly what happens, as the new log file started at almost
> exactly the same time. I'm going to have to look to see what I can do to
> avoid the situation. Ideally, we'd be able to tell Apache to just not *load*
> the VirtualHost zone if it can't be resolved, instead of dying completely.
> There's probably such a setting somewhere, I'm going to go dig for it.

Check here:
http://httpd.apache.org/docs/dns-caveats.html

You are probably using hostnames in the <VirtualHost> directive,
whereas you should be using IP addresses.  Also, consider changing
whatever process is restarting Apache so that it does a syntax
check (httpd -t) and does not try to restart if the syntax check
fails.  I'm not sure whether that would fix your problem, but
it is certainly a good thing to do.  apachectl does just that.

--
Joshua Slive

http://finance.commerce.ubc.ca/~slive/

 
 
 

1. Dynamic Reload of httpd.conf

I have Apache 1.3.1 installed and am hosting multiple IP based virtual
domains on it.  I'm working on an automated system that will allow certain
things in httpd.conf to be modified via a web interface.  Making the
modifications to the directives in this file isn't really a problem.

My understanding is that Apache only reads the httpd.conf file when it is
started up.  Obviously this in necessary for performance reasons.  But I'd
like to know if there is anything that I can do to have it dynamically
reload the file without stopping and restarting the server.

I'd like changes made via the web interface to be immediately available.
But I don't want to stop ALL virtual hosts anytime a change is made.  I'm
considering have the server restart each night at 3am or something like
that, but that is not quite as ideal.

Are there any web-based configuration utilities available?  Is there any way
to do what I'm wanting?  I would be willing to learn how to write a mod if
the capabilities existed in the API.

Thanks,
Tauren

2. IPautofw - where is it?

3. Test httpd.conf setup - using variables in httpd.conf

4. ppp, diald and routing tables

5. translator from CERN httpd configuration rules to Apache httpd conf?

6. linux install howto on powerstack

7. APACHE 1.1.1 httpd.conf and the "httpd -f ..." option

8. checking if file is older than 5min

9. APACHE httpd.conf vs. httpsd.conf HELP !!!1

10. Apache .conf vs. NCSA httpd .conf

11. including other conf files in httpd.conf

12. Apache, httpd.conf, transferLog: Limiting certain files from being logged

13. Streamlining HTTPD.CONF file in Apache