12 Oct 2010 @ 7:35 AM 

There are very simple way to limit access to some your resources.

For example, you are not sure in security of your PC (probably it was or are infected by some virus, and some 3rd person can gain an access to your website). In this case you can create .htaccess file in your /admin/ folder and add following code:

Order Deny,Allow
Deny from all
Allow from XXX.XXX.XXX.XXX

Where XXX.XXX.XXX.XXX you WAN IP. If you don’t know your WAN IP it can be checked on such resources as iptools.com (it will be displayed in the top). But you can have a dynamic IP, what does it mean?  It means that your ISP change IP address every few hours, so you can’t know what IP you’ll have in next few hours. In that case I advise you to deny access from all IPs (just add following code to .htaccess):

Order Deny,Allow
Deny from all

OR, you can limit access only to some important files (like database configuration file, where saved your database username and password):

<Files config.inc.php>
order allow,deny
deny from all
</Files>

or to some specific extension files:

<Files "\.(sql|tar|tar.gz|rar|zip)$">
order allow,deny
deny from all
</Files>

Also you can protect some folder by the password:

AuthName "Private zone"
AuthType Basic
AuthUserFile /home/your_username/public_html/.htpasswd
require valid-user
</Files>

or file:

<Files config.inc.php>
AuthName "Users zone"
AuthType Basic
AuthUserFile
/home/your_username/public_html/.htpasswd
</Files>

Password is encoded in .htpasswd so you need to generate it, you can find in Google many “htaccess passwords generator” or if you have SSH access you can generate username and password yourself:

htpasswd -c /home/your_username/public_html/.htpasswd admin

Posted By: lvlind
Last Edit: 06 Oct 2016 @ 04:15 PM

EmailPermalinkComments (0)
Tags
Tags: ,
Categories: How to?

 Last 50 Posts
Change Theme...
  • Users » 1
  • Posts/Pages » 34
  • Comments » 0
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Need Help?



    No Child Pages.

Check your IP



    No Child Pages.