Saturday, October 5, 2024

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.

Macromedia’s HomeSite is a great text-based HTML editor; I’ve been using it for about 10 years. Think of HomeSite as Dreamweaver’s code-focused younger brother.

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 time saver.

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 quite 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 Windows Notepad or any simple text editor. Scroll down about halfway until you see this section:

#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.

Immediately after the last line shown above, you’ll need to enter the following block of information (assuming your web files are located in a folder called “webprojects”):

Alias /webprojects/ "C:/webprojects/"

<Directory "C:/webprojects">
Options Indexes FollowSymLinks +Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

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 each folder you want listed as an alias (each web project folder). Keep entering them underneath the first block, as many as you need.

Alias /projectfolder1/ "C:/webprojects/projectfolder1/"

<Directory "C:/webprojects/projectfolder1/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Alias /projectfolder2/ "C:/webprojects/projectfolder2/"

<Directory "C:/webprojects/projectfolder2/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>

…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:webprojectsprojectfolder1 Map to http://localhost/projectfolder1/

… and so on.

When finished, try using the “View External Browser List” button – you should be able to see your local site and its SSI 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.

That should do it!

Tag:

Add to Del.icio.us | Digg | Reddit | Furl

Bookmark Murdok:

Debbie Campbell is a web designer of 12 years’ experience and the owner of Parallax Web Design in Fort Collins, CO.

Related Articles

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

Sed iaculis ultricies augue, ac tincidunt arcu tincidunt sit amet.