Ehour Timesheet Management

From SME Server
Jump to navigation Jump to search
PythonIcon.png Skill level: Medium
The instructions on this page require a basic knowledge of linux.

Is this article helpful to you?
Please consider donating or volunteering
Thank you!


"eHour is the open source webbased time tracking tool for companies and organizations who need accurate information on how much time is spend on projects by their people. eHour makes the amount of time your people spend on projects visible and available as simple and user friendly as possible. eHour requires Java."

Please be aware that the eHour developer has decided that the new 2.x series of eHour will only be available as a commercial 'cloud service', and will no longer be Open Source. A shame...

Forum discussion

This how-to can be discussed on the forums here

Quick install

1. Download the latest version (v1.4.3 tested in this how-to) here

SME 8 & 9

2. Install Java:

yum install java dejavu*

3. Make the downloaded file executable:

chmod 755 [downloaded_file]

4. Execute the downloaded file: './[downloaded_file], and follow script/questions (in this example we use /opt/ehour as the installation directory)

5. Point your browser to 'http://yourserver:8000' and login with user/pass: admin:admin

If you want a 'clean' URL or a subdomain (e.g. instead of http://yourserver:8000 then please see the relevant section below.

MySQL backend

By default eHour uses an internal database (Derby). However you can use MySQL as the backend database too. Please note that if you want to use/change to MySQL, all existing data will not be used/transferred. It will still be available in the Derby database.

A. Create a new MySQL database (e.g. ehour) (see here how to)

B. Download the MySQL schema for ehour 1.4.3 here

C. Import the downloaded MySQL schema into the ehour database

mysql ehour < fresh.mysql.sql

D. Allow MySQL Local Network Access ( <--- Needs to be verified, does not seem to be required at all)

config setprop mysqld LocalNetworkingOnly no
expand-template /etc/my.cnf
sv t /service/mysqld  

E. Create ehour SME Server db entries (Only required if you want to access ehour from the outside world)

config set ehour service
config setprop ehour TCPPort 8000
config setprop ehour access public
config setprop ehour status enabled
signal-event remoteaccess-update

F. Edit the ehour config file to use the MySQL database


Set the database to MySQL and remove the # signs in front of the MySQL lines and change the MySQL user and password

# derby, mysql and postgresql are supported. When derby is selected you can ignore the ehour.database lines
# for mysql uncomment the following lines (and make sure postgresql lines below are commented out)
ehour.database.username=[mysql user]
ehour.database.password=[mysql password]
# for postgresql uncomment the following lines (and make sure mysql lines above are commented out)

Start at boot

To start eHour at boot time, enter the following (db) commands:

ln -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S92ehour
chkconfig ehour on
config set ehour service
config setprop ehour status enabled
config setprop ehour TCPPort 8000
config setprop ehour access public

Toggle access between public or private.

ehour on a sub domain

Accessing ehour on a TCP port (8000) may look not very professional. You may want to access ehour at a subdomain like ''. Here's how:

The preferred way to create a sub domain is to install the smeserver-webapps-common contrib from the FWS repository. Please see the webapps-common page on how to enable the FWS repo and install the contrib.

After installation we need to provide the details of the virtual host to the contrib so it can create the virtual host. In this example we want the virtualhost to serve the sub domain and only provide access to the login page to valid SME users. This can be done with the following command:

db domains set domain Description "Timesheet" Content Primary \
Nameservers internet TemplatePath WebAppVirtualHost DocumentRoot /opt/ehour \
RequireSSL enabled ProxyPassTarget Authentication Basic

Followed by:

signal-event webapps-update

Your sub domain has been created but will not yet show eHour. We need to tell the eHour Jetty webserver that it needs to listen to Since the eHour Jetty webserver is not part of SME Server, we need to adjust the jetty config file located at /opt/ehour/home/conf/jetty.xml to look like this:

<Call name="addConnector">
<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<Set name="Host"></Set>

Where only <Set name="Host"></Set> is added.

Then eHour needs to be restarted by:

service ehour restart

and give it a minute (really, a full minute) to restart. Then eHour will be available from Once the sub domain is working, you may want to close off the original webaddress by setting the access property to private: config setprop ehour access private followed by:

signal-event remoteaccess-update


For any upgrade, please see the eHour documentation/wiki. Especially if there is an database schema update. So always make a backup of your mysql database before starting any upgrade.