Mobile app version of vmapp.org
Login or Join
Reiling115

: Apache blocks I'm trying to make it so that the outside world can't access a specific section of my website. What I did was: <Directory /Library/WebServer/.../secrets/> Order deny,allow

@Reiling115

Posted in: #Apache #Directory #HttpdConf #Security

I'm trying to make it so that the outside world can't access a specific section of my website. What I did was:

<Directory /Library/WebServer/.../secrets/>
Order deny,allow
Deny from all
Allow from 10.0.1.18
</Directory>


(10.0.1.18 is my computer's internal IP) That seemed to work for the root folder, but not for subfolders. So I tried secrets/* in the directory block, but that disabled everything. Anyone could access the secrets folder.

How would I make the directory block apply to subfolders?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Reiling115

1 Comments

Sorted by latest first Latest Oldest Best

 

@Goswami781

According to this:


<Directory> and </Directory> are used to enclose a group of directives
that will apply only to the named directory, sub-directories of that
directory, and the files within the respective directories.


So if you omit the trailing slash then this should work:

<Directory /Library/WebServer/.../secrets>


secrets/* means subdirectories and files below the secrets directory, not the directory itself.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme