The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Proxies

Discussion in 'Data Protection' started by larry1, Oct 23, 2008.

  1. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I have alot of people accessing my site via Proxy . Is there a way to Block ( Proxies)Websites from seeing mine?

    Or is there any Good Free Proxy scripts that will work in order for me to get users not too see my site who are using proxys?

    I have seen some people do it via .hta access.. But i have no clue how to do that.. I mean i have the file..

    This is what i got
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++
    # block proxy servers from site access
    # http://perishablepress.com/press/200...-via-htaccess/

    RewriteEngine on
    RewriteCond %{HTTP:VIA} !^$ [OR]
    RewriteCond %{HTTP:FORWARDED} !^$ [OR]
    RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
    RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
    RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
    RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
    RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
    RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
    RewriteRule ^(.*)$ - [F]


    To use this code, copy & paste into your site’s root htaccess file. Upload to your server, and test it’s effectiveness via the proxy service(s) of your choice. It may not be perfect, but compared to blacklisting a million proxy domains, it’s lightweight, concise, and very effective
    ++++++++++++++++++++++++++++++++++++++++++++++++++ +++

    I have like 5 or 6 .hta files on my server (Via c-panel), But i dont know what they mean by Root?

    Keep in mind, I dont know how to install anything on a server.. I do know how to edit files and such though.

    Any help?
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    In a cPanel/WHM environment, this would typically be the .htaccess file in ~/public_html (your public_html directory)

    If this file does not yet exist, you can create it. You can create and edit files by using File Manager in your cPanel interface. Be sure to show dot-files (hidden files) if prompted, otherwise you wont see these hidden files.
     
  3. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    David:

    When i open up C-panel after logging in. and select File manager and the pop-up box comes threw, it gives me 4 choices.. and the one that i choose is

    Web Root (public_html/www)

    Is that the one you are talking about, and furthermore is the .hta file supposed to be in a folder or not? The reason i ask is because i don't see it.
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Of the 4 options, Web Root is the correct place to be.

    However, there is another option you need to set. Go back to the main cPanel interface and click File Manager again. Below those 4 options is a checkbox "Show Hidden Files (dotfiles)." - be sure to check that box before clicking "Go."

    Sometimes there will be a .htaccess file already there, but often there wont be. If one is not there, simply create one and paste that code you mentioned in your first post into that file.
     
  5. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    OK, I did what you said, and i am gonna paste the code in there.. One question though.. I dont know if you are familiar with this at all.. But How do i know if that code is working?
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Personally, when I set up something like you're doing - I attempt to use a proxy and see if I can connect to the site I am blocking proxies for. There's a wide variety of proxy applications and websites available that you can use as a means to test your .htaccess code.
     
  7. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    Well What i am having problems with is where to actually paste the code at.. i mean do i delete everything from the original hta file and just copy and paste it in there, or just copy and paste the code at the bottom of the hta file.?

    I twould help if i could PM you and just show you whats in my hta file and you could put the code in ther for me and i would just copy and paste that and then try it. I already have a backup of the original.
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    At the bottom of the file should work :).

    .htaccess files may seem abnormal since you typically add items to the bottom (or top) of the file rather than replace any existing code.
     
  9. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    OK i will try it and see if i can access the site and let you know!
     
  10. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I tried that, and it still is not blocking really anything. Is there a way to block Particular Websites.. Mainly Proxy servers? I mean i know that i could by that service, but i am really trying to get around that.
     
  11. thewebhosting

    thewebhosting Well-Known Member

    Joined:
    May 9, 2008
    Messages:
    1,201
    Likes Received:
    1
    Trophy Points:
    38
  12. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    SO i guess the script down at the bottom of the page is what i need?
     
    #12 larry1, Nov 1, 2008
    Last edited: Nov 2, 2008
  13. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you have any idea how many proxy sites you'd need to list there? Do you have mod_sec installed?
     
  14. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1
    I have no clue what that even is

    "Do you have mod_sec installed?" by that i mean.

    and i know that there are many proxy sites out there.
     
    #14 larry1, Nov 2, 2008
    Last edited: Nov 2, 2008
  15. larry1

    larry1 Member

    Joined:
    Oct 14, 2008
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    1

Share This Page