Htaccess are viewable and downloadable in my vps

Discussion in 'Security' started by drakul, Oct 13, 2008.

  1. #1
    If I enable Directory index to browse folder in my website without index file, the htaccess file are viewable and downloadable. Why htaccess are viewable ? If I disable directory index, it it not viewable but still can be downloaded. Example, go to http://www.filewebload.com/download/.htaccess .

    I'm using Lxadmin with lighttp
     
    drakul, Oct 13, 2008 IP
  2. xxXXMULLIGANXXxx

    xxXXMULLIGANXXxx Guest

    Messages:
    187
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rewrite the permissions chmod it so you only the server can view it so chmod it to 700
     
    xxXXMULLIGANXXxx, Oct 13, 2008 IP
  3. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My Apache conf files has these lines that prevent access:
    
    #
    # AccessFileName: The name of the file to look for in each directory
    # for access control information.
    #
    AccessFileName .htaccess
    
    #
    # The following lines prevent .htaccess files from being viewed by
    # Web clients.  Since .htaccess files often contain authorization
    # information, access is disallowed for security reasons.  Comment
    # these lines out if you want Web visitors to see the contents of
    # .htaccess files.  If you change the AccessFileName directive above,
    # be sure to make the corresponding changes here.
    #
    # Also, folks tend to use names such as .htpasswd for password
    # files, so this will protect those as well.
    #
    <Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
        Order allow,deny
        Deny from all
        Satisfy All
    </Files>
    
    Code (markup):
    But a lot of that is because I am on a Mac.

    On Linux or Unix you could change the <Files line to this instead:
    <Files ~ "^\.ht">
    Code (markup):
     
    Ladadadada, Oct 14, 2008 IP
  4. drakul

    drakul Active Member

    Messages:
    456
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Lighttpd cause that. I switch to apache everything solved.
     
    drakul, Oct 19, 2008 IP
  5. DDHS Bob

    DDHS Bob Banned

    Messages:
    12
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, lighttpd has minimal support for .htaccess and other things such as rewrite rules etc
     
    DDHS Bob, Oct 19, 2008 IP
  6. Mxhub

    Mxhub Active Member

    Messages:
    474
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #6
    your mod_rewrite code doesn't work under lighttpd.. that's why the download happen..

    --
    joseph
     
    Mxhub, Oct 19, 2008 IP