Configuring Eclipse to Edit your eclipse.org Website

From Eclipsepedia

Jump to: navigation, search

This document is a work in progress.

The runtime environment for [1] runs Apache HTTP Server and PHP 4.3.4. Previous instructions have detailed how to configure XAMPP for use as a unit test environment for Phoenix. Unfortunately, XAMPP runs PHP 5.0 and there are significant differences between PHP versions 4.3.4 and 5.0 which make reliable testing impossible.

Phoenix Test Runtime Environment for Windows XP Setup

This document takes you through the steps that you need to follow to configure your workstation to run an Apache runtime environment similar to the environment running the [2] website. This environment is similar to the production environment but is not exact. It includes a minimally configured Apache web server along with PHP 4.3.4. This environment does not include MySQL or any other services.

Download and Installation

Download Apache HTTP Server 2.2.2 (current version at the time of this writing). You can find it here. Follow the provided instructions to install the software. When prompted for the "Network domain", specify "phoenix.eclipse.org". On Windows, you will be asked if you want to install Apache as a service. If you do so, it will start whenever your machine is started. It is not necessary to install Apache as a service.

All the steps in this document assume that Apache HTTP Server is installed in the default location. On Windows this is "C:\Program Files\Apache Software Foundation\Apache2.2".

Configuration

This document assumes that you have a project named "www" containing the website contents in your Eclipse workspace.

Step 1: Configure Apache. Open the "http.conf" file (located in c:\phoenix_runtime\apache\conf\http.conf). Scroll to the bottom and locate the following section:

	<VirtualHost local.phoenix.eclipse.org:80>
		DocumentRoot c:/eclipse311/workspace/www
		ServerName local.phoenix.eclipse.org:80
		ErrorLog logs/phoenix
		CustomLog logs/phoenix common
	</VirtualHost>

Change the "DocumentRoot" entry to point to the location of your www directory. The above entry assumes that the workspace is located in c:/eclipse311/workspace. If you used the default workspace when you first started Eclipse, you'd change this value to c:\Documents and Settings\Wayne Beaton\workspace\www (that is, assuming your name is "Wayne Beaton".

It may look something like the following:

	<VirtualHost local.phoenix.eclipse.org:80>
		DocumentRoot c:\Documents and Settings\Wayne Beaton\workspace\www

		ServerName local.phoenix.eclipse.org:80
		ErrorLog logs/phoenix
		CustomLog logs/phoenix common
	</VirtualHost>

Save the file.

Step 2: Configure the host. The previous setting configures a virtual host on your workstation named "local.phoenix.eclipse.org"; in this step, you need to configure your workstation to know about the host. Open your hosts file using your favourite text editor. This file is likely located at c:\windows\system32\drivers\etc\hosts. Add the following line to this file:


	127.0.0.1	local.phoenix.eclipse.org
		

Save the file.

This line tells Windows that when a browser makes a request to [local.phoenix.eclipse.org], that the local machine will handle it. Your configuration of Apache has ensured that all requests coming into that address on the default port (80) will be handled by Apache using documents found in your workspace.

Step 3: Start Apache. You can start Apache from the command line using the apache_start.exe. Stop Apache by typing Ctrl-C at the command prompt that started Apache. You can also install Apache as a Windows service which will make it start automatically when the workstation starts up.