Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lynkynpark86

macrumors 6502
Original poster
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?
 

iDisk

macrumors 6502a
Jan 2, 2010
825
0
Menlo Park, CA
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?

  • 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.

voila
 

Attachments

  • Untitled.png
    Untitled.png
    13.5 KB · Views: 69
  • Untitled 2.png
    Untitled 2.png
    40.8 KB · Views: 66
  • Untitled 3.png
    Untitled 3.png
    56 KB · Views: 70
  • Untitled 4.png
    Untitled 4.png
    386.4 KB · Views: 75
  • Untitled 5.png
    Untitled 5.png
    205.2 KB · Views: 76
Last edited:

iDisk

macrumors 6502a
Jan 2, 2010
825
0
Menlo Park, CA
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?

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.
 

dampfdruck

macrumors member
Oct 20, 2008
81
0
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?

This is a basic network configuration task. Check here: http://en.wikipedia.org/wiki/Port_forwarding

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.
 

etchtech09

macrumors member
Jun 25, 2010
55
1
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.