Find the answer to your Linux question:
Results 1 to 5 of 5
I am running RH Linux 8.0, Apache, and trying to make one of the pages on my website password-protected. Found some tutorials online, followed procedures but with no luck. Page ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2003
    Posts
    3

    Help needed to password-protect a website .htaccess


    I am running RH Linux 8.0, Apache, and trying to make one of the pages on my website password-protected. Found some tutorials online, followed procedures but with no luck. Page is still accessible by everyone.

    /home/user/.htpasswd is readable by everyone
    /home/user is executable by everyone
    /home/user/www/secret/ is executable by everyone and has index.html in it

    /home/user/www/secret/.htaccess

    Code:
    AuthUserFile /home/user/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Private Porn Stash"
    AuthType Basic
    require valid-user
    /etc/httpd/conf/httpd.conf

    Code:
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    #
    AllowOverride All
    and I also restarted httpd after making changes to /etc/httpd/conf/httpd.conf


    Any help is appreciated.

  2. #2
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    My own suggestion is get everything working properly first before changing defualy settings and directory structures. i.e get your site so working and the part with basic auth up before doing anything else.

    Then make one change at a time, restarting apache with each change so if there are any errors its obvious that is was what ever you just did.

    You may not need it but look over but see http://www.apacheweek.com/features/userauth for basics on basic auth or google the terms "basic authentication apache" for more sites on it.
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  3. #3
    Just Joined!
    Join Date
    Dec 2003
    Posts
    3
    Quote Originally Posted by flw
    My own suggestion is get everything working properly first before changing defualy settings and directory structures. i.e get your site so working and the part with basic auth up before doing anything else.
    I don't follow, my site is working and has been up for quite some time.

    Quote Originally Posted by flw
    ]Then make one change at a time, restarting apache with each change so if there are any errors its obvious that is was what ever you just did.
    The only change I made was to change None to All in that one line of /etc/httpd/conf/httpd.conf

    I am missing something. And it is not one of the things in my original post. So my question is: "What are some other variables that go into password-protection aside from things I mentioned in my original post?"

    Thanks

  4. $spacer_open
    $spacer_close
  5. #4
    flw
    flw is offline
    Linux Engineer
    Join Date
    Mar 2003
    Location
    U.S.A.
    Posts
    1,025
    Do you read any of url I listed for you or google the terms I suggested?

    If so what did you find out?
    Dan

    \"Keep your friends close and your enemies even closer\" from The Art of War by Sun Tzu\"

  6. #5
    Just Joined!
    Join Date
    Dec 2003
    Posts
    3
    I figured it out. The following lines should be added to/uncommented in httpd.conf

    Code:
    <Directory /home/*/www>
        AllowOverride All
    </Directory>
    I found that out by reading httpd.conf. I am surprised that not a single tutorial I found mentioned this.

Posting Permissions

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