Need help setting up apache

Discussion in 'Mac OS X Server, Xserve, and Networking' started by lynkynpark86, Mar 1, 2011.

  1. macrumors 6502

    I'm trying to set up Apache on 10.6, and most how-to pages aren't much help. I want to set it up so anyone, anywhere (NOT HOME SHARING) can see a page I made at my IP. Also, how can I set a custom path (If someone types my IP in a browser, I want it to load /Users/admin/web/luep/index.html on my hard disk). Ideas?
  2. iDisk, Mar 1, 2011
    Last edited: Mar 1, 2011

    macrumors 6502a


    Jan 2, 2010
    Menlo Park, CA
    • Click on System Preferences
    • Click on Sharing
    • Check the box that says "Web Sharing"

    Check out the attached screenshots to help you. You'll notice in screenshot #4 that apache is already built into OS X....also in screenshot #3 you'll see that once you turn on web sharing your able to click on to IP links to test your static pages.


    Attached Files:

  3. thread starter macrumors 6502

    But the IP's shown are my 192.168.X.XYZ IPs. Will these work somewhere other than my home network? Like another country, for example? Also, how can I change the "Sites" folder path?
  4. macrumors 6502a


    Jan 2, 2010
    Menlo Park, CA
    unfortunately, i'm not able to answer your question on this one..... but I can say that if you were to click on the link in the static webpage, it will bring you to the page that shows you how to set up and power apache on your Mac.
  5. macrumors member

    Oct 20, 2008
    This is a basic network configuration task. Check here:

    Note: By opening up your computer like this you might get yourself a security problem. The best thing would be to place it behind a reverse proxy with IDS capabilities. If you want to do this properly, you have quite a learning curve ahead.
  6. macrumors member

    Jun 25, 2010
    To change the "Sites" folder path, you will want to jump into Terminal and edit /etc/apache2/httpd.conf.

    Find this:
    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    DocumentRoot "/Library/WebServer/Documents"

    and change the last line to look like this:
    #DocumentRoot "/Library/WebServer/Documents"
    DocumentRoot "/Users/admin/web/luep"

    Then restart Apache by running this:
    sudo apachectl restart

    It will ask you for your password, at this point you will be able to get to the page you want on your internal network.

    You will next need to follow the advice of dampfdruck to do port forwarding on your modem/router to point to your computer that is running Apache.

Share This Page