Jump to: navigation, search

Difference between revisions of "Configuring Eclipse to Edit your eclipse.org Website"

Line 14: Line 14:
 
===Download and Installation===
 
===Download and Installation===
  
Download Apache HTTP Server 2.2.2 (current version at the time of this writing). You can find it [http://httpd.apache.org/download.cgi 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.
+
Download Apache HTTP Server 2.2.2 (current version at the time of this writing). You can find it [http://httpd.apache.org/download.cgi here]. Follow the provided instructions to install the software. 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".
 
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".
 +
 +
Download PHP 4.3.4. You can find it [http://www.php.net/releases.php here]. Follow the provided instructions to install the software. These instructions assume that it is installed in "C:\php-4.3.4". Be sure to select the Apache HTTP Server when prompted during installation. Assuming that the installer software has not been updated, you will have to manually configure Apache HTTP Server to find PHP. These instructions are written to the PHP directory during the installation process.
 +
 +
Effectively, this should amount to including the following lines in your apache.conf file:
 +
<pre>LoadModule php4_module "/php-4.3.4/php4apache2.dll"
 +
PHPIniDir "/php-4.3.4"
 +
AddType application/x-httpd-php .php .php4 .php3 .phtml</pre>
  
 
===Configuration===
 
===Configuration===
Line 25: Line 32:
 
<strong>Step 1:</strong> Configure Apache. Open the  
 
<strong>Step 1:</strong> Configure Apache. Open the  
 
&quot;http.conf&quot; file (located in  
 
&quot;http.conf&quot; file (located in  
<code>c:\phoenix_runtime\apache\conf\http.conf</code>). Scroll to the
+
<code>C:\Program Files\Apache Software Foundation\Apache2.2\conf\http.conf</code>). Scroll to the
bottom and locate the following section:
+
bottom and add the following section:
+
 
<pre>
+
<pre>&lt;VirtualHost local.phoenix.eclipse.org:80&gt;
&lt;VirtualHost local.phoenix.eclipse.org:80&gt;
+
    DocumentRoot [workspace_location]\www
DocumentRoot c:/eclipse311/workspace/www
+
    ServerName local.phoenix.eclipse.org:80
ServerName local.phoenix.eclipse.org:80
+
    ErrorLog logs/phoenix
ErrorLog logs/phoenix
+
    CustomLog logs/phoenix common
CustomLog logs/phoenix common
+
&lt;/VirtualHost&gt;</pre>
&lt;/VirtualHost&gt;</pre>
+
 
+
Be sure to replace [workspace_location] with the location of your Eclipse workspace. This setting assumes that you will keep all your Phoenix code in a project named "www" and directs the Apache HTTP server to find content there.
Change the &quot;DocumentRoot&quot; entry to point to the location  
+
of your www directory. The above entry assumes that the workspace is
+
located in <code>c:/eclipse311/workspace</code>. If you used the
+
default workspace when you first started Eclipse, you'd change this
+
value to <code>c:\Documents and Settings\Wayne Beaton\workspace\www</code>
+
(that is, assuming your name is &quot;Wayne Beaton&quot;.
+
+
It may look something like the following:
+
<pre>
+
&lt;VirtualHost local.phoenix.eclipse.org:80&gt;
+
DocumentRoot c:\Documents and Settings\Wayne Beaton\workspace\www
+
  
ServerName local.phoenix.eclipse.org:80
 
ErrorLog logs/phoenix
 
CustomLog logs/phoenix common
 
&lt;/VirtualHost&gt;</pre>
 
 
 
Save the file.
 
Save the file.
 
 
Line 59: Line 50:
 
&quot;local.phoenix.eclipse.org&quot;; in this step, you need to configure
 
&quot;local.phoenix.eclipse.org&quot;; in this step, you need to configure
 
your workstation to know about the host. Open your hosts file using your
 
your workstation to know about the host. Open your hosts file using your
favourite text editor. This file is likely located at  
+
favourite text editor. On Windows, this file is likely located at  
 
<code>c:\windows\system32\drivers\etc\hosts</code>. Add the following
 
<code>c:\windows\system32\drivers\etc\hosts</code>. Add the following
 
line to this file:
 
line to this file:
 
 
<pre>
+
<pre>127.0.0.1 local.phoenix.eclipse.org</pre>
 
+
127.0.0.1 local.phoenix.eclipse.org
+
</pre>
+
 
 
 
Save the file.
 
Save the file.
 
 
 
This line tells Windows that when a browser makes a request to
 
This line tells Windows that when a browser makes a request to
[local.phoenix.eclipse.org], that the local machine will handle it. Your
+
[http://local.phoenix.eclipse.org], that the local machine will handle it. Your
 
configuration of Apache has ensured that all requests coming into that
 
configuration of Apache has ensured that all requests coming into that
 
address on the default port (80) will be handled by Apache using
 
address on the default port (80) will be handled by Apache using
Line 77: Line 65:
 
 
 
<strong>Step 3:</strong> Start Apache. You can start Apache from
 
<strong>Step 3:</strong> Start Apache. You can start Apache from
the command line using the <code>apache_start.exe</code>. Stop Apache
+
the command line using the <code>httpd.exe</code>. Stop Apache
 
by typing Ctrl-C at the command prompt that started Apache. You can
 
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
 
also install Apache as a Windows service which will make it start
 
automatically when the workstation starts up.
 
automatically when the workstation starts up.

Revision as of 15:02, 14 June 2006

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. 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".

Download PHP 4.3.4. You can find it here. Follow the provided instructions to install the software. These instructions assume that it is installed in "C:\php-4.3.4". Be sure to select the Apache HTTP Server when prompted during installation. Assuming that the installer software has not been updated, you will have to manually configure Apache HTTP Server to find PHP. These instructions are written to the PHP directory during the installation process.

Effectively, this should amount to including the following lines in your apache.conf file:

LoadModule php4_module "/php-4.3.4/php4apache2.dll"
PHPIniDir "/php-4.3.4"
AddType application/x-httpd-php .php .php4 .php3 .phtml

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:\Program Files\Apache Software Foundation\Apache2.2\conf\http.conf). Scroll to the bottom and add the following section:

<VirtualHost local.phoenix.eclipse.org:80>
    DocumentRoot [workspace_location]\www
    ServerName local.phoenix.eclipse.org:80
    ErrorLog logs/phoenix
    CustomLog logs/phoenix common
</VirtualHost>

Be sure to replace [workspace_location] with the location of your Eclipse workspace. This setting assumes that you will keep all your Phoenix code in a project named "www" and directs the Apache HTTP server to find content there.

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. On Windows, 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 [3], 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 httpd.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.