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

lieb39

Apple lover, PC User
Joined
27 Nov 2002
Messages
526
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?
 
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.
 
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?
 
Try:
C:\Program Files\Apache Group\Apache\bin>htpasswd -c c:\password\passfile lieb39
 
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?:(
 
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 profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back