I don't have access to the httpd.conf (the ISP configures this). The ISP does say that the .htaccess method works, so I assume that means that AllowOverride contains AuthConfig in the httpd.conf.
Main Topics
Browse All TopicsI am trying to setup a secure area on our commercially hosted web site via .htaccess. The ISP says this is supposed to work, but I have not had success. The .htaccess file is being read because I am being prompted for user name and password. However, I cannot get into the directory. Error logs say "No such file or directory: Could not open password file: /www/.htpasswd"
As an ISP customer, I do not have access (read or write) to httpd.conf. When I connect via ftp, my current directory is /www. In that directory, I have a .htpasswd file. I have a subdirectory 'secureaccess' in www (/www/secureaccess). In /www/secureacess/ , I have a .htaccess file.
My .htpasswd file is:
joe:encryptedyaddayadda
bob:encryptedwhatever
My .htaccess file is:
AuthType Basic
AuthName "Password Required -- "
AuthUserFile /www/.htpasswd
require valid-user
I have wide-opened the permissions on .htaccess and .htpasswd and the directory /secureaccess/.
The ISP tech support says that /www is the root that I should use. (From /www, however, I can cd.. all the way back to:
/usr/local/ft_apache/www ).
I've tried every path I can think of, but am apparently still not seeing the .htpasswd file.
Any suggestions/comments are appreciated
Chuck
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hi Chuck,
Try to use
AuthUserFile .htpasswd
and check the error message. By right by not using absolute path (one with / prefix), the file will be treated as coming from ServerRoot (http://httpd.apache.org/d
another approach would be asking the ISP on the actual path (since they might be running apache and even ftp in chrooted env - where the path you see is not the path that the OS/apps is seeing.).
Have you tried AuthUSerFile /usr/local/ft_apache/www/.
Check the permission on www itself. Makesure it is readable by apache.
hi jesterepsilon,
Based on the error: Error logs say "No such file or directory: Could not open password file: /www/.htpasswd"
it may be possible that apache could not find the file. try to rename the file to something else (.oldhtpasswd maybe), and check the error. I would think that it would still be the same.
How about the permission on /www? is it readable by others ?
AuthUserFile .htpasswd returns --
/usr/local/fp_apache/.htpa
in the error log
AuthUserFile /usr/local/ft_apache/www/.
/usr/local/ft_apache/www/.
in the error log
AuthUserFile /www/.htpasswd returns --
/www/.htpasswd
in the error log
Changing the file name and the reference to it in AuthUserFile returns the same error msg (except with the new file name)
Ho hum...
I'm suprised u can CD all the way back there... it's a bit of a security risk on the part of your ISP :O
But anyway, just to make sure of your location, try this:
Create a file called test.php containing this line of code:
<?php echo $_SERVER['DOCUMENT_ROOT'];
And put it in the same directory as your .htpasswd file.
Browse to this file, take the output and stick "/.htpasswd" on the end. That is where it should map to.
Also, make sure there are no blank lines in your .htpasswd file (take extra care at the end of the file) as this screws things up too.
Hope it works out for ya :D
Business Accounts
Answer for Membership
by: ahoffmannPosted on 2003-12-03 at 14:23:03ID: 9870372
does your AllowOverride contain AuthConfig in httpd.conf?