Find the answer to your Linux question:
Results 1 to 2 of 2
recently one of my friend ask me to protect come directory on his web page actually i ser like this AllowOverride none (some of documents suggest AuthConfig) ## this on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2004
    Location
    Indonesia
    Posts
    84

    htpasswd on virtual host (Apache 1.3)


    recently one of my friend ask me to protect come directory on his web page

    actually i ser like this

    AllowOverride none (some of documents suggest AuthConfig)

    ## this on my friend setting for his virtual host #####

    DocumentRoot /home/ryan/public_html
    ServerName www.ryandirektori.com ### this only sample #####
    <Directory "/home/ryan/public_html/secret_page">
    deny from all
    AllowOverride AuthConfig
    Order deny,allow
    </Directory>


    i just want to ask, is it any difference with some HTML, PHP, CGI scripts to protect on his virtual host setting ?

    i do right ?

  2. #2
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    158
    Hi,

    Try this instead...

    <Directory "/home/ryan/public_html/secret_page">
    AuthType Basic
    AuthName "Restricted area!"
    AuthUserFile /etc/httpd/passwd/passwdfile
    Require valid-user
    </Directory>


    To create the password file do
    htpasswd -c -n /etc/httpd/passwd/passwdfile <username>
    Restart your server and you should be OK.

    Cheers

    Jonas
    --
    in Linux Computing we Trust

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •