restricting access to page by IP not working

Operating System & Version
CENTOS 7.7 virtuozzo
cPanel & WHM Version
v78

chanklish

Well-Known Member
May 22, 2015
77
0
56
kinshasa
cPanel Access Level
Root Administrator
hello
i am trying to restrict access to a login.php page by IP address
I have the following in the .htaccess file in the same directory , but it blocking everything including this ip - where did i go wrong ?!
this post is from this older one : SOLVED - Restricting IP access to a specific website page

Code:
<Files login.php>
       Order deny,allow
       Deny from all
       Allow from 102.68.xx.xx
</Files>
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Technically Apache 2.4 uses Require now not allow/deny but it should still be usable.

http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#order said:
The Order directive, along with the Allow and Deny directives, controls a three-pass access control system. The first pass processes either all Allow or all Deny directives, as specified by the Order directive. The second pass parses the rest of the directives (Deny or Allow). The third pass applies to all requests which do not match either of the first two.
Note that all Allow and Deny directives are processed, unlike a typical firewall, where only the first match is used. The last match is effective (also unlike a typical firewall). Additionally, the order in which lines appear in the configuration files is not significant -- all Allow lines are processed as one group, all Deny lines are considered as another, and the default state is considered by itself.
My assumption is that you don't have the correct IP in the allow from portion.
If you wanted to learn more about Require directives you can find them here: mod_authz_host - Apache HTTP Server Version 2.4
 

chanklish

Well-Known Member
May 22, 2015
77
0
56
kinshasa
cPanel Access Level
Root Administrator
Technically Apache 2.4 uses Require now not allow/deny but it should still be usable.



My assumption is that you don't have the correct IP in the allow from portion.
If you wanted to learn more about Require directives you can find them here: mod_authz_host - Apache HTTP Server Version 2.4
i checked the apache errors , it is showing the ip as the one of cloudflare instead my ip - now how to control this .. this is the real question !