By Sajeer K
how to control the same ip accessing bots how to block that ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
If you have IP address of bot accessing your site, you can block it using firewall or Apache config.
A firewall blocking is easier IMO, as one command will block IP to accessing your server.
On Ubuntu, you can use ufw which is very simply to configure and use.
Step 7 of Initial Server Set Up tutorial covers setting up a ufw firewall.
To block IP address, you can use following command:
- sudo ufw deny from 15.15.15.51
Where 15.15.15.51 is IP address of user/bot you want to block.
Also, you can block subnet following command:
- sudo ufw deny from 15.15.15.0/24
ufw essential tutorial should give you more insight on this topic.
Second option is to block via Apache config. This could be harder, as you have to change config and restart/reload Apache every time you do so. Apache docs should help you around this if you’re interested in it.
Be very careful when you doing above. You can sometimes block regular users or ‘good’ bot. For example, Google uses bots to crawl and index your web site. If you block Google bot, this will affect your rank in Google Index and position on Google Search. In case of Google, you can verify are bots accessing your site their, by following steps written on their help page. Same applies for other engines, so make sure you really ban malicious bots.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.