[solved] Apache2 > "order allow,deny" to allow subdirectories
Hello,
I want to restrict my web root and allow some subdirectories like /public/, with apache2. From http://httpd.apache.org/docs/2.2/mod...html#directory : Code:
Note that the default Apache access for <Directory /> is Allow from All. The following is not working, I've no access at / nor /public/ ("client denied by server configuration: /var/www/public/"). Code:
DocumentRoot /var/www/ Code:
DocumentRoot /var/www/ |
Directory / - refers to your file-system's root, not the web-root.
So what you're saying is, the web-server cannot access the root of the file-system and anything under it - /. Then what you have is another directive saying: Code:
<Directory /var/www> The <Directory /var/www> overrides the safe guard on / to allow public HTML to be served. On my server, I have: Code:
<Directory /> |
Thanks a lot, I understand my mistake now : I was thinking that the DocumentRoot directive was prepended to the path in the <Directory> ones.
|
<Directory>
yo you there?Dear
Seeing your problem definition i looked into my httpd.conf file running on Fedora 5 saw <Directory /> Options FollowSymLinks AllowOverride All </Directory> Nothing like Allow from All Would u plz describe me what are AllowOverride All and OPtions FolllowSymLikns means. Thanking You Subrun |
What I realized
yo you there?On my server, I have:
Code: <Directory /> Order deny,allow Deny fromall </Directory> <Directory /var/www/*> Order allow,deny allow from all </Directory> so anything under /var/www is allowed to be served by the web-server.----------------------------------above statement means that /, which is the root file-system of a linux system there(on /) no access will be given. And any directory afterwards /var/www/* will get access to serve html pages. Is it right plz say as I am conceptually very weak in Apache. Plz say my assumtion is right or wrong. |
Quote:
About AllowOverride, I don't use it but you can find the documentation here : http://httpd.apache.org/docs/2.2/mod...#allowoverride. About FollowSymLinks, this is an option that allows the server to follow symbolic links on the filesystem. You can also find the definition here : http://httpd.apache.org/docs/2.2/mod/core.html#options |
Yes, you're correct.
This is so people cannot try and use Apache to serve files it shouldn't. The "Order allow,deny", "allow from all", "deny from all" are security options to restrict access to certain files/folders based on IP addresses and domain name. "all" is a synonym for "everybody." So saying: Order allow,deny deny from all means no-one is allowed to see the content in the given directory. I'd check out the default httpd.conf file and the Apache documentation, as you really should be denying access to anything but the Apache www directory. As a polite side-note, "yo you there? Dear" is not a great way to greet people in English. "Hi" will simply do fine. |
Sorry
yo you there?Dear
Thank u for your mail . But I am sorry for extra strings which is automatically going with every messages. |
LOL, What is it ? A plugin for Firefox ?
|
I have the same question but i want to restrict access to a particular page in the website based on the domain.
I tried changing the <Directory ...> directive but in vain. Could you guys help me out in this regard. Have been stuck in this for a very long time. Thanks Sandesh |
For files, you should look at the <Files> directive.
|
Restricting by domain is not always reliable, as it uses a reverse lookup on the client's IP address. "Dynamic" IP addresses such as that of dial-up and ADSL providers will resolve to that of the ISP, whatever the forward-lookup of a domain resolves to.
|
I want to actually allow access to a $$$$$$.html page for users from only a certain domain, and want to deny all other users.Now i think i have made it more clear.
Regards Sandesh |
Try something like this (change the parameters in bold) :
Code:
<Directory /var/www/yourdirectory/> |
All times are GMT -5. The time now is 06:57 PM. |