我刚刚编辑的htaccess文件包括: AuthType基本 AuthName“我的保护区” AuthUserFile / home / path / to / public_html / 要求有效的用户 然后我通过htpasswd命令创build了一个htpasswd文件。 我已经在Apacheconfiguration中启用了模块:LoadModule authn_file_module modules / mod_authn_file.so。 现在,当我加载页面,我现在得到一个500错误和Apache日志说:“configuration错误:无法检查用户。没有用户文件?: /”
我正在强化我的Apache服务器configuration,并想知道是否使用除.htaccess和.htpasswd之外的任何其他"^.ht.+"文件?
我尝试了很多方法,并坚持使用它。 我编辑/etc/nginx/nginx.conf并编写这些行。 location /home/user/domains/example.com/public_html/lockfolder/ { auth_basic "Restricted"; auth_basic_user_file /home/user/domains/example.com/.htpasswd; } 我使用crypt(3)encryption通过命令mkpasswd创build密码。 然后我用给定的程序user:encryptedpasswd在.htpasswd 。 但事情并不如说。 让我知道如果有人知道我可以如何完全configuration我的目的! 我也用/etc/init.d/nginx reload加载我的nginx
我想临时密码保护一个网站。 我在站点根目录中有一个.htaccess文件,其中包含: AuthType Basic AuthName "Example Site Name" AuthUserFile /home/my_username/.htpasswd Require valid-user 当我访问example.com时 ,会抛出一个login窗口,但是当我进行身份validation时,我得到一个310错误: 此网页有redirect循环 http://example.com/上的网页导致了太多的redirect。 清除本网站的Cookie或允许第三方Cookie可能会解决此问题。 如果没有,这可能是一个服务器configuration问题,而不是您的计算机的问题。 错误310(net :: ERR_TOO_MANY_REDIRECTS):有太多的redirect。 现在,每次击中example.com都会给我这个错误,而不要求我进行身份validation。 为什么发生这种情况?
我试图从我的网站上设置一个文件的htaccess保护。 我已经将以下代码粘贴到05-auth.conf中 $HTTP["url"] =~ "^/www/hosts/domain" { auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/etc/lighttpd/htpasswd" auth.require = ( "/file.php" => ( "method" => "basic", "realm" => "Please enter your Password.", "require" => "valid-user" ), ) } ..和lighttpd重新启动后,我看不到任何login窗口。 这个configuration有什么问题?
重新编辑: 大量的谷歌search,大量的跟踪,很多修补nginx.conf&/虚拟主机 – 这是一个错误信息,说ClamAV不是最新的。 运行clamscan告诉我clamscan没有安装。 试图安装clamscan告诉我,它已经安装。 e_e 所以,看起来我很快就会擦拭这台服务器。 非常感谢大家提供的见解。 如果有人知道这样的事情是怎么发生的,我知道… 编辑: 我通过重新启动服务器解决了这个问题。 e_e 如果我没有弄错,这会牵连php-fpm – 对吗? 然而,现在nginx在线,并响应我所做的configuration更改 – 我得到403禁止和502坏门户之前,我从来没有得到的东西。 (分别是ISPConfig和PhpMyAdmin)错误日志说: [error] 9150#0: *7 open() "[…]/ispconfig/[..]/phpmyadmin" failed (13: Permission denied), 一个链接表明增加缓冲区大小 – 我试过了,不起作用 – 而我发现的其他东西似乎是无关紧要的— 再次感谢 ! 长话短说,这一切都开始时,我试图做一个nginxconfiguration添加一个密码到一个网站。 没什么大不了 – 我以前做过,没有汗 – 但是,configuration不起作用,没有理由为什么— 好吧,长话短说,经过多次失败的尝试,我终于注意到了这一行: include sites-enabled/* ; 在nginx.conf中 只有惊喜, 一切仍然奏效 — 确定Apache没有运行后(它甚至没有安装,不再是了!) – 我search了一下,看看是否可以在Nginx上find关于configurationcaching的任何信息 – 但没有骰子。 […]
我在htaccess文件的最后一个小时遇到了麻烦。 所以我想要的:我有一个文件夹位于http://myip.com/FOLDER ,我想要一个简单的authentication页面通过htaccess 所以我做了以下几点: sudo htpasswd -c /home/daniel/.htpasswd daniel 请注意,我是一个纯粹的初学者,并一直遵循指导。 反正我认为用这个命令我把我的htpasswd文件存放在我的home文件夹中。 进入pb blablabla等,迄今工作^^。 我也创build了一个ssl虚拟主机: 我的内容:文件:/ etc / apache2 / sites-available / default-ssl <Location /myfolder> AuthName "Private" AuthType Basic AuthBasicProvider file AuthUserFile /home/daniel/.htpasswd Require valid-user </Location> ServerName XYZX:443 SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.crt SSLCertificateKeyFile /etc/apache2/ssl/apache.key 默认:ServerName我的地址redirect永久/我的地址 我得到ssl和东西,但从来没有authentication页面 apache2重新启动,但我从来没有得到validation页:( 会感谢帮助 谢谢
我正尝试在我的Nginx服务器上密码保护WordPresslogin页面。 当我导航到http://www.example.com/wp-login.php时 ,会出现用户名和密码的“需要validation”提示(不是WordPresslogin页面)。 但是,当我input正确的凭证时,它会下载PHP源代码(wp-login.php),而不是显示WordPresslogin页面。 我的htpasswd文件的权限设置为644。 以下是我的网站configuration文件的服务器块中有问题的指令: location ^~ /wp-login.php { auth_basic "Restricted Area"; auth_basic_user_file htpasswd; } 或者,这里是我的configuration文件的全部内容(包括上面四行): server { listen *:80; server_name domain.com www.domain.com; root /var/www/domain.com/web; index index.html index.htm index.php index.cgi index.pl index.xhtml; error_log /var/log/ispconfig/httpd/domain.com/error.log; access_log /var/log/ispconfig/httpd/domain.com/access.log combine$ location ~ /\. { deny all; access_log off; log_not_found off; } location = /favicon.ico { log_not_found off; […]
我想给web开发人员testuser一个权限,使用web服务器“mywebserver”上的/ usr / bin / htpasswd命令来设置他自己的.htpasswd密码。 Web服务器树属于wwwadmin用户,因此他拥有Web根目录中的.htpasswd文件,并能够定期运行htpasswd。 在我对sudo的理解中,web服务器(股票Apache,CentOS 6)的/ etc / sudoers中的下一行应该完成这个工作: testuser mywebserver=(wwwadmin) /usr/bin/htpasswd 事实是,只要用户testuser运行: sudo /usr/bin/htpasswd .htpasswd someusername 该命令将被拒绝: [sudo] password for testuser: Sorry, user testuser is not allowed to execute '/usr/bin/htpasswd' as root on mywebsever.mydomain.com. 日志/ var / log / secure显示: Apr 1 17:13:51 mywebserver sudo: testuser : command not allowed ; […]
我在一个shell中,我的web文件夹位于/home/w/waterfox/public_html 。 在那里,我有一个名为irclogs ,我试图密码保护。 它被修改为755。 这里是我放在我的public_html文件夹中的.htaccess文件: <Directory /home/w/waterfox/public_html/irclogs> AuthUserFile "/home/w/waterfox/public_html/.htpasswd" AuthType Basic AuthName "Restricted" Require valid-user </Directory> 当我尝试访问我的网站的任何部分,包括irclogs文件夹以外的东西,我得到一个500 Internal Server Error 。 这似乎与我的.htpasswd文件没有任何关系,因为我可以使用<Files>或<FilesMatch>来保护单个文件。