|
发表于 2005-10-24 08:37:53
|
显示全部楼层
I did the same test and it works fine.
1. Which page did you see when you say "都可以通过"? If you see the "Red Hat Enterprise Linux TEST PAGE", it means it is blocked, which means it is working. Don't expected the "forbidden" page. Did you place your own index.html file under /var/www/html? If you see your own index.html, it means it is not blocked.
2. It doesn't matter the order is "allow, deny" or "deny, allow". Both are working fine, just you need to think of the logic. yongjian has explained the logic before. He is right.
Here is some of my tests.
Order allow, deny
1. allow from 192.168.0.3 --> only .0.3 will be allowed
2. deny from 192.168.0.3 --> only .0.3 will be denied
3. allow from all --> all will be allowed
4. deny from all --> all will be denied
5. allow from all, but deny from 192.168.0.3 --> only .0.3 will be denied
6. allow from 192.168.0.3, but deny from all --> all will be denied
(The last one is very interesting. As long as you deny all, anything you have allowed will be denied too).
Order deny, allow
1. allow from 192.168.0.3 --> only .0.3 will be allowed
2. deny from 192.168.0.3 --> only .0.3 will be denied
3. allow from all --> all will be allowed
4. deny from all --> all will be denied
5. allow from all, but deny from 192.168.0.3 --> all will be allowed
6. allow from 192.168.0.3, but deny from all --> only .0.3 allowed
They all make sense to me (I love this allow and deny logic, better than that in hosts.allow and hosts.deny, which, in my opinion, is very easy to make error).
Also you can tell the order "allow, deny" or "deny, allow" doesnot matter if you have only one statement (the first 4 tests in each order). The order only matters when you have both allow and deny statement (the last 2 tests in each order). And you can see the result is different when order is different even statement is the same.... |
|