[英]Apache - How to protect virtualhost directive without htaccess
I would like to password protect port 2000 of a web server by embedding a location directive inside of the virtualhost directive of the apache config file. 我想通过嵌入Apache的配置文件的虚拟主机指令的内部位置指令密码保护Web服务器的2000端口。 However it didn't prompt for a password as expected. 但是,它没有提示输入预期的密码。 This is what I had in the apache config file: 这是我在apache配置文件中的内容:
<VirtualHost *:2000>
ServerName www.server.com
ServerAdmin email
DocumentRoot /var/www/html
ErrorLog logs/server.com-error_log
<Location / >
AuthType Basic
AuthName "Security"
AuthUserFile /var/www/s2/.htpasswd-users
Require valid-user
</Location>
</VirtualHost>
A couple reasons why I think it didn't work: 我认为它不起作用的几个原因:
So now my question is how to password protect the server at the end of the tunnel. 所以现在我的问题是如何在隧道尽头用密码保护服务器。 It is a simple server and not capable of passwords. 这是一台简单的服务器,没有密码。 That's why I was hoping to protect access to it via the apache server. 这就是为什么我希望保护通过apache服务器对其的访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.