• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Password Protection Not working

A

aviscat

Guest
I have been using .htaccess and .htpasswd and have't changed the files at all when moving to my new Plesk 7.5.4 controlled server. The prompt for user name and password comes up and I know I am using the correct one but it won't accept it. Please help me. I need to get this workinfg as I am moving an osCommerce shopping cart to this server this week. Have it set up on another domain for testing purposes. This did work when I tested it on a different shared hosting.
 
I would suggest looking at the path in you .htaccess file. If you have the full path listed in the file, and this is a new install of 7.5.4 the path to the webdirectory has changed. Instead of /home/httpd/vhosts/domain.com/httpdocs, it may now be /var/www//vhosts /domain.com/httpdocs. If that doesn't appear to be the problem, please post the contents of the .htaccess file , it may help troubleshoot the issue.
 
I would suggest looking at the path in you .htaccess file. If you have the full path listed in the file, and this is a new install of 7.5.4 the path to the webdirectory has changed. Instead of /home/httpd/vhosts/domain.com/httpdocs, it may now be /var/www//vhosts /domain.com/httpdocs.

Thanks. I know I tried this earlier today but now it works. I can rest easy. Whew!!! I changed it back to /var/www/vhosts /domain.com/httpdocs and now I have what I need.
 
Thanks. I know I tried this earlier today but now it works. I can rest easy. Whew!!! I changed it back to /var/www/vhosts /domain.com/httpdocs and now I have what I need.

I typed too soon. Now I am in an endless loop of entering the password and for some reason the screen isn't formatting like it should. Yes I uploaded the CSS file in ASCII. The catalog works fine. The admin doesn't.
 
Please let me know, because after a restore (and change in directory structure), my password protected directories loop too. I fixed the directory path, but still no luck...

--.htaccess--

AuthType Basic
AuthName "Alumni Email System"
AuthUserFile /var/www/vhosts/XYZ.org/httpdocs/alumni/email/.htpasswd
Require user XXX

----------------

UPDATE: Found solution in another thread [thread link]
In order to do the htpasswd, you need to use the psa one:
/usr/local/psa/admin/bin/htpasswd -c .htpasswd

Fixed it for me!
 
Originally posted by criticman

UPDATE: Found solution in another thread [thread link]
In order to do the htpasswd, you need to use the psa one:
/usr/local/psa/admin/bin/htpasswd -c .htpasswd

Fixed it for me!

I am very new at this. Can you give me step by step instructions or maybe we could chat via a messenger program?
 
Go in to the directory you want to password protect. We will pretend you have a client somedomain.com and the hosting path is:
/var/www/vhosts/somedomain.com/httpdocs

If you have pico (which if you are new, I recommend it as it is easier to pick up and use than vi - is like Windows Notepad),
pico .htaccess

Put the following in that file:
AuthType Basic
AuthName "MESSAGE YOU WANT USER TO SEE WHEN ASKED FOR USERNAME AND PASSWORD"
AuthUserFile /var/www/vhosts/somedomain.com/httpdocs/.htpasswd
Require user USERNAMEFORDIRECTORYLOGIN


Save that and close your text editor. While back at the command line,
/usr/local/psa/admin/bin/htpasswd -c .htpasswd USERNAMEFORDIRECTORYLOGIN

It will prompt you for the desired password, enter it, hit [ENTER], it will ask to confirm, enter it again, hit [ENTER].

Restart apache,
/etc/init.d/httpd restart

And try loading the web page. It should all work then.
 
Back
Top