set up a proxy server with Apache?

Discussion in 'Mac Apps and Mac App Store' started by FredAkbar, Dec 5, 2005.

  1. FredAkbar macrumors 6502a

    FredAkbar

    Joined:
    Jan 18, 2003
    Location:
    Santa Barbara, CA
    #1
    So what I want to do is, if I'm at school or somewhere, I want to be able to use my home computer's web server (which I have up and running with Apache) as a forward proxy, meaning access websites through my home computer rather than directly. It would serve the same purpose as sites like MegaProxy(.com) and ProxyWeb(.net), so that I can get around the school's filter (no p0rn, I promise ;)).

    I've edited my httpd.conf file to turn forward proxy on, and in my Network pref pane I told it to use a proxy server for HTTP, with my IP (external or internal, doesn't matter) as the server. But when I test this in Safari, e.g. by going to adiumx.com, it just shows me the default Apache page that you get when you go to http://localhost. I'm guessing that what is happening is, Safari is accessing the web server (which happens to be on the same computer I'm using) but the server isn't fetching the websites; instead it just displays its homepage.

    Keep in mind that I'm very new to Apache and the concept of web servers and all that stuff. Is there a simple way to make this work or is it really complicated?

    By the way, I've read all the warnings and stuff about making a publicly accessible proxy like that, and I'll take that into account, perhaps by password-protecting it (if possible) or only allowing traffic from my school's IP or something, but for now I'd just like to get it working.

    Thanks, all.
     
  2. baummer macrumors 6502a

    Joined:
    Jan 18, 2005
    Location:
    Southern California
    #2
    Alright sounds like you need to forward INCOMING connections to the local internal IP. Which port have you assigned for the proxy? Is it open to outside connections? You might also want to configure port forwarding from your router; assuming you have a router.
     
  3. FredAkbar thread starter macrumors 6502a

    FredAkbar

    Joined:
    Jan 18, 2003
    Location:
    Santa Barbara, CA
    #3
    Well, I did set up my router to forward incoming traffic to my computer. So when I have my web server on, I (or anyone else) can go to 68.x.x.x (my external IP) and see my site (whatever page is in the ~/Sites folder or whatever).
     
  4. baummer macrumors 6502a

    Joined:
    Jan 18, 2005
    Location:
    Southern California
    #4
    Ok, but did you forward traffic for the specific proxy port?
     
  5. FredAkbar thread starter macrumors 6502a

    FredAkbar

    Joined:
    Jan 18, 2003
    Location:
    Santa Barbara, CA
    #5
    Yeah, I think it's like ports 80 and 347 (dunno about the last one, could be anything). The router is definitely routing incoming requests to my computer correctly; otherwise I wouldn't be able to see the Apache page or anything...right? Before I got the router to forward to my computer, it wouldn't connect to my server at all if I tried to access it with a browser.
     
  6. baummer macrumors 6502a

    Joined:
    Jan 18, 2005
    Location:
    Southern California
    #6
    Which browser are you using and what is the input?

    Also, you do have the firewall set to accept proxy connections, right?
     
  7. FredAkbar thread starter macrumors 6502a

    FredAkbar

    Joined:
    Jan 18, 2003
    Location:
    Santa Barbara, CA
    #7
    I usually try in Safari, though I've tried Firefox as well. In the Proxies tab of the Network pane of System Preferences (this applies only to Safari; Firefox has its own proxy prefs), I check the Web Proxy checkbox and set it to 68.x.x.x, my external IP, and port 80. When I then enter http://apple.com in Safari (with my web server turned on), it just takes me to my Apache page.

    As for firewall, I turned the firewall completely off in System Prefs (just for testing), and did all I did in my router's firewall settings. My firewall rules list now looks like this:

    [​IMG]

    (Virtual Server is just the port-forwarding that allows Internet users to view my site.)

    edit: also, unless you underclocked your Mac mini by 10 MHz or 180 MHz, there's a typo in your sig.
     
  8. crazzyeddie macrumors 68030

    crazzyeddie

    Joined:
    Dec 7, 2002
    Location:
    Florida, USA
    #9
    Yeah, I've done this and it works fine. I had to do it for IRC, so i used the following command:

    ssh -D 6667 bob@99.999.99.99

    That forwards port 6667 from your computer to port 6667 on the proxy. Then you just point whatever app to localhost (or 127.0.0.1) and you're good.
     
  9. FredAkbar thread starter macrumors 6502a

    FredAkbar

    Joined:
    Jan 18, 2003
    Location:
    Santa Barbara, CA
    #10
    Wait, so I would run SSH on my computer, or the computer at school? The school computers are running Win2k or WinXP and give you pretty much no privileges; all I could do from there is things in Firefox like telling it to connect to the Internet through a proxy server, e.g. my home computer's server.
     
  10. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #11
    Well you may be able to get away with using a USB thumb drive with Putty on it.

    Heres how to setup SOCKS over ssh using Putty in Windows.

    First type in your home IP to connect to
    [​IMG]

    Then click on tunnels in the left pane and you can then setup a dynamic tunnel to your home machine. It should look something like this. Don't forget to click Add.
    [​IMG]

    Finally, once you are connected to your home machine. Change FF prefs to look like this.

    [​IMG]

    If successful, ALL of your web traffic will be encrypted over SSH. ***HOWEVER, DNS lookups will still be made on your schools network, so they will have a record of the DNS name lookups. Since it is a school, I doubt they even review their DNS logs...
     
  11. mikemodena macrumors 6502a

    mikemodena

    Joined:
    May 30, 2005
    Location:
    Connecticut
    #12
    The easiest thing to do is use CGI Proxy (google it) that's what I use for my site www.rubberduckie.us and I've got like 500 signups in less than a month from kids at school using it to get around the filter
     

Share This Page