Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache .htaccess error 2

Status
Not open for further replies.

Fitzbean

Programmer
Mar 28, 2002
5
US
[Thu Mar 28 10:19:58 2002] [error] [client 65.167.151.24] (2)No such file or directory: Could not open password file: /c/program files/apache group/apache/users/
[Thu Mar 28 10:19:58 2002] [error] [client 65.167.151.24] user brad not found: /phpmyadmin/

Hi folks, I'm trying to protect the phpmyadmin directory on my server -- and having a heck of a time. Assuming the file is there (the .htpasswd file) and in the correct directory, any idea why I'm getting the above apache errors in the logs when I try to access the directory after entering login/pass?

My .htaccess file has the line:
AuthUserFile "/C/Program Files/Apache Group/Apache/users/"

I put it in quotes cause it causes an internal error with out them for some reason (I suspect the spaces in Program Files and Apache Group) With the quotes it does not get the interal 500 error, but gets the file not found error. Any ideas?

I know this isn't an apache forum, but I don't know of any good ones -- and people here are knowledgable far past the realm of PHP.

Thanks in advance.
 
Hi mate,

The following line

AuthUserFile "/C/Program Files/Apache Group/Apache/users/"

Should be either

AuthUserFile "C:/Program Files/Apache Group/Apache/users/"

OR

AuthUserFile "/Program Files/Apache Group/Apache/users/"

Try putting the full path of the .htaccess

AuthUserFile "/C/Program Files/Apache Group/Apache/users/.htaccess"

Also, to avoid the spaces in the dirs why not put your htaccess in a file such as /htaccess/

So then you would need a path such as

AuthUserFile /htaccess/.htaccess

Saves a lot of hassle this way..

Hope this helps Wullie

 
I thought that the AuthUserFile was supposed to point the .htpasswd file, not the .htaccess file? I suppose this is not the case? Where do I specify the location of the .htpasswd file then?
 
Hmp, it doesnt seem to work at all without the quotes, and with them it says user not found in the logs. I have my .htpasswd in the same dir as the .htaccess file. Is this correct? Thanks in advance, you've already been a help.
 
Sorry,

It should point to the htpasswd file. I was in a hurry when I was typing it..

It should also work without the quotes.

How did you create the htpasswd? If you impotered it from a unix server then that is most likely the problem..

Try to use a unencryped htpasswd to see if that works.

Hope this helps Wullie

 
Thanks Willie, gonna try that now -- I did not import the htpasswd file, I simply used the exe that came with apache. I will try a unencrypted password if it still gives me trouble.

Thanks again!
 
Hi,

The password file is normally called .htpasswd but can be named anything you like as long as its pointed to by AuthUserFile.

You need something like this in yout .htaccess :

AuthName "Test"
AuthType Basic
AuthUserFile "C:\Program Files\Apache Group\Apache\secure\userfile"
require valid-user

... and you must have allowed overrides from the httpd.conf - e.g. in a <Directory> container for that directory :

<Directory &quot;C:/Program Files/Apache Group/Apache/htdocs/secret&quot;>
Options Indexes FollowSymlinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>


On the passwords - make sure you used htpasswd to create the file and add users. For the first one.. :

cd &quot;C:\Program Files\Apache Group\Apache\bin

then do :

htpasswd -cb &quot;C:\Program Files\Apache Group\Apache\secure\userfile&quot; user1 password1

Then for additional users ...

htpasswd -b &quot;C:\Program Files\Apache Group\Apache\secure\userfile&quot; user2 password2
htpasswd -b &quot;C:\Program Files\Apache Group\Apache\secure\userfile&quot; user3 password3


etc.

Hope this helps
 
I got it worked perfectly!

Thanks alot !! You guys are great -- and being one who answers a lot of questions in a PHP forum, i know what it's like to give out help, then never get a thanks or hear from them again.. so thanks alot fellas. Ya saved the day. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top