2

Actually I got some issue with file descriptors on Debian Wheezy with 3.2.13 kernel and Apache/2.2.16.

I would like to reduce this limit, actually each virtualhost got a CustomLog and an ErrorLog, I want to set up only one CustomLog and one ErrorLog for all virtualhost.

Is it possible to define one time, a global CustomLog on apache2 for every virtualhost ?

I tried CustomLog on my /etc/apache2/apache2.conf but I got no entry.

CustomLog /var/log/apache2/test.global.log global_combined

Some documentation about this limit : http://httpd.apache.org/docs/2.2/vhosts/fd-limits.html

If someone got any clue, it'll help me a lot :)

Maxence
  • 197
  • 1
  • 1
  • 12

1 Answers1

2

You need to also remove the CustomLog and ErrorLog directives from the virtual host's configuration, otherwise it'll be logged via the virtual host's log files. That said, how many virtual hosts are you running? You should be able to increase the fd limit to accommodate the number of virtual hosts you're running. Try apache's documentation example on this:

ulimit -S -n 100

And adjust the "100" according to your needs.

Gustavo Maia
  • 391
  • 1
  • 4
  • I already set up my ulimit before starting apache2. It works, I can handle over 1024 files openned. Actualy I got nearly 3k files opened : ps -A x |grep apache | awk '{print $1}' | xargs -I '{}' ls /proc/{}/fd | wc -l 2964 Now I would like to use just one file for all my log, but I don't know how to set up this custom log on my apache2 configuration. Actually Im using fastcgi module + 1 customlog + 1 errorlog per virtualhost, I got over 370 vhosts. – Maxence Feb 23 '15 at 08:43
  • Did you try removing the `CustomLog` and `ErrorLog` directives from the `` blocks, while still keeping the global ones that you created? Aside from the actual number being "big", does the high open file count actually bring you any issues? I'd expect you to be able to handle much more than 3k. By default, we usually set our limit to 65535 though we don't use nearly that much. – Gustavo Maia Feb 26 '15 at 19:57