Need help blocking specific country in kloxo Lighttpd

Discussion in 'Site & Server Administration' started by Chuman, Aug 12, 2011.

  1. #1
    I have been googling with no proper results, I want to block specific country from accessing my site, .htaccess is not supported by lighttpd. Kindly help me regarding this matter.
     
    Chuman, Aug 12, 2011 IP
  2. lachrymologist

    lachrymologist Active Member

    Messages:
    456
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    70
    #2
    you can do that thru rewriting option:
      # deny the access to www.example.org to all user which 
      # are not in the 10.0.0.0/8 network
      $HTTP["host"] == "www.example.org" {
        $HTTP["remoteip"] != "10.0.0.0/8" {
         url.access-deny = ( "" )
        }
      }
    Code (markup):
    find out more here: http://redmine.lighttpd.net/wiki/1/Docs:Configuration
     
    lachrymologist, Aug 12, 2011 IP
  3. Chuman

    Chuman Well-Known Member

    Messages:
    977
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks for providing me the link. Went through the page and it's out of my reach but the code you provided in my opinion will deny access to all user which are not in the 10.0.0.0/8 network. My requirement is to block few countries based on their IP Address. The page doesn't provide any codes like that. I am not an advance user so would like working code assistance.
     
    Chuman, Aug 12, 2011 IP