Web Hosting Forums

Results 1 to 9 of 9

This is a discussion on How To Block IP From Viewing My Sites in the Hosting Talk & Chit-chat forum
Greetings again everyone. I have a question about how do I go about blocking certain IP's from viewing my websites? Here's the deal.... I do ...

  1. #1
    Loyal Client Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78

    Unhappy How To Block IP From Viewing My Sites

    Greetings again everyone.

    I have a question about how do I go about blocking certain IP's from viewing my websites?

    Here's the deal....

    I do not know the certain person's IP's yet as I do not have it, but I want to block them from entering my websites..
    What I do have are emails from them but sent through Yahoo!
    I have a feeling I can get their IP addy if I view the email client's information.. but my questions are...

    Q) I already viewed the email's client's information (don't know what is called) and see a gazillion of path and codes and IP's.. how do I know which is the IP I want to block? (the senders, client, etc)

    Hope I make sense

    Thanks again,
    Ms. L

  2. #2
    JPC Dream Team
    Join Date
    Mar 2009
    Posts
    1,913
    Hi,

    You can block webaccess for an IP by adding the following line in htaccess file.

    deny from x.x.x.x

    Replace x.x.x.x with the IP you would like to block.

    You need to check the complete header of the mail to find the IP from which he send the mail.

    If you're not sure, please open a ticket with the complete header and we can assist you.
    Anoop
    Support Department
    JaguarPC.com

  3. #3
    Loyal Client Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78
    Thanks JPC,
    So, do I create a file that says " deny from xxxx (the IP) and then upload it to the htaccess folder? If not, then what are the right steps? I'd like to do it myself so I can learn :-)

    Thanks,
    Ms M

  4. #4
    Loyal Client Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78
    DISREGARD MY ORIGINAL REQUEST.

    I have figured it out and I have done it all successfully!!!
    Thanks a million.

    Ms L

  5. #5
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    This is what I use. You can allow or deny.

    <Limit GET POST PUT HEAD>
    order allow,deny
    allow from env=good_pass
    deny from env=bad_pass
    </Limit>
    SetEnvIfNoCase User-agent "Browsershots" good_pass
    SetEnvIfNoCase User-agent "Mozilla" good_pass
    SetEnvIf Remote_Addr "11.73.187.209" bad_pass

  6. #6
    Loyal Client Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78
    Quote Originally Posted by Connie View Post
    This is what I use. You can allow or deny.

    <Limit GET POST PUT HEAD>
    order allow,deny
    allow from env=good_pass
    deny from env=bad_pass
    </Limit>
    SetEnvIfNoCase User-agent "Browsershots" good_pass
    SetEnvIfNoCase User-agent "Mozilla" good_pass
    SetEnvIf Remote_Addr "11.73.187.209" bad_pass
    Connie, thanks.
    I'm wondering how to go about doing this.. is this a file that you upload to your server, or is it a code you apply to your websites?
    I'm green with this LOL

    Here's what I discovered I want.. I denied the IP successfully BUT this IP is denied on ALL my domains and that's not what I want, I only want to deny on a specific domain not all of them

    I have one account with several domains, does anybody know of a code or trick to only deny IP on a specific domain not all of them?

    Thanks in advanced,
    Ms L

  7. #7
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    The code that Connie gave you would go in an .htaccess file. That's a file that Apache uses to apply configuration chages to your site. It is used for a number of purposes, such as setting redirects, configuring whether to use PHP 4 or PHP 5, or changing webserver settings on a site-by-site basis.

    Create a file called .htaccess (note the dot at the beginning) and paste in the code. Apache (the web server) will check for that file and attempt to parse it before it tries to load a page of your site. Note that, in Unix/Linux environments and files with a dot as the first character are hidden by default, so depending on your FTP software, you may need to enable non-default settings to see them. If you already have an .htaccess file in the account, you can usually add the new code either above or below what is already there without a problem, but I'd still recommend making a backup of what's there before you change anything, just in case something breaks.

    Note that you can put an .htaccess file in any directory of your site and Apache will walk up the directory tree until it gets to public_html, applying any instructions it finds. This can cause problems when using multihosting or subdomains because the .htaccess file for the main site will also apply to all subsites as well.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  8. #8
    Loyal Client Ms_Lamborghini's Avatar
    Join Date
    Mar 2006
    Posts
    78
    Thanks Jason,
    I did everything you said and it went smooth!!
    Now if I can only test it to see if it works LOL

    Thanks a trillion!!!
    Ms. L

  9. #9
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    You can always test with your IP. It'll block web access to your machine, but not any other services, so you can still get in with FTP or SSH to remove the block.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

Bookmarks

Posting Permissions

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