Only allowing certain ip addresses

Discussion in 'General' started by glennbtn, Nov 29, 2022.

  1. glennbtn

    glennbtn New Member

    Hi All
    We have a couple of site that should only be accessible to certain ip addresses.
    On our old Ispconfig server in the apache directives we only every needed to put the ip on multiple line with this code
    Require ip xx.xx.xx.xx
    On our newest build this does not seem to work anymore. Any apache details I have tried don't seem to work
    Can anyone advise what I need to put in this to make it work again

    Thanks
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    that should work. maybe double check that mod_authz_core and mod_authz_host are enabled.
     
    Th0m likes this.
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    Code:
    <Location />
    <RequireAny>
     Require all denied
     Require ip xxx.xxx.xxx.xxx
     Require ip xxx.xxx.xxx.xxx
    </RequireAny>
    </Location>
    
    It should look like this
     
  4. glennbtn

    glennbtn New Member

    Perfect, thank you
     
  5. remkoh

    remkoh Active Member

    This should work too. Been using it like this for some time now.
    Code:
    <Location />
        Require host domainA.tld
        Require host domainB.tld
        Require ip 1111:2222:3333:4444::/64
        Require ip 1.2.3.4
    </Location>
    
    Saves a few lines.
     

Share This Page