View Single Post
Old 29th August 2012, 07:09
fbartels fbartels is offline
Junior Member
Join Date: Feb 2012
Location: Hanover, Germany
Posts: 21
Thanks: 0
Thanked 4 Times in 4 Posts

The httpd.conf is only used in a stock apache installation, in most cases this default configuration file is even overridden by distribution dependent config files (for example in Debian). If you want your code to be executed in every site you also have to add it to every vhost.

The best way to do this is to create a customer vhost.conf.master (copy it from /usr/local/ispconfig/server/conf to /usr/local/ispconfig/server/conf-custom and do your changes).

After that you have to manually "resave" every vhost for the file to be recreated. Else you could use the remote api to recreate the file for every vhost. The following post suggests the needed steps:

Regards Felix

Overthinking this, there is a way simpler way to achieve this. As the new information is static (doenst need to be changed for every host) you could also create a file inside /etc/apache/conf.d with the needed input. This also affects all vhosts.

Here is the needed layout of the file:
<Directory /var/www/>
SetEnvIfNoCase User-Agent "^Baiduspider" bad_bots
SetEnvIfNoCase User-Agent "^Sogou" bad_bots
SetEnvIf Remote_Addr "212\.100\.254\.105" bad_bots

<Files *>
Order Allow,Deny
Allow from all
Deny from env=bad_bots

Last edited by fbartels; 29th August 2012 at 07:30. Reason: Easier solution
Reply With Quote