Results 1 to 2 of 2
  1. #1

    Exclamation Problem with suexec + fastcgi + htaccess / htpasswd + virtual host

    I'm having difficulty getting apache to require authentication using .htaccess for a virtual host with the directory any deeper than one level.

    Setup: Apache SuExec, FastCGI

    relevant .htaccess lines:

    AuthType Basic
    AuthName "realm"
    AuthUserFile "ABS PATH TO /.htpasswd"
    require valid-user


    .htaccess 'require valid-user' works fine on the top level directory. (I get a password prompt when the relevant lines are in .htaccess)

    .htaccess 'require valid-user' breaks in the 2nd level directory, but when I remove the 'require valid-user' line, I can access the proper files under the 2nd level directory just fine.. So I know it's reading the .htaccess file...


    Any ideas? TIA

    (EDIT: I'm also not seeing any errors in the apache logs... owner of all files and directories is the proper user, and they are mode: 755)
    Last edited by amaltemara; 03-26-2011 at 11:40 PM. Reason: more info

  2. #2

    Question .htaccess / .htpasswd

    .htaccess of the top level directory:
    <<
    # For security reasons, Option followsymlinks cannot be overridden.
    #Options +FollowSymlinks
    Options +SymLinksIfOwnerMatch
    RewriteEngine On
    RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    # THIS WORKS
    AuthType Basic
    AuthName "realm"
    AuthUserFile "PATH-TO-HTPASSWD-IN-2ND-LEVEL-DIR/.htpasswd"
    require valid-user
    >>


    .htaccess of the 2nd level directory:
    <<
    # THIS DOESN'T WORK, I'M NEVER PROMPTED FOR A PASSWORD
    AuthType Basic
    AuthName "realm"
    AuthUserFile "PATH-TO-HTPASSWD-IN-2ND-LEVEL-DIR/.htpasswd"
    require valid-user
    >>
    Last edited by amaltemara; 03-26-2011 at 11:46 PM. Reason: remove personal info

Similar Threads

  1. compiling apache with php/suexec/fpm/fastcgi?
    By W0rld in forum Hosting Security and Technology
    Replies: 2
    Last Post: 07-23-2010, 01:37 AM
  2. FastCGI problems (apache 2.2, php 5.1, suexec)
    By Xia in forum Hosting Security and Technology
    Replies: 0
    Last Post: 12-17-2008, 01:05 PM
  3. Virtual Hosting + Apache + SuExec problem
    By Rclark in forum Hosting Security and Technology
    Replies: 8
    Last Post: 05-01-2005, 03:13 AM
  4. htaccess/htpasswd problem
    By ColoCenter in forum Dedicated Server
    Replies: 22
    Last Post: 10-05-2001, 01:05 AM

Posting Permissions

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