Forum Moderators: phranque
I was going through and changing the UNIX CHMOD for all the directories on our site to 771 so that users could not see our folder structure... but I have encountered a problem with some other web software that needs to have directory level read access to operate properly so I need to have the CHMOD set to 775 which opens everything up again. SO...
I was told to go into apache and change the Directory tag to limit the access to folders...
This is what I am planning on using:
<Directory />
Order Deny,Allow
Deny from All
Allow from #*$!.#*$!.xxx.xx
</Directory>
Will this do what I want it to do... which is return the users a page like below: (with the exception of that lone IP address listed)
Forbidden
You don't have permission to access /AdDesk/Htmlfiles/Readers/ on this server.
Apache/1.3.27 Server at www.engleonline.com Port 80
Thanks in advance for all input!
N. Lamb
Welcome to WebmasterWorld!
I believe that all you need to do is to set
Options -Indexes
Jim
One follow up question.
Do I need to specify that for every directory or can it be a server wide thing with one rule... and then if for some reason I want to have a specific directory visible I could specify that one to be shown?
Here is the code I plan on using:
<Directory />
Options Indexes
Order Deny,Allow
Deny from All
Allow from #*$!.#*$!.#*$!.xx
</Directory>
Would this do the trick for the entire server? And is the syntax correct?
Thanks,
N. Lamb
Here is my planned code:
<Directory />
Order Deny,Allow
Deny from All
Allow from 111.111.111.11
</Directory>
<Directory /Library/WebServer/Documents>
Options Indexes
</Directory>
And syntax wise this if fine? Cause I have seen some other code that has the directoy name inside of double quotes ("/Library/WebServer/Documents" )
Other than that I believe I am ready to test this out...
Thanks,
N. Lamb
<Directory />
Order Deny,Allow
Deny from All
Allow from 111.111.111.11
</Directory>
<Directory /Library/WebServer/Documents>
Options Indexes
</Directory>
Here is the code I think I am going to try next...
<Directory /Library/WebServer/Documents>
Order Deny,Allow
Deny from All
Allow from 111.111.111.11
</Directory>
<Directory />
Options Indexes
</Directory>
In my way of thinking this should "lock down" the specified folder listed in the first Directory and then the second directory should do the Option Indexes for all of the folders under the root? Is this correct thinking?