Out of file handles because of ErrorLogs in vhosts
I have hundreds of sites on a server running Plesk. When I try to add more, Apache refuses to start, because it is out of file handles.
It is out of file handles because Plesk includes a custom ErrorLog and CustomLog in every vhost config file it makes. I tried overriding them with a vhost.conf file, but am not sure how to unset set options. I also tried pointing all the same ErrorLogs to the same file, but that didn't seem to do anything.
Does anyone know how I can either log everything to a single file, or just shut off logging? I really never use logging, and it seems like it would save me progressing power and storage (not to mention file handles!) if I could just disable it.
Maybe you need to do some specific configurations for a domain or subdomain and you tried to do directly in httpd.include file. You saw that it works for the momment but plesk will delete again your specific configurations from this file. So, in this case the answer is vhost.conf file. This file will be placed inside your domain’s conf directory, usually found at /var/www/vhosts/domain.com/conf. Create a file called vhost.conf in whatever editor you prefer. I use vim.
You can now put in any Apache configuration options like you would into httpd.include. In my case I wanted to do only one thing, to have subversion repository accesible over web, without any kind of access restriction.
Here is my vhost.conf file:
Now, you need to tell Plesk to update it’s information.
You have to run:
# /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=domain.com
this will configure plesk only for one single domain, in this case domain.com
If you want to configure it for all sites run:
# /usr/local/psa/admin/bin/websrvmng -a
After this command if you look to httpd.include file, will see that your httpd.include will have an include line for your vhost.conf, something like this:
There is also a vhost.conf file for subdomain in their DocumentRoot directory, if you want to do some specific things for subdomain.
That’s all, bye!
So you think your server is secure?
Try our security Service