{"id":383,"date":"2013-04-11T17:45:11","date_gmt":"2013-04-11T17:45:11","guid":{"rendered":"http:\/\/vickistan.com\/?p=383"},"modified":"2013-08-15T20:16:41","modified_gmt":"2013-08-15T20:16:41","slug":"preventing-access-to-a-website-from-specific-ip-addresses","status":"publish","type":"post","link":"https:\/\/vickistan.com\/?p=383","title":{"rendered":"Preventing access to a website from specific IP addresses with Deny\/Allow"},"content":{"rendered":"<p>Configure the Virtual Host as follows:<\/p>\n<p><directory \"\/var\/web\/htdocs\/restricted\"><br \/>\n    Order Deny,Allow<br \/>\n    Deny from all<br \/>\n    Allow from 11.211.0.0\/15<br \/>\n    Allow from 12.212.0.0\/15<br \/>\n    Require valid-user<br \/>\n    Satisfy all<br \/>\n    AuthName &#8220;Restricted Area&#8221;<br \/>\n    AuthType Basic<br \/>\n    AuthUserFile \/home\/web\/.htpasswd<br \/>\n    Require valid-user<br \/>\n<\/directory><\/p>\n<p>Create file with the following command:<\/p>\n<p>htpaddwd \/home\/web\/.htpasswd <password><\/password>\n<p>Another option:<\/p>\n<p>1. Type the following text into your VirtualHost file:<\/p>\n<limit GET HEAD POST>\nOrder Allow,Deny<br \/>\nAllow from all<br \/>\nDeny from [Enter IP address here]\n<\/limit>\n<p>2. Save the file.<\/p>\n<p>Alternatively, you may specify the directory by using:<br \/>\n<directory \/name and path to directory><\/directory><br \/>\nOrder Allow,Deny<br \/>\nAllow from all<br \/>\nDeny from [Enter IP address here]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configure the Virtual Host as follows: Order Deny,Allow Deny from all Allow from 11.211.0.0\/15 Allow from 12.212.0.0\/15 Require valid-user Satisfy all AuthName &#8220;Restricted Area&#8221; AuthType Basic AuthUserFile \/home\/web\/.htpasswd Require valid-user Create file with the following command: htpaddwd \/home\/web\/.htpasswd Another option: &hellip; <a href=\"https:\/\/vickistan.com\/?p=383\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=383"}],"version-history":[{"count":5,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/vickistan.com\/index.php?rest_route=\/wp\/v2\/posts\/383\/revisions\/500"}],"wp:attachment":[{"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vickistan.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}