Allow IP address without authentication

前端 未结 3 1189
长发绾君心
长发绾君心 2020-12-04 12:47

I have set up a site that is currently work in progress. I\'m using an external SMS gateway that needs access to a script on my server. However, I have set up a basic userna

相关标签:
3条回答
  • 2020-12-04 13:17

    Just found out, with help from JoseK:

    Order deny,allow
    Deny from all
    AuthType Basic
    AuthUserFile /www/.site_htpasswd
    AuthName "Protected Area"
    require valid-user
    Allow from 1.2.3.4
    Satisfy Any
    
    0 讨论(0)
  • 2020-12-04 13:38

    Try changing first 2 lines to

    Order deny,allow
    Deny from all
    Allow from 1.2.3.x
    

    Replace your desired IP in the Allow from

    0 讨论(0)
  • 2020-12-04 13:41

    UPDATE: As of Apache 2.4, Order, Allow, Deny, and Satisfy directives should not be used anymore. So the new syntax is:

    AuthType Basic
    AuthUserFile /www/.site_htpasswd
    AuthName "Protected Area"
    
    <RequireAny>
        Require ip 1.2.3.4
        Require valid-user
    </RequireAny>
    
    0 讨论(0)
提交回复
热议问题