htaccess/htpasswd internal error - .htaccess

I wanted to make a simple http authentification,but it throws internal server error. I've already tried all alternatives of path, but it still cannot open password file. Htpasswd has correct rights and it's readable.
Htaccess:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /www/m/s/u10395/public_html/.htpasswd
Require valid-user
Here's the output of error_log:
[authn_file:error] [pid 44106:tid 34464533504] (2)No such file or directory: [client 85.237.234.17:18822] AH01620: Could not open password file: /www/m/s/u10395/public_html/.htpasswd
Isn't there anything what could cause this problem? Thanks.

Related

Adding htaccess and htapassrd to heroku site

I'm trying to temporarily password protect my Heorku app with the .htaccess and .htpasswrd files in the root of the app.
I'm getting a 'Internal Server Error' with the following codes and can't figure out where I'm going wrong
.htaccess
AuthUserFile .htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user
.htpasswrd (MD5 encrypted)
rob:$apr1$MRsSwhFN$buG0YTSOezeY8YJ32LXnT1
Looks like your path is off.
As of July 2016, some subtle changes are necessary on heroku-php-apache2. Please note that the path to the .htpasswd file no longer contains the www directory and that the .htpasswd file should be in the webroot as well.
Create an .htaccess file in the webroot:
AuthUserFile /app/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user
Create a .htpasswd file, also in the webroot:
htpasswd -c .htpasswd [username]
Commit local changes. Deploy to Heroku.
https://gist.github.com/bbrewer97202/3316425

.htaces and .htpasswd give error?

Well, I'm trying to secure my xampp with .htaccess and .htpasswd and I don't see a mistake, so do many other developers that I know...
My .htaccess:
AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/secret/hidden/place/.htpasswd
require valid-user
php_flag register_globals on
My .htpasswd:
wscript:$apr1$Y107OG1n$Ui6D997SqhERXXyV9VBU51
The error is error 500
Anyone?
You should consult your error logfile usually located at: /var/log/apache2/error.log. Without knowing the exact error there's really only speculation as to what might be the issue.
AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/apache/var/www/site/.htpasswd
Require valid-user
require valid-user should be capital "R"
AuthUserFile is usually located one directory above the web root.
The permissions on the .htaccess and .htpasswd need to be set so that Apache can read them: chmod 0644 .htaccess chmod 0644 .htpasswd
( further reading )

Htaccess and htpasswd authentication fail

I have the following code to protect my application:
.htaccess:
AuthType Basic
AuthName "My Protected Area"
AuthUserFile .htpasswd
Require valid-user
.htpasswd:
username:$apr1$Am/5PMEt$JofEYwKBM8rhEnsoLndir/
The .htpasswd file is in the same directory as the .htaccess file.
It does ask me for authentication, but then gives me a 500 server error. I just used this tool, so I am wondering what I might be doing wrong?
Thanks!
Try changing the .htpasswd to use the full path starting from / and using this tool instead: http://www.askapache.com/online-tools/htpasswd-generator/
AuthType Basic
AuthName "My Protected Area"
AuthUserFile /var/www/public_html/full/path/to/.htpasswd
Require valid-user
Satisfy All
Otherwise it sounds like the error is being caused by some other issue. Likely 1 of 2:
The permissions on the .htaccess or .htpasswd file are bad
There is some other error like a rewrite or something in a .htaccess or php error
You need to cause this error to happen again, and then view your /var/log/httpd/error_log file (or named something similar) which will tell you the reason for the 500 error.

htaccess file protecting but no pass prompt

Hi I have the following in a .htaccess file:
AuthType Basic
AuthName "restricted area"
AuthUserFile /web/clients/.htpasswd
require valid-user
this works in making the directory private, however I get a 403 error and no password/user pop up appears to even give me the chance? Any ideas as to what I am doing wrong, both htaccess and htpasswd are together in the directory I want to protect.
Thanks

Directory authentication not working

This is my htaccess file in the directory /home/domain.nl/public_html/helpdesk
Require user agent8 agent9 agent10
AuthType Basic
AuthName this_protected_area
AuthUserFile /home/domain.nl/public_html/.htpasswd
But when I go to domain.nl/helpdesk I got a 324 error (ERR_EMPTY_RESPONSE). So whats wrong? I'm sure the htpasswd file is on the correct location.
In the error logs I see this error:
(13)Permission denied: Couldn't read /home/domain.nl/public_html/errors/.htaccess, closing connection.
Try changing your .htaccess with this:
Require valid-user
AuthType Basic
AuthName this_protected_area
AuthUserFile /home/domain.nl/public_html/.htpasswd
Make sure .htaccess is enabled and if that doesn't work pls copy/paste relevant section of your error.log file in your question.
I renamed the public_html/errors/ dirrectory to errors2 and its working now. Thanks for helping!

Resources