Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many error_logs can apache handle?

Status
Not open for further replies.

roycrom

Programmer
Aug 2, 2002
184
GB
I am running apache-1.3.27 on Solaris 8.

I have about 550 virtual hosts each configured to output to their own access and error logs. When I try to start httpd I get an error in my main error log saying:

fopen: /export/home/apache/logs/error_log_virthost450: no such file or directory
httpd could not be started

It is not a permissions problem - I have already ruled that out.

apache actually created an error_log_virthost# for all my virtual hosts but then it says it cannot find it so the path is definately correct in the conf file.

This particular host is about number 450 in httpd.conf.

Could it be that apache can not handle this amount of virtual hosts. There doesn't seem to be a limit that i can find in the docs. I was thinking this however because when I move the offending host further down the list then try to restart I get the same error but for virthost451 which is where the old virtual host was.

Anyone had any similar problems? ------------------------------------------
Thanx | your welcome !!

roycrom :)
 
I bet apache has used up all available filehandles. Each vhost has, what, an access and error log? That's 1100 or so filehandles open at once.

You can try recompiling apache and look for a MAXFILEHANDLES or similar #define in a header file.

Maybe come up with a different logging strategy? I had a sysadmin friend that ended up combining a bunch of the vhosts' logs into one logfile, as they were non-techno types and never wanted more than a summary (which he wrote a script to generate from the combined logfile). --
JR
 
Note that just increasing the number of maximum file handles in Apache may not work, as there is a limit in the operating system as well.

Have you looked into using [tt]VirtualDocumentRoot[/tt] and then parsing the logs splitting them up? This is what I currently do, even though I only host a couple of domains and subdomains. //Daniel
 
Thanks for your replies.

Apache uses fopen and if I am remember correctly, fopen can only open the first 256 file descriptors. Does anyone know of a way to get apache to use open instead of fopen, is there or a way to increase the the limit for fopen? Am i making sense??? Not to myself lol.

But as i said previously, the log it failed on was about number 450 so I am stumped. Daniel, did you mean specifying the logformat to put VirtualDocumentRoot in the log itself so I can split the log up later? I could do that but I only want to consider it as a fallback option as I will have HUGE logs which will take quite a while to parse.

Thanks again for your previous help... ------------------------------------------
Thanx | your welcome !!

roycrom :)
 
Just realized that apache was reading the virtual hosts in reverse order in the conf file. Did a wc -l on the number it had created and came up with 240 so it looks like thats the limit for number of virthosts each with their own logfiles. It looks like I will have to take the big log, parse later option.

Thanks for the suggestions... ------------------------------------------
Thanx | your welcome !!

roycrom :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top