IT Admin

Tag: server

How To Turn your Mac into a Web Server, OS X

by frenchsquared on Mar.07, 2009, under Mac

Are you looking to create you own website?
Do you want to test websites on your computer?
Are you running OS X 10.3 or higher?

Then you are in luck. This very simple tutorial will give you your very own web server. What must people don’t realize is that Apache and php are per-installed in every current version of OS X. The trick is just knowing how to turn them on.

Start by going to System Preferences:

System PreferencesThen go to Sharing:

sharing

From this point you simply need to check the box for web sharing. At first you would think this is some sort of file sharing but it isn’t. This simple check-box enables Apache.

Next, you need to know where your www folder is located. In the default Apache install on OS X your www folder is called documents. Go to root folder / Library / WebServer / Documents. You simply need to place you index file and other html files in this directory.

webdirectory

At this point your webserver isn’t live to the world. As of right now you have a home server commonly used for testing. If you would like this server to be live you need to give your computer a static ip address and then forward port 80 to your computer. Assuming you are using some sort of a router.

In my netgear router you login to the web interface. open a web browser and try 192.168.1.1. Your router may have a different ip address, so hopefully you remember what it is. Once logged in go to port forwarding and forward port 80 to your computer/server.

port-forwarding

Congratulations, you have an OS X server and can host your own websites. The last step is to buy a domain name and point it to your external ip Address. Make sure your Internet provider gives you a static IP, must home plans are dynamic.

  • Share/Bookmark
Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...