Help - Search - Members - Calendar
Full Version: htaccess / htpasswd problem
The Planet Forums > Control Panels > Plesk
Seibertron
Alright ... on to my next subject ...

I am running into a major obstacle concerning htpasswd and htaccess. No matter what I do the htaccess file won't recognize the username and password I entered via htpasswd commands in a telnet session.

AuthName "Authorized Access Required"
AuthType Basic
AuthUserFile /home/httpd/vhosts/seibertron.com/users

require valid-user

I've tried just about everthing and several friends of mine have tried helping me as well. The only thing I can think of is it is a *.conf configuration somewhere. I already have AllowOverride All (or whatever it is) set in my httpd.conf file. I have several htaccess files already working on my site, including custom error pages for 401, 503, etc.

Is anyone aware of what I can look for in one of the *.conf files that would be causing this problem? Thanks in advance!
Squire
"users" is the file name you're using instead of the more standard ".htpasswd" to hold your username/password pairs?

If not, you need to put the name of the file in your .htaccess file, not just a directory.

Here's one of manually set up htaccess files for your reference:

order allow,deny
allow from all
require valid-user
Authname "Authorized Access Only"
Authtype Basic
AuthUserFile /home/httpd/vhosts/domain.com/httpdocs/data/.htpasswd

On that one I've created a folder called "data" outside of the web accessible tree and dropped an .htpasswd file into it.

Squire
Seibertron
I tried it with .htpasswd too and had the same results. The file users without an extension was deleted from the server. I'm looking for a setting that would prevent this, I think ...
Squire
Assuming you may not have this enabled...

http://www.plesk.com/Support/faq/psa/apache.htm#q9
Seibertron
QUOTE
Originally posted by Squire
Assuming you may not have this enabled...

http://www.plesk.com/Support/faq/psa/apache.htm#q9


Hm ... when I added this

QUOTE
For the RPM build the following text would need to be added to the /etc/httpd/conf/httpd.conf file:



  Options +All

 AllowOverride

 All Order allow,deny

 Allow from all

 


It wouldn't allow httpd to be restarted so I removed it.
Squire
The above info from Plesk is going to be correct tweak to make in your httpd.conf settings, so that's not the problem. If I had to guess something in one of your vhost.conf files (for individual domain configuration) is keeping Apache from restarting.

Pick a quiet time on your server. Edit your httpd.conf as outlined by Plesk. Try restarting Apache. I suggest using service httpd stop and service httpd start to restart Apache since it will give you more informaiton. Then look in /var/log/messages (tail -200 /var/log/messages) to see what hints it gives you.

I'd be looking at the vhost.conf files before anything else. Because even if everything else is perfect, an error in any one of those will keep Apache from starting correctly.

Squire
Seibertron
Thank you for your help so far squire. I will take a shot at this later today. Should I also shut down mysqld and httpd first?
Seibertron
For anyone who is experiencing problems with this, I finally figured it out this week. I didn't know that I had to be telnetted in as the user who is chown'ed the files/directories on the server where i wanted to set up an .htaccess file. Once I logged in as the correct user (the owner of the website's files and directories) this worked like a charm. I'm surprised no one mentioned this to me. I thought I had to be logged in as root to do this.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.