Web sharing through a campus network

Discussion in 'General Mac Discussion' started by stoid, Oct 3, 2003.

  1. stoid macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #1
    Is there any way that I can use the built in to Mac OS X Apache web server through an on-campus firewall?
     
  2. pepeleuepe macrumors 6502

    Joined:
    Oct 27, 2002
    Location:
    Los Angeles, California
    #2
    I managed to do it while on campus at my school. It requires a small amount of work in the Terminal to edit some server config files. Basically you have to change which port the server runs on and find a port that your campus leaves open. This means your web address will always include the port number since HTTP defaults to port 80. If you want some help, just PM me or e-mail me.
     
  3. stoid thread starter macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #3
    I am definitely interested in this regardless of the hassle it would take to set-up. Thanks in advance for all aid on this topic, as I imagine it might be rather extensive.
     
  4. tomf87 macrumors 65816

    tomf87

    Joined:
    Sep 10, 2003
    #4
    If the IP address you receive is an internal address (10.x.x.x, 172.16.x.x - 172.31.x.x, or 192.168.x.x) then you'll probably run into some problems.

    See, the addresses above are not routable on the Internet. They are used only as internal private addresses. With this in mind, the firewall administrator would need to NAT you (i.e. translate your private IP to a public IP that is routable on the Internet). If you do have a private IP, and can surf the Internet, they are NAT'ing you, but in a different way.

    There are two types of NAT: static or dynamic (hide). Static is one-to-one, which means that a private IP translates to one public IP. Dynamic, or hide, translates many private IP's to one public IP. More than likely, if you have a private IP, you are going through a proxy server to surf the net or you are hide NAT'ed.

    And unless you are good friends with the firewall admin, he won't static NAT you and there's nothing you could do about it. This will open up all sorts of security holes and could cause them to lose their job. Just think what would happen if someone compromised your system that was exposed to the Internet, and then compromised more systems on the campus network. That could get really messy.

    At any rate, good luck and let me know the results!
     
  5. pepeleuepe macrumors 6502

    Joined:
    Oct 27, 2002
    Location:
    Los Angeles, California
    #5
    Assuming you're not getting served an internal IP address, this should work.

    First turn on Personal Web Sharing in the Sharing prefs and make sure you can view something at http://127.0.0.1/ If that works, you know Apache is running and all you have to do is edit the config file.

    So open the Terminal and type in "httpd -V" You should get a list of various things pop-up on your Terminal. Look for one that resembles this:
    -D SERVER_CONFIG_FILE="/etc/httpd/httpd.conf"
    If you're using Jaguar is should look exactly like that, if not, the file might be located in a slightly different place.

    Now, we need to open the file to edit it. Type in "sudo pico *path from above*" You have to have root access in order to save this file, so that's why the sudo is neccessary, then just insert whatever path to the server config file that you just found.

    The pico text editor should open and you can use the built in search command to find the correct are in the file. Hit CTRL-W, which will bring up a search command at the bottom. Then type in "port" You'll find the word port a couple times before you get to the right place. It should look something like this:
    # Port: The port to which the standalone server listens. For
    # ports < 1023, you will need httpd to be run as root initially.

    Once you get to this section, it should say Port 80 by default. You can try any port you want, I personally had success with Port 8081 when I lived on campus, but I'm not sure what will work for you. So change that to whatever you want, and type CTRL-O to save the file and CTRL-X to exit. Now have someone else try typing in http://yourip:yourport/ For example http://162.168.145.2:8081/

    Good luck and let me know if you have any other questions.
     
  6. stoid thread starter macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #6
    I do have an internal IP address 10.153.100.88, and all IP addresses are routed through a single IP address through the main server on campus before connecting to the outside internet.

    Guess that means I'm screwed, I don't think that the network admins would help me even if they could.
     

Share This Page