简体   繁体   English

Apache2密码保护目录,但允许本地访问而无需密码提示

[英]Apache2 Password protect directory but allow local access without password prompt

I am using apache2 webserver and have configured directory protection which works OK. 我正在使用apache2网络服务器,并已配置了可以正常运行的目录保护。 However On the pc that is hosting my apache2 webserver I need to access the site without apache2 prompting for username and password. 但是,在托管我的apache2网络服务器的PC上,我需要访问该站点而无需apache2提示输入用户名和密码。 I have tried many of the suggested solutions out there but have not been able to get this darn thing to work. 我已经尝试了许多建议的解决方案,但是还无法使该死的东西正常工作。 At the moment I am forced to enter username/password to access the site from the same machine ? 目前,我被迫输入用户名/密码以从同一台计算机访问该站点吗? This is my apache2.conf setup --- any help would be most appreciated. 这是我的apache2.conf设置---任何帮助将不胜感激。

<Directory /var/www>
AuthName Login
AuthType Basic
AuthUserFile /usr/local/bin/passwords
Require valid-user
Allow from 127.0.0.1
Satisfy Any
</Directory>

The above is the basic setup I have but I hav tried a number of variations to this but still cannot seem to access my site from the local machine (that host's the site) via firefox. 上面是我的基本设置,但是我尝试了一些变体,但仍然似乎无法通过firefox从本地计算机(主机所在的站点)访问我的站点。 My apache2 server is also configured to operate on port 888 rather that the normal port 80 - I need to do this because my local ISP blocks port 80? 我的apache2服务器还配置为在端口888而不是普通端口80上运行-我需要这样做是因为我的本地ISP阻止了端口80?

I need to access the local site from the server machine using firefox but without it asking for username & passwords (required only for external access) 我需要使用firefox从服务器计算机访问本地站点,但不要求用户名和密码(仅用于外部访问)

You may check the directive Satisfy again and have a look to the directive location 您可以再次检查指令“ 满意”并查看指令的位置

Edit: Your question may also be a duplicate of this one 编辑:您的问题可能也与重复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM