Password Protected Directories Issue

Discussion in 'Install/Configuration' started by MikeDVB, Nov 5, 2009.

  1. MikeDVB

    MikeDVB Well-Known Member

    On a new server I just copied over an account that has a few password protected directories and they've quit working.

    I deleted the .htaccess and .htpasswd files and recreated them and it's still not letting anybody log in.

    I created a brand new account and created a password protected directory and I'm still getting the same issue. username is test and password is test - you can verify this.

    Any suggestions?
  2. mistwang

    mistwang LiteSpeed Staff

    Can you double check that the user that Apache run as can access the password file?

    sudo -u nobody cat <path_to_.htpasswd>
  3. MikeDVB

    MikeDVB Well-Known Member

    Excellent - it seems the script we run to fix home directory permissions set it to user.user for .htpasswds when it needed to be user.nobody - modified the script and re-running it now to resolve all of these issues.

    Thank you so much.
  4. MikeDVB

    MikeDVB Well-Known Member

    Just in case anybody needs this in the future on a cPanel server:
    for user in `/bin/ls /var/cpanel/users`; do
            echo "Fixing permissions for account: ${user}"
            chown -R ${user}.${user} /home/${user}
            chown ${user}.nobody /home/${user}/public_html
            chown -R ${user}.mail /home/${user}/etc
            chown ${user}.nobody /home/${user}/.htpasswds/
    Add this in and then set it to chmod 755 and run "sh" :)

Share This Page