|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Ok, I finnaly understood how to do eveything. I added .htaccess with this output...
AuthUserFile /htdocs/db/.htpasswd AuthName "This is a private folder on Chad's Server. Please input name and password." AuthType Basic require valid-user And then I opened the CMD Prompt and went to my apache/bin folder. And I typed in: htpasswd -c .htpasswd chad then it asked for my password, I typed it in, then I confirmed it (typed it again). And when I got to the /db/ folder it asks for my name/pass, I type it in and it says wrong, password? What's wrong? I also tried typing in htpasswd -b -c .htpasswd chad pass and that didn't work either. Does anyone know how to fix this? |
|
#2
|
||||
|
||||
|
It should be
<Limit GET> require user chad </Limit> so as you see you have to mistakes, one you require different user and two you dont have limit. Make sure you moved .htpasswd too
__________________
And you know I mean that. |
|
#3
|
|||
|
|||
|
I did move the .htpasswd and I added the limit thing. It still says incorrect password. Here is my two files.
______________ .htaccess ----------------------- AuthUserFile /htdocs/db/.htpasswd AuthName "This is a private folder on Chad's Server. Please input name and password!" AuthType Basic <Limit GET> require user chad </Limit> -------------------------- .htpasswd -------------------------- chad:$apr1$2T2.....$S08ZBlYYEmp3xyHtaH9ey. -------------------------- And they are both in the /db/ folder. Do you see anything wrong with the code? |
|
#4
|
||||
|
||||
|
Well, last line of .htpasswd should be blank line, but you probably just left it out. Is htdocs really mounted to the root? Try to put full path from root to .htpasswd
|
|
#5
|
|||
|
|||
|
Well this is the full path...
C:\program files\apace group\apache\htdocs\db\.htpasswd I've tried that, taken off C:\, witched \'s with /'s, and anything I put behind /apache group, it gets a 500 error. How would I write out the full path? |
|
#6
|
|||
|
|||
|
Oh, and htdocs is the root directory.
|
|
#7
|
||||
|
||||
|
>>. How would I write out the full path?
double quote it: "C:\program files\apace group\apache\htdocs\db\.htpasswd" >> <Limit GET> >> require user chad >> </Limit> If you do not have special reasons to allow other methods remove the Limit directive, for default all methods are "limited".
__________________
My article: mod_rewrite: No More Endless Loops! Last edited by pippo : February 17th, 2002 at 03:01 AM. |
|
#8
|
|||
|
|||
|
That did the trick, it works now, thanks a lot.
![]() |
|
#9
|
|||
|
|||
|
Uh Oh
I had to reinstall Apache, so I did all the steps above again...
.htaccess file... AuthUserFile "C:\Apace Group\Apache\htdocs\db\.htpasswd" AuthName "This is a private folder" AuthType Basic <Limit GET> require user chad </Limit> and .htpasswd file... chad:$apr1$JT5.....$VnWsyNTSaZi2tXtO.wJ660 they are both in directory /db/ and when I go to that directory it doesn't prompt me for my name and password. I've tried taking off the limit part and that didn't help either. Do you see something wrong with my code? |
|
#10
|
||||
|
||||
|
In .conf file, default value for AllowOverride is none, you should go and set to all (at least for home dev)
edit: forgot to mention it is in <Directory "C:/Apace Group/Apache/htdocs"> .... </Directory> Last edited by AlCapone : February 17th, 2002 at 06:31 PM. |
|
#11
|
|||
|
|||
|
I changed it to All and the it prompted for my name/pass but it kept getting incorrect password, so I created the .htpasswd file again, but now it won't prompt for the name/pass.
|
|
#12
|
|||
|
|||
|
I did however make one change after I installed Apache, I added virtual host. But that wouldn't change anything would it?
|
|
#13
|
|||
|
|||
|
well I somehow figured it outmyself...
I tried putting in a different password and it worked. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Apache .htpasswd login |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|