Solved

.htaccess protection won't accept my password

Posted on 2011-09-19
9
338 Views
Last Modified: 2012-08-13
I followed these instructions exactly to protect a folder on my website:
http://www.elated.com/articles/password-protecting-your-pages-with-htaccess/

When trying to access a file within that folder via my browser, I am prompted for username and password but the username and password I chose does not work.

How do I fix this?
0
Comment
Question by:lukeprog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 9

Expert Comment

by:parparov
ID: 36563640
Is your AuthUserFile pointing to a correct passwd file?
Is this passwd file readable by apache?

If you can paste here:
* .htaccess contents
* passwd file contents
* passwd file permissions

that may prove helpful.
0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36563644
Paste your .htaccess file please.
0
 

Author Comment

by:lukeprog
ID: 36563691
.htaccess:

AuthUserFile /domains/lukeprog.com/html/Friendly-AI.com/.htpasswd
AuthType Basic
AuthName "My Secret Folder"
Require valid-user

Open in new window


.htpasswd:

gogogo:UZQy3VXatVBHE

Open in new window


(I'll change the username and password later; not a big deal.)

Permissions on both files are currently 777.

Web page is:
http://lukeprog.com/Friendly-AI.com/index.html

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:parparov
ID: 36563813
You need to "AllowOverride AuthConfig" in your apache configuration for this protected directory. And restart apache after this modification.

And if you don't mind, what was the original password? What we see is the encrypted version.

You may also have the error message in your apache error log.
0
 

Author Comment

by:lukeprog
ID: 36563834
Original password is:

turing

Open in new window


What do I do in the Apache configuration? Not sure where that is. Does this screenshot give you any guesses?
Screen-Shot-2011-09-19-at-3.19.5.png
0
 
LVL 9

Expert Comment

by:parparov
ID: 36563937
Oh, you're running on a hosting.

I am not familiar enough with panels of hosting services; you may find it easier to ask the hosting provider about the issue. Sometimes the hosting providers have explicit instructions on .htaccess setup.
0
 
LVL 6

Accepted Solution

by:
jjperezaguinaga earned 500 total points
ID: 36570294
Greetings lukeprog,

Try to set up your .htaccess options in the following order:

AuthName
AuthType
AuthUserFile
Require valid-user

Also, I'm pretty sure your AuthUserFile is wrong, as you include a .com in the path where an absolute path your file should be provided. For instance, my path is something like this

/home/content/a/b/c/albocar/.htpasswd

and my sites are on

/home/content/a/b/c/albocar/html/_sites/site1
/home/content/a/b/c/albocar/html/_sites/site2/.htacess (protected site)

What worked for me is that I put the .htpasswd in the root file of my web server, (the first directory that appears when you FTP your account) and copied the absolute path from the ftp path. If you need help to know what's your absolute path, you can get a FTP client such as FileZilla or ask your hosting provider for help.

Best regards,
-JJ
0
 
LVL 13

Expert Comment

by:LinuxGuru
ID: 36592093
Could you let me know the name of your hosting control panel? Is it Plesk panel or Direct admin or something like that? From the screenshot I'm unable to determine the name of your hosting control panel.
0
 

Author Closing Comment

by:lukeprog
ID: 36593135
Thanks!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question