The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to disable in Apache access to linux hidden files/folders by default?

Discussion in 'General Discussion' started by guillof, Dec 15, 2015.

  1. guillof

    guillof Member

    Joined:
    Jul 30, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    So, I've been do it quite a bit or research, and did some tests, but can't find any real solution.


    My question is, how can I disable access to hidden linux files (with a dot in front), in Apache, without using htaccess?

    I tried adding something like this

    <FilesMatch "^\.">
    Order allow,deny
    Deny from all
    </FilesMatch>

    <DirectoryMatch "^\.|\/\.">
    Order allow,deny
    Deny from all
    </DirectoryMatch>


    to the three Apache includes, but doesn't seems to works.

    Any clue?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you elaborate on which specific include files you added these rules to?

    Thank you.
     
  3. guillof

    guillof Member

    Joined:
    Jul 30, 2014
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Apache configuration -> Include editor.
    Is there any way to add those rules by default in all virtual hosts?
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page