Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2003
    Posts
    908

    Limit File Access via IP ???

    Hello,

    I was reading a security article that mentioned that you can block file/directory access on apache and set it to allow only certain IPs access it.

    I wish to do this, however I have not been able to find the data I seek via google.

    I wish to limit "admin.php" to my IP block and the IP block of another admin.

    Is this possible? Could anyone provide some assistance?

    Thank you in advance.
    I buy vBulletin licenses and vBSEO licenses!

  2. #2
    this can be done in ".htaccess". Here's an example - allow access to "/admin.php" from "1.1.1.1" and deny everyone else:

    Code:
    <Location /admin.php>
        Order deny,allow
        Deny from all
        Allow from 1.1.1.1
    </Location>
    this should be uploaded in your site's root directory as ".htaccess"

    regards,
    M.
    Powered by AMD & FreeBSD.
    "Documentation is like sex:
    when it is good, it is very, very good;
    and when it is bad, it is better than nothing."

  3. #3
    Join Date
    Apr 2003
    Posts
    908
    Originally posted by Miha
    this can be done in ".htaccess". Here's an example - allow access to "/admin.php" from "1.1.1.1" and deny everyone else:

    Code:
    <Location /admin.php>
        Order deny,allow
        Deny from all
        Allow from 1.1.1.1
    </Location>
    this should be uploaded in your site's root directory as ".htaccess"

    regards,
    M.
    Thank you very much for your reply.

    To allow two different IP blocks would I then have this:

    Code:
    <Location /admin.php>
        Order deny,allow
        Deny from all
        Allow from 1.1.1.1, 2.2.2.2
    </Location>
    Notice the comma.

    Also, would you happen to know if for an IP block what character I use? IE: 1.1.*.*

    Once again, thank you in advance.
    I buy vBulletin licenses and vBSEO licenses!

  4. #4
    Originally posted by PCplayground

    Also, would you happen to know if for an IP block what character I use? IE: 1.1.*.*
    just put "1.1", which translates to "1.1.*.*"

    regards,
    M.
    Powered by AMD & FreeBSD.
    "Documentation is like sex:
    when it is good, it is very, very good;
    and when it is bad, it is better than nothing."

  5. #5
    forgot about comma - no comma (space only). just like this: "1.2.3.4 1.2.35.32 23.52.9" etc

    regards,
    M.
    Powered by AMD & FreeBSD.
    "Documentation is like sex:
    when it is good, it is very, very good;
    and when it is bad, it is better than nothing."

  6. #6
    Join Date
    Apr 2003
    Posts
    908
    Awesome, thank you very very much.

    I buy vBulletin licenses and vBSEO licenses!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •