Setting Up Apache Server Mappings for HomeSite

This information was gleaned from a number of websites and my own trials in getting this to work, but I thought it would be useful to have it in one place for other HomeSite users who may not be overly familiar with server configuration.

Why map servers? The reason I do it is because it enables me to browse and view PHP includes live right on my local machine. You can see the results of server side includes without having to post the site online, a big timesaver.


Part 1 – Setting up Mappings in the Web Server

First, get the latest stable installation of Apache Server. The one I use is from XAMPP (www.xampp.com) and is exceedingly easy to set up. Install it according to the instructions. XAMPP’s installation also includes MySQL, phpMyAdmin, a FileZilla server and a number of other useful tools.

Go into the install directory and look for this file:

C:/Program Files/xampp/apache/conf/httpd.conf

Open it in notepad. Scroll down about halfway until you see this section:

Immediately after this section of code, you’ll need to enter the following block of information (assuming your web files are located in a directory called “webprojects” under C: ):

Alias “maps web paths into filesystem paths and is used to access content that does not live under the DocumentRoot.” In turn, the next section “allows access to the filesystem path.” If you want more information on the directives used within this section, visit http://httpd.apache.org/docs/2.2/mod/core.html#options.

Now you will need to enter a similar block of code for every folder you want listed as an alias (each web project folder). Keep entering them underneath the first block, as many as you need.

…and so on.

When you’re finished entering project folders, save httpd.conf. You’ll need to stop and restart the Apache web server at this point (and any time you make changes to its configuration).

Part 2 – Setting up Server Mappings in HomeSite

Open HomeSite. In the top menu, go to Options > Settings > Browse. In the window, tick the “Enable Server Mappings” box.

Click “Add” to create a new server mapping. Note that if you ended a folder name with a “/” you must also include the “/” in this dialog.

For “Map From” enter: C:\Program Files\xampp\

And for “Map To” enter: http://localhost/

Do this once more to also set the project directory to localhost:

For “Map From” enter: C:\webprojects\

And for “Map To” enter: http://localhost/

Then you’ll repeat this process for each project folder you entered in httpd.conf.

Map from C:\webprojects\projectfolder1

Map to http://localhost/projectfolder1/

… and so on.

Try using the “View External Browser List” button – you should be able to see your local site in your chosen browser. What if it doesn’t work? Try these potential solutions:

1) Did you stop and restart Apache Server?
2) Make sure that the formatting of folders and paths is identical in httpd.conf and in the settings in HomeSite. Did you forget a slash?
3) Make sure you’re using backslashes, not forward slashes for the “Map from” portion of the server mappings in HomeSite.
4) Reboot your computer.

If you find another solution that works, I’d love to hear about it.

Leave a Reply

Your email address will not be published. Required fields are marked *