Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Reply
 
Thread Tools Search this Thread Display Modes
Old Mar 1, 2011, 08:21 AM   #1
lynkynpark86
macrumors 6502
 
Join Date: Mar 2010
Location: Maine, USA, Earth, Solar System, Milky Way, Universe
Need help setting up apache

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?
__________________
White MacBook, 2.13 GHz, 2 GB RAM, 160 GB HD
Dell w/ 4GB RAM, AMD Athlon
iPod Touch 4G (or 5G :P), 32GB, iOS 5.1, awaiting jailbreak.
lynkynpark86 is offline   0 Reply With Quote
Old Mar 1, 2011, 08:51 AM   #2
iDisk
macrumors 6502a
 
iDisk's Avatar
 
Join Date: Jan 2010
Location: Menlo Park, CA
Quote:
Originally Posted by lynkynpark86 View Post
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
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	4
Size:	13.5 KB
ID:	273767   Click image for larger version

Name:	Untitled 2.png
Views:	4
Size:	40.8 KB
ID:	273768   Click image for larger version

Name:	Untitled 3.png
Views:	4
Size:	56.0 KB
ID:	273769  

Click image for larger version

Name:	Untitled 4.png
Views:	6
Size:	386.4 KB
ID:	273770   Click image for larger version

Name:	Untitled 5.png
Views:	4
Size:	205.2 KB
ID:	273772  
__________________
"Where there is no vision the people perish:"- Proverbs 29:18

Last edited by iDisk; Mar 1, 2011 at 09:13 AM. Reason: GAVE MORE visual help
iDisk is offline   0 Reply With Quote
Old Mar 1, 2011, 09:17 AM   #3
lynkynpark86
Thread Starter
macrumors 6502
 
Join Date: Mar 2010
Location: Maine, USA, Earth, Solar System, Milky Way, Universe
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?
__________________
White MacBook, 2.13 GHz, 2 GB RAM, 160 GB HD
Dell w/ 4GB RAM, AMD Athlon
iPod Touch 4G (or 5G :P), 32GB, iOS 5.1, awaiting jailbreak.
lynkynpark86 is offline   0 Reply With Quote
Old Mar 1, 2011, 09:31 AM   #4
iDisk
macrumors 6502a
 
iDisk's Avatar
 
Join Date: Jan 2010
Location: Menlo Park, CA
Quote:
Originally Posted by lynkynpark86 View Post
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.
__________________
"Where there is no vision the people perish:"- Proverbs 29:18
iDisk is offline   0 Reply With Quote
Old Mar 1, 2011, 09:47 AM   #5
dampfdruck
macrumors member
 
Join Date: Oct 2008
Quote:
Originally Posted by lynkynpark86 View Post
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.
dampfdruck is offline   0 Reply With Quote
Old Mar 1, 2011, 05:05 PM   #6
etchtech09
macrumors member
 
Join Date: Jun 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.
etchtech09 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X > Mac OS X Server, Xserve, and Networking

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
apache virtual hosts breaking apache ddragas OS X Mavericks (10.9) 1 Nov 30, 2013 10:54 AM
Help with Apache haroldd OS X 0 Mar 26, 2013 09:01 PM
Apache Problems aliensporebomb OS X 10.8 Mountain Lion 0 Jan 28, 2013 11:16 PM
Apache process name ruqui Mac Basics and Help 4 Jan 22, 2013 06:23 PM
Add a subdomain in apache hightekrednek OS X 10.8 Mountain Lion 0 Aug 19, 2012 08:41 PM

Forum Jump

All times are GMT -5. The time now is 04:03 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC