Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache block an ip address from accessing the website

Tags:

apache

ip

someone trying to access pages like

//mysqladmin//scripts/setup.php

Is it some hack attempt or .. ?

If yes then how i can block its ip from accessing mine website ?

Via htaccess or something else ?

like image 215
Arshdeep Avatar asked Jul 16 '10 11:07

Arshdeep


People also ask

Can you block an IP address from viewing your website?

Head to the “Security” section and find the “IP Address Deny Manager”, then enter a specific IP address or range of addresses to block. Here, the result is more substantive: Anyone trying to access your site from these addresses will get an error message instead of seeing your page.

How do I restrict access to a website using IP address?

Go to Hosting → Manage, search for IP Manager on the sidebar and click on it: There, you will be able to find 2 options: add IPs to allow and block access to your website: Just add an IP you wish to create rules for, leave a note (optional) and click on Add.

Can a server block an IP address?

IP address blocking is possible on many systems using a hosts file. Unix-like operating systems commonly implement IP address blocking using a TCP wrapper. Proxy servers and other methods can be used to bypass the blocking of traffic from IP addresses.

How do I block an IP address from a domain?

To block an IP address from accessing your site, go to Site Tools > Security > Block Traffic. Choose the domain for which you want to block access. Add the IP address or a whole range in IP/IP Range and click Block. You can also use (*) as a wildcard character if needed, i.e. 192.168.


1 Answers

As an update to this old question for those who still land here:

Order Allow Deny are deprecated as of Apache 2.4 and Require should be used.

<RequireAll>
    Require all granted
    Require not ip 1.2.3.4
</RequireAll>

Ranges, netmasks, etc. can also be specified.

https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html (Deprecated) https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require

like image 70
JBES Avatar answered Oct 27 '22 09:10

JBES