Fixed: User/Pass With apache? or 3rd party?

lieb39

Apple lover, PC User
#1
Hello.

I am wondering if it is possible in apache to edit the conf file so that for a certain directory (lets say http://localhost/private/ ) requires a password and a username, which is also stored in apache? Or even perhaps a sql table? I have seen this been used a lot, even on apache server. How would I go about setting this up?
 
#2
One way is to set Per Directory Options in the config file. Another way is to place a .htaccess file in the directory itself. There is info on how to do this on the Apache website and many other places throughout the Internet.
 

lieb39

Apple lover, PC User
#4
Hmm I am trying to figure out how to use this command on windows... htpasswd -c /usr/local/apache/passwd/passwords username
I tried doing this but it says that;
C:\Program Files\Apache Group\Apache\bin>htpasswd c:\password\ lieb39
Automatically using MD5 format on Windows.
htpasswd: cannot modify file c:\password\; use '-c' to create it
fopen: No such file or directory

SO what do I do now?
 

lieb39

Apple lover, PC User
#6
Yay! I made a password file! Now I was reading the version 2 of apache's documents (I am running version 2...) and it said to create a file called ".htaccess" in the folder you wish to password protect. This is just a plain text file, with the following infomation in it (by the way, my password file is stored in "C:\program files\apache group\apache2\bin\passwd. " ;

AuthType Basic
AuthName "Resticted Files"
AuthUserFile
C:\program files\apache group\apache2\bin\passwd
require user dlieb

; btw, i tried doing the location (c:\program files\..) in DOS format, in quotes, and like that.

And when i go to that directory i just put this file in (http://localhost/private/) I just get the index.html page. Nothing pops up. What is wrong?

I got all this infomation above from Apache Document v.2 (Direct link)

Can anyone help me?:(
 

lieb39

Apple lover, PC User
#7
Fixed!

Hello. I have fixed my problem after about 3 hours of troubleshooting it. I deleted apache 1.3 and installed the new apache, v.2. And did anyone know by default Apache blocks out .htaccess files. It simply ignores them. To fix this problem goto your httpd.conf file, look for this;
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None

And chanage the None to All, so it looks like this;
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All

Restart your sever, make sure your .htaccess file is in your directory, make sure your .htpasswd file is in there too and your .htaccess file is pointing to that file.

All Done. Thanks Google!:rolleyes: :)
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,971
Messages
673,299
Members
89,016
Latest member
Poseeut