Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache http基本身份验证?_Apache_Http - Fatal编程技术网

Apache http基本身份验证?

Apache http基本身份验证?,apache,http,Apache,Http,是否有一些简单的代码可以添加到.htaccess文件或我的虚拟主机文件中以强制执行http basic auth?这是怎么回事 AuthUserFile /my/derectory/.htpasswd Require valid-user AuthName "Secured Access" AuthType Basic 您感兴趣的部分是需要有效的用户 但是如果可以,请提供更多关于您为什么尝试这样做的信息^ ^谢谢。只需使用htpasswd创建密码文件即可

是否有一些简单的代码可以添加到
.htaccess
文件或我的虚拟主机文件中以强制执行http basic auth?

这是怎么回事

AuthUserFile /my/derectory/.htpasswd
Require valid-user
AuthName "Secured Access"
AuthType Basic
您感兴趣的部分是
需要有效的用户


但是如果可以,请提供更多关于您为什么尝试这样做的信息^ ^

谢谢。只需使用
htpasswd
创建密码文件即可