The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

web protect

Discussion in 'General Discussion' started by Alfarin, Jun 25, 2005.

  1. Alfarin

    Alfarin Member

    Joined:
    Feb 22, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Hi;
    I have a directory outside of my home directory that I would like to setup with htaccess protect. Currently, because of certain restrictions, this directory is located outside of my home directory.

    IE: current configuration:
    directory: /usr/local/alfarin/data/
    link: /home/alfarin/public_html/data/
    link via: ln -s /usr/local/alfarin/data/ data

    I tried to use web protect feature on this directory via the web interface and it doesn't seem to work. Is there a way I can set it up so that I can put password on this directory? or am I just stuck with blank index.html in it as well as all of its sub directories?

    Thanks
     
  2. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    cd /usr/local/alfarin/data/

    vi .htaccess

    AuthName "Password Protected"
    AuthType Basic
    AuthUserFile "/usr/local/alfarin/data/.htpasswd"
    Require valid-user


    /usr/local/apache/bin/htpasswd -c /usr/local/alfarin/data/.htpasswd <username you want>

    the htpasswd will prompt you for the password
     
  3. Alfarin

    Alfarin Member

    Joined:
    Feb 22, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Thanks, that worked like a charm :D
     
  4. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    your welcome
     
Loading...

Share This Page