Control Web Panel
WebPanel => Apache => Topic started by: AlexG on February 10, 2018, 03:38:38 PM
-
Hi everyone, it's a good idea to add this custom module to apache, right?
https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker
Anyone interested?
-
mkdir -p /usr/local/apache/custom.d
git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git
cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d
cp -r * /usr/local/apache/custom.d
nano /usr/local/apache/custom.d/globalblacklist.conf
press ctrl+w and ctrl+r
type
/etc/apache2/custom.d
replace with
/usr/local/apache/custom.d
navigate to
https://youip:2087/admin/index.php?module=vhost_tpl
Add Include /usr/local/apache/custom.d/globalblacklist.conf under the code below
<Directory "PATH_REPLACE">
AllowOverride All
/usr/local/apache/custom.d/globalblacklist.conf
</Directory>
Rebuild Apache Vhost
https://yourip:2087/admin/index.php?module=vhost_rebuild
Restart Apache
server httpd restart
Test to see if its working
curl -I http://yourserverip -e http://100dollars-seo.com
Error
HTTP/1.1 403 Forbidden
Date: Sat, 10 Feb 2018 18:18:57 GMT
Server: Apache/2.4.28 (Unix) PHP/5.6.33 OpenSSL/1.0.1e-fips
Content-Type: text/html; charset=iso-8859-1
-
Hi @bullten, that work perfectly sir, thank you.
Just one change, you can avoid the whole nano editing with this single command line:
sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
So, this work for me:
mkdir -p /usr/local/apache/custom.d && git clone https://github.com/mitchellkrogza/apache-ultimate-bad-bot-blocker.git && cd /root/apache-ultimate-bad-bot-blocker/Apache_2.4/custom.d && cp -r * /usr/local/apache/custom.d && sed -i "s|/etc/apache2/custom.d|/usr/local/apache/custom.d|g" /usr/local/apache/custom.d/globalblacklist.conf
Navigate to Apache Settings > Apache vHost Template
https://youip:2087/admin/index.php?module=vhost_tpl
Add this line:
Include /usr/local/apache/custom.d/globalblacklist.conf
under the code below
<Directory "PATH_REPLACE">
AllowOverride All
Include /usr/local/apache/custom.d/globalblacklist.conf
</Directory>
Rebuild Apache Vhost
https://yourip:2087/admin/index.php?module=vhost_rebuild
Restart Apache
server httpd restart
That's it.
**UPDATE**
After almost an hour with this custom module activated, my server load was reduced from 1.75 - 2.30 to 0.30 - 0.12
11:18:35 up 6 days, 21:03, 1 user, load average: 0.12, 0.23, 0.33
-
Perfect thanks for updating this thread :)