Apr 27 2009
In the next month (or two) I’ll cover the scope of web serving on MacOS X
Jaguar. You don’t need the server edition, and you don’t need to buy anything
else. Today is going to be the basics, next week we’ll learn how to do port
forwarding and get a domain name.
The first part of web serving is turning Apache on. Apache is the world’s
most popular web server, and it happens to come built into OS X! To turn it
on just head over to System Preferences and choose Sharing. Click the checkbox
next to "Personal Web Sharing". That’s it…. You’ve just started up your own
Fire up your web browser and type ‘localhost’ into the link bar. This is a
de facto address for your compute, so in other words your browser is going
to be asking a web server on your computer for its index. You should be greeted
with a simple page that comes with Jaguar. If not, make sure you’ve turned
on "Personal Web Sharing".
In your home folder there is a folder called "Sites". Anything you
place in this folder can be accessed via the web by messing with the url:
localhost/~username will fetch
the files located in the site folder of the user dubbed "username". Try it
out with your username. You should see another simple web page that’s built
into the system.
Here’s where it gets interesting. If you are not behind a router, and have
broadband you’ll be able to share files or set up a web site for all to see.
If you are behind a router, you’ll have to wait until next week. If you don’t
know if you’re behind a router, just continue and see what happens… It can’t
Your friend can’t use localhost because
that will make his browser look on his computer. You have to tell it to look
on yours. Look up your IP address by going to System Preferences and choosing
Network. Highlight and copy the IP address and then make it into a link like
If a friend can type that into her browser and get the same page you saw,
then you’ve successfully completed part one. Stay tuned in the coming weeks,
I’ll be showing how to do everything from IP forwarding to installing MySQL.