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

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:
http://www.howtoforge.com/forums/showthread.php?t=56195

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:
Quote:
<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
</Files>
</Directory>

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