Skip to end of metadata
Go to start of metadata
Table of Contents

Install instructions for eHour.war on Windows

eHour requires a Java JDK, the Apache Tomcat servlet container and a MySQL database.

When you are upgrading an existing installation of eHour, please see the upgrade instructions.

Java 1.6+

eHour requires a Java 6 runtime environment.

Download and install the latest version from Oracle's site. Look for the button "download JRE".

With eHour 0.9.1 a Java 6 environment is required.

eHour home

eHour 0.9.1 introduces the concept of the eHour home directory. This is the directory where you unpacked the eHour archive. The log file is stored in this directory as well as general configuration, etc.

To make eHour aware of the home directory you have to create an system environment variable. To do so on Windows 7:

  1. Right click on "My Computer" on your desktop and select properties
  2. Go to Advanced system settings
  3. In the popup, click Environment Variables
  4. Click the "New" button under System variables
  5. As variable name use EHOUR_HOME (in capitals)
  6. As variable value enter the full path to the folder where you unpacked eHour. Make sure to use forward slashes and not backslashes to split the path.

Database setup

MySQL and PostgreSQL are supported however only instructions for usage with MySQL are provided here, PostgreSQL instructions are only available for Linux.

If you don't have MySQL installed, download the Community Server from http://dev.mysql.com/downloads/mysql/

With MySQL downloaded, start the install and:

  1. In the setup choose a typical or complete installation and click next to copy the files.
  2. After copying you have the option to register at mysql.com; do so if you please or skip registration.
  3. When MySQL is installed you can choose to configure the server instance. Choose a standard configuration (or click detailed if you want to go into the details, not covered here).
  4. Keep Install as Windows Service enabled. This makes sure that MySQL is started in the background when the computer boots up
  5. Change the password of the root user. Do remember which password you used as it's needed later on
  6. Click next and execute!.
Create database

The easiest way to create the eHour database is to install the MySQL Workbench.
You can download the workbench from the the MySQL site. Use the default settings (complete) when installing.


When you first run the workbench you'll be presented with an impressive UI. Don't worry, we only need a small portion of the functionality.

  1. On the left of the screen is a listing with connections. When your Local MySQL connection is not listed, click the "New Connection" button and fill out the necessary details. Use the password you supplied when installing MySQL.
  2. After the connection is defined, double click to enter the SQL Editor.
  3. On the left there's the Object Browser including a button "Add Schema". Click and in the pop-up give it the name "ehour".
  4. In the Query Browser you have 3 panels, click on the panel called "Schemata" and select "create new schema". As schema name choose "ehour" and click ok. In the next two screens, click apply and finish.
Install eHour database

With the ehour schema created it's time to create the database tables.

In the directory where you unpacked the binary distribution there is a sql/mysql/install directory with a fresh.mysql.sql script in it.

  1. Load this script by - in the MySQL workbench - going to file -> Open SQL script.
  2. When the script is loaded, highlight the ehour schema in the Object browser
  3. In the main navigation, go to Query and click "Execute (all or selection)"
  4. Click the refresh icon in the ehour schema; new tables should appear and it should look like this:

Now on to the final part, Apache Tomcat

Apache Tomcat installation and configuration

Install Tomcat

Apache Tomcat is the server which runs the application. If you don't have Tomcat installed yet, download the Windows Service installer from [http://tomcat.apache.org/download-60.cgi].

Install instructions for Tomcat can be found on their site.

Install the MySQL JDBC connector

Download the MySQL JDBC connector from [http://dev.mysql.com/downloads/connector/j/]. This will allow Tomcat to connect to MySQL.

Unpack the downloaded archive and copy the extracted mysql-connector-5.x.x-bin.jar file to the lib folder of Tomcat.

Hook up eHour to Tomcat

Don't drop the ehour war in Tomcat's webapp directory as you would do with other applications

First make sure that Tomcat isn't running. Navigate to the Tomcat's bin directory and run tomcat6w.exe to check the status.
In the conf/tomcat directory of the eHour distribution you'll find the ehour_mysql.xml config file.

Open this file in a text editor.

The first line reads:

Unfortunately Tomcat does not read the environment variable you set up earlier so you need to replace the ${EHOUR_HOME} variable with the full path to your ehour home directory. For example it should look like:

Make sure to use forward slashes and not backslashes to split the path.

%ehour.db.username%

the database username

%ehour.db.password%

the database password

%ehour.db.hostname%

the hostname/IP address of your database server

%ehour.db.name%

the eHour database name

When you're done editing save this file as ehour.xml in the conf/Catalina/localhost directory of your Tomcat install directory. You might need to create this directory first.

Start it all up !

MySQL is probably already running, otherwise you wouldn't be able to install the database in a previous step.

Start Tomcat by running tomcat6.exe in the bin directory of the Tomcat installation directory. After a couple of seconds Tomcat and eHour will be initialized and you can access the application at [http://localhost:8080/ehour/].