Problems blocking IP addresses
I'm being plagued by spam referrersI set up an .htaccess file
Options All -Indexes Directory
Index index.php index.htm index.html
<Files .ftaccess> deny from all </Files>
deny from 62.168.109.150
deny from 63.243.181.*
deny from 63.243.181.25
deny from 64.34.66.18
deny from 64.136.24.162
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?fioricet-buy.travel.to(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?phentermine-buy.travel.to(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?viagra.pills.27south.com(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?21loan-carerty.blogspot(-|.).*$ [OR] RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?car-florida-insurance-rate(-|.).*$ [OR]
RewriteRule .* - [F,L]
deny from 62.168.109.150
deny from 195.161.119.52
deny from 212.176.41.3
Index index.php index.htm index.html
<Files .ftaccess> deny from all </Files>
deny from 62.168.109.150
deny from 63.243.181.*
deny from 63.243.181.25
deny from 64.34.66.18
deny from 64.136.24.162
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?fioricet-buy.travel.to(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?phentermine-buy.travel.to(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?viagra.pills.27south.com(-|.).*$ [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?21loan-carerty.blogspot(-|.).*$ [OR] RewriteCond %{HTTP_REFERER} ^http://(www\.)?.*(-|.)?car-florida-insurance-rate(-|.).*$ [OR]
RewriteRule .* - [F,L]
deny from 62.168.109.150
deny from 195.161.119.52
deny from 212.176.41.3
so I logged into the server and used
iptables -A INPUT -s IPaddress -j DROP
for all the ip addresses
still they keep hitting my site. My host installed afp firewall so I edsited the deny_hosts.files:
##
# deny_hosts
#
# Trust based rule file to define addresses that are implicitly denied.
#
# Format of this file is line-seperated addresses, IP masking is supported.
# Example:
# 192.168.2.1
# 192.168.5.0/24
#
# advanced usage
#
# The trust rules can be made in advanced format with 4 options
# (proto:flow:port:ip);
# 1) protocol: [packet protocol tcp/udp]
# 2) flow in/out: [packet direction, inbound or outbound]
# 3) s/d=port: [packet source or destination port]
# 4) s/d=ip(/xx) [packet source or destination address, masking supported]
#
# Syntax:
# proto:flow:[s/d]=port:[s/d]=ip(/mask)
# s - source , d - destination , flow - packet flow in/out
#
# Examples:
# inbound to destination port 22 from 192.168.2.1
# tcp:in:d=22
=192.168.2.1
#
# outbound to destination port 23 to destination host 192.168.2.1
# out:d=23:d=192.168.2.1
#
# inbound to destination port 3306 from 192.168.5.0/24
# d=3306
=192.168.5.0/24
#
##
69.93.164.82
66.98.242.237
64.136.24.162
80.77.88.3
63.247.90.252
212.163.58.71
213.239.203.47
69.57.130.140
66.179.230.80
69.31.86.233
63.243.189.35
66.230.182.227
# deny_hosts
#
# Trust based rule file to define addresses that are implicitly denied.
#
# Format of this file is line-seperated addresses, IP masking is supported.
# Example:
# 192.168.2.1
# 192.168.5.0/24
#
# advanced usage
#
# The trust rules can be made in advanced format with 4 options
# (proto:flow:port:ip);
# 1) protocol: [packet protocol tcp/udp]
# 2) flow in/out: [packet direction, inbound or outbound]
# 3) s/d=port: [packet source or destination port]
# 4) s/d=ip(/xx) [packet source or destination address, masking supported]
#
# Syntax:
# proto:flow:[s/d]=port:[s/d]=ip(/mask)
# s - source , d - destination , flow - packet flow in/out
#
# Examples:
# inbound to destination port 22 from 192.168.2.1
# tcp:in:d=22

#
# outbound to destination port 23 to destination host 192.168.2.1
# out:d=23:d=192.168.2.1
#
# inbound to destination port 3306 from 192.168.5.0/24
# d=3306

#
##
69.93.164.82
66.98.242.237
64.136.24.162
80.77.88.3
63.247.90.252
212.163.58.71
213.239.203.47
69.57.130.140
66.179.230.80
69.31.86.233
63.243.189.35
66.230.182.227
Still the IP addresses cause http referrers in my site.
I don't know what I'm doing wrong or what to do next.
Should any one of the above work on its own to block IP addresses or do they all work in combination
why can't I ban any IP addresses - I know on my last hosted server account I just used to add them to the .htaccess file to ban them and that seemed to work.
I'm running centOS with cPanel & WHM
I'm a beginner at server hosting & all this Linux stuff so simple explanations really appreciated
thanks