apache http server httpd conf settings

apache http server httpd conf settings

ello, Today I’m going to give a brief overview of how to setup the web server in OS X Leopard or Snow Leopard. Both of these operating systems come pre-installed with the Apache web server. There are many options that you can configure along the way. This document will assume that you at least have a basic understanding of the OS.

Step 1: Create the new directory that our web server will read files from.

In OS X open Finder and navigate to your user directory. It will be labeled the same as the user name that you use to login to your machine. Once your are in your user directory look for a folder called sites. Right click (Option Click) on the sites folder and select Copy. Next, navigate to the root directory of your hard drive. Find your hard drive under Devices in Finder and Paste the Sites folder here. Now your Sites folder should have a path of “/Sites” without the quotations.

**I recommend using TextWrangler for the next step** It will make your life easy it can be found using Google and is free**

Step 2: Now we need to point Apache to the new directory path.

From Finder click on “Go” in your top menu bar and select “Go To Folder” Type in this path: /private/etc/Apache2/

“httpd.conf” this is the main Apache configuration file and it is here that we will be changing the path to out new folder. Copy this file and save a backup in another folder. Open up this document and look for a line labeled “Document Root”

Change the path for document root to “/Sites” Several lines below document root you will find another line “Directory” Change the path of this directory to “/Sites” as well. Save your file, TextWrangler will request you type in your password.

Step 3: Apache is now properly configured and all we need to do is fire it up!

Navigate to System Preferences->Sharing and click the check box next to “Web Sharing”

You will see that web sharing has been enabled. You will also see your machines IP address in this box. 
Open up your favorite web browser and type in the IP address that was give or type in http:/ /localhost

A web page should appear titled “Your Website” If this is what you see that congratulations! You have successfully setup your own personal web server. If not read back through the directions and see what you may have missed.

Now you are ready to edit /Sites/Index.html to your liking or copy your already created website to the /Sites folder.



There are no revisions for this post.

Tags: , , , , ,

No comments yet.

Leave a Reply