.htaccess password protecting folders.

Discussion in 'Ruby/Rails' started by nathanc, Nov 15, 2007.

  1. nathanc

    nathanc Well-Known Member

    I have a rails site running on 3.2.4 Enterprise.
    I am trying to protect a sub folder under public called "protected"

    Server settings for htaccess
    Allow Override: X Auth
    Access File Name .htaccess

    I understand the htaccess chain of command "Server > Vhost > context"

    Vhost template and rails context settings for htaccess are not set. This is suppose to default back to the server settings I have above.

    This is my .htaccess file

    AuthName "Name of Password Protected Area"
    AuthType Basic
    AuthUserFile /PATH/TO/.htpasswd
    Require valid-user

    For some reason its not asking for a password.
    Any suggestions?
    Last edited: Nov 15, 2007
  2. mistwang

    mistwang LiteSpeed Staff

    You can try it on test server with debug logging if you can. If the .htaccess file was loaded, it should show in the error.log.
    And make sure to clear you browser cache in case the page was cached.
  3. nathanc

    nathanc Well-Known Member

    I figured out the issue.
    These settings have to be set for Server, Vhost and context explictly.
    Allow Override: X Auth
    Access File Name .htaccess
    chain of command seems to be broken.
    I have tested on 3 servers.
  4. mistwang

    mistwang LiteSpeed Staff

    How about set at vhost only? The server level configuration should be served as the default. We will verify that.

Share This Page