?
Solved

blocking access

Posted on 2003-03-15
5
Medium Priority
?
183 Views
Last Modified: 2010-03-04
I want to block access from all IP's in the 68.52.0.0 subnetwork.  A bunch of people on that part of the network keep trying the Nimda virus on my server, and its just filling up my logs.  But when I put:

    Order deny,allow
    deny from 68.52
    Allow from all

under the Directory directive for the server directory, its not working because they aren't trying to access that directory.  How can I keep the server from doing anything regarding the 68.52.0.0 subnetwork?  I do not know what the subnet mask is.

Thanks

Jason D
0
Comment
Question by:yodaj007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 15

Expert Comment

by:samri
ID: 8146758
Hi Jason,

How about using Location or LocationMatch directive.

http://httpd.apache.org//docs/mod/core.html#location
http://httpd.apache.org//docs/mod/core.html#locationmatch
--
<Location /*>  
   Order deny,allow
   deny from 68.52
   Allow from all
</Location>
--

However, you might have other directives - Directory, or Files that might allow connection from those IP address.

Check out how sections are merged - http://httpd.apache.org//docs/sections.html

The order of merging is:

   1.<Directory> (except regular expressions) and .htaccess done simultaneously (with .htaccess, if allowed, overriding <Directory>)
   2.<DirectoryMatch>, and <Directory> with regular expressions
   3.<Files> and <FilesMatch> done simultaneously
   4.<Location> and <LocationMatch> done simultaneously

So by using Location/LocationMatch, you would be safe.
0
 

Author Comment

by:yodaj007
ID: 8152890
Thanks.  I've implemented that.  When I see that it solves my problem, I'll set your comment to an answer.  Thanks again.

Jason D.
0
 
LVL 15

Accepted Solution

by:
samri earned 240 total points
ID: 8153079
Sure Jason.

Btw, you could test by adding, a 2nd Deny line.

Deny your-ip

Btw, I just noticed that the "deny" directive.  Try to use "Deny" -- notice the Uppercase "D". Some typo.

and try to do something like http://yourserver/anything, and see if you get a 403 error (Forbidden).

cheers.
0
 

Author Comment

by:yodaj007
ID: 8154788
Here are the directives from my config file.  You've helped me successfully deny everything from the 68.52 domain *that isn't referencing my homepage*.  Thats exactly what I wanted.  But for some reason I can't block myself from my own homepage as you suggested.  I've increased the points to 60 and I'm accepting your answer.  If you can tell me how to block access to my homepage, I can't thank you enough.  But its not necessary.

Jason D.



<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from localhost
    Deny from 192.168.1.102
    Allow from all
</Directory>

<Location /*>  
  Order deny,allow
  Deny from 68.52
  Allow from all
</Location>
0
 
LVL 15

Expert Comment

by:samri
ID: 8157392
Sure.  Thanks a lot.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question