浏览文章
文章信息
Apache2.4+ 设置特定ip无需Base Auth
21066
# 如果所有访问都要Base Auth验证则此处注释部分开启
AuthName "Authorized users only" AuthType Basic AuthUserFile /var/www/vhosts/www.aiweline.com/.htpassw Require valid-user# 特定ip无需Base Auth验证
AuthName "Authorized users only" AuthType Basic AuthUserFile /var/www/vhosts/www.aiweline.com/.htpassw <RequireAny> Require ip 22.33.44.55 Require valid-user </RequireAny> # 代理环境 (如果是代理环境请自行替换下面注释了的配置) #SetEnvIF X-Forwarded-For "22.33.44.55" AllowIP # <RequireAny> # Require env AllowIP # Require valid-user # </RequireAny>
Apache开发环境有特殊情况的配置!