Quantcast

Special Sponsored Section


The video player requires Flash 8 Player or later. Please download the latest Flash Player.


Maclife Hottest Articles
Thumbnail
FEATURE
100 Snow Leopard Tips, Tricks, and Features
Browser
FEATURE
OS X Browser Speed Wars: May the Fastest App Win
iTunes History
FEATURE
The Complete iTunes History -- SoundJam MP to iTunes 9
iTunes Tips
FEATURE
iTunes 9 Tips and Tricks - Solve the Mysteries of the New iTunes
How To Make your Mac a Web Server
Posted 08/05/2009 at 6:57:54pm | by Arvind Srinivasan & Susie Ochs

You may think you are one with the Interwebs, but until you actually create a website, you are merely part of the Interwebs. Follow this tutorial, and you will learn how to become one in about a billion, the exclusive club of people who host sites of some sort.

Hosting an HTTP server used to be an arduous task, but Mac OS X makes it easier than ever. We recognize that there is a built-in Web Sharing feature that allows you to create a server with one click, but we will teach you how to make a more advanced server that can handle server-side scripting languages like PHP.

Difficulty Level:
Medium


What You Need:
>MAMP (free, www.mamp.info)
>A DynDns account (free, www.dyndns.com)
> Access to your router to forward ports (in other words, a home network you control)
> A Mac that’s on and connected to the Internet all the time (in other words, if you try this with a laptop, your site will be down whenever you laptop is off or disconnected)
>Optional: a CMS like Drupal (free, drupal.org) or Wordpress (free, www.wordpress.org)

 

1. Install MAMP

MAMP (an acronym for Mac, Apache, MySQL, PHP) is an open-source platform for hosting a website on a Mac. Download the MAMP disk image, open it, and drag the MAMP folder to the Applications folder to install it. Then, browse to the /Applications/MAMP folder. You should see something akin to what is in this screenshot.


We like saying the word MAMP repeatedly. It’s a fun word.

This is the control center for your entire installation. Any websites you create will go here, and all the configuration files for your server will go here as well.

 

2. Configure MAMP

First, open the MAMP.app file in the /Applications/MAMP folder. This will start the HTTP server. Then, click Preferences. The first thing you need to do is deselect “Stop Servers when quitting MAMP” and “Check for MAMP PRO when starting MAMP.” This way, you don’t have to keep the application running all the time to keep the servers on.


Try it: “MAMP, MAMP, MAMP.” It’s just fun to say.

Next, go to the Ports tab, and click the button that says, “Set to default Apache and MySQL ports.” Sticking to standards is always best, because if you leave it as port 8888, for example, your URL will be something like www.example
.com:8888, which is annoying.


3. Sharing is Caring

Now, go to System Preferences, and click the Sharing tab. Check File Sharing, but then click the Options button. Make sure “Share files and folders using FTP” is selected. FTP is generally considered the standard for editing websites remotely, and if you plan to use a tool like Dreamweaver or Coda to edit the HTML code, they use FTP (and its more secure sibling, SFTP) to manage sites. Click Done.

sharing

Next, make sure Web Sharing is deselected. If it’s selected, the Apache server that comes with your Mac will conflict with the one that MAMP has just installed. Finally, you should check the box for Remote Login, because controlling your computer with SSH is the easiest way to restart the server remotely (for more about SSH, visit 
www.maclife.com/ssh_surf).

 

COMMENTS
avatarwow

COOL! I found this advice to be awesome.

Login or register to post comments
avatariWeb

Will this work using iWeb if you just don't put wordpress on there? And can people still download files to their computers using iWeb?

Login or register to post comments
avatarFreakin' Awesome!

Thanks for the great article. I currently run my own web server using Mac OS X's plain vanilla built-in Apache server. This setup greatly expands the capabilities of my home server - and it's crazy easy! This is, as your publication used to say in the good 'ol days, freakin' awesome!

Login or register to post comments
avatarA Couple of Caveats

Enjoyed reading the article. Make sure that setting up an HTTP server does not break some agreement you have with your Internet service provider. And enabling SSH might open your machine to SSH attacks.

Login or register to post comments
avatarThe only issue we wish Apple

The only issue we wish Apple would address is the frequency of automatic syncs, which defaults to every 15 minutes--it’s just not often enough. However economics degree AND Online Finance degree

Login or register to post comments
avatarf you’re willing to spend

f you’re willing to spend $25 and put on your true Mac geek hat for a few minutes, there is a way to change the 15-minute sync interval so MobileMe syncs more often.
Science School AND Online degrees AND hr diploma

Login or register to post comments
avataromega watches

Were not smart, but also learn from others bald.omega watchesChing had no water to fish, one to the cheap is invincible.replica watchI left Dragon, White Tiger right shoulder tattooed Mickey Mouse.replica watchesEfforts should be made! ! For your Audi Dior me.8282

Login or register to post comments