Jump to content


Photo

.htaccess & .htpasswd


  • Please log in to reply
3 replies to this topic

#1 brittny85

brittny85
  • Members
  • PipPip
  • Member
  • 23 posts
  • LocationUtah

Posted 11 August 2006 - 09:17 PM

I posted a couple days ago because I was trying to implement some passthrough authentication for a directory... but I've become less ambitious and I just want to protect the directory.  I've been trying to learn how to use the .htaccess & .htpasswd method, but I'm supremely confused.  I found a couple different sites that had .htpasswd generators... but each one gave me different results for the same username/password combination.  I tried using a few different variations of the encrypted password but no matter which one I used my server wouldn't authenticate me.  Am I missing something?  My .htaccess file looks like:
AuthUserFile /Theronyx2/careers/resumes/.htpasswd
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic

<limit GET POST>
require valid-user
</limit>

What should my .htpasswd file look like?  I know that the password is supposed to be encrypted, but how do I get the right encrypted password?

Thanks in advance!!
-Brittny

#2 youcantoo

youcantoo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 11 August 2006 - 10:22 PM

Normally I would put this into my httpd.conf file such as

example:
<Directory "/home/members/mandrake-zone/ftp_isos">
AllowOverride AuthConfig
AuthType Basic
AuthName "Mandriva FTP Downloads"
AuthUserFile /path/to/.htpasswd
Require valid-user
</Directory>

if you do not have access to the httpd.conf file that as always it can be put into the .htaccess file using the same info as above.

remove the <limit GET POST></limit>

to create the .htpasswd file, from the command line type in

htpasswd -c /path/to/your/.htpasswd username

Note: the -c is to create a new .htaccess file
username is the name of the user you wish to add
if you already have a .htpasswd file and want to add more users to it use the following
htpasswd /path/to/your/existing/.htpasswd username

or if you are using windows you can use the form found here
http://www.flash.net/cgi-bin/pw.pl

copy the information and save it as .htpasswd
[b]Note/b] your file MUST have the peroid in front of the htpasswd


#3 brittny85

brittny85
  • Members
  • PipPip
  • Member
  • 23 posts
  • LocationUtah

Posted 11 August 2006 - 11:25 PM

Thank you for your help, but I'm still stuck.  I don't have access to the httpd.conf file so it is all in an .htaccess file.  I tried setting up my .htaccess file like you suggested, but that gave me a server error instead of just denying access.  I am working off of a windows machine currently, however once I get this working I will be uploading it to a Linux server.  Will I have to reconfigure the files for each server that the site is on?  I tried using that link to get the right .htpasswd file set up, but it didn't help either.  Sorry, I am trying to figure it out myself, but I can't find anything that tells me what I'm doing wrong.

Thanks again!
-Brittny

#4 youcantoo

youcantoo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 12 August 2006 - 12:18 AM

Thank you for your help, but I'm still stuck.  I don't have access to the httpd.conf file so it is all in an .htaccess file.  I tried setting up my .htaccess file like you suggested, but that gave me a server error instead of just denying access.  I am working off of a windows machine currently, however once I get this working I will be uploading it to a Linux server.  Will I have to reconfigure the files for each server that the site is on?  I tried using that link to get the right .htpasswd file set up, but it didn't help either.  Sorry, I am trying to figure it out myself, but I can't find anything that tells me what I'm doing wrong.

Thanks again!
-Brittny


Sorry to hear that you still have problems.
Can you post the "denying access" error that you were orignally getting? Perhaps it will give me a clue on just how to correct your problem.

Will I have to reconfigure the files for each server that the site is on?  I tried using that link to get the right .htpasswd file set up, but it didn't help either.


no you should not have to reconfigure the file.

that link  http://www.flash.net/cgi-bin/pw.pl

should of asked for a username and the password you wanted for that said user when you press the "encrypt" button it should of returned something in the form

example
atestfile:lfeo8vrSBxJ4.
this would be the part that would go into your .htpasswd file.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users