Home Contact Buy Now
Home Download Video Free Buy Now Site Map Contact

Installing Time Tracker on Windows Server 2008 with Apache

Note: this section covers installation and configuration issues of Anuko Time Tracker on a 64-bit version of Windows Server 2008 R2 with Apache 2.2.16, PHP 5.2.14, and MySQL 5.1.49. This is an old document, which is provided for information only. You may wish to check the installation process.

Prepare the Operating System

Make sure that your operating system is properly patched with the latest security fixes and service packs. You can check for required updates by clicking on Start - All Programs - Windows Update.

Install Apache Web Server

  • Go to http://www.apache.org and download the MSI Installer for Apache Win 32 Binary Including OpenSSL. The file name is httpd_2.2.16-win32-x86-openssl-0.9.8o.msi.
  • After downloading and saving the file locally, double-click it and run the installer.
  • Accept the License Agreement.
  • Use all default options, Typical install. Apache will be installed in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\ directory. If everything is normal, you should see green Apache icon in taskbar after install as on the picture below. You can stop and start your web server by clicking on it and selecting apropriate options.
Apache icon in system tray
Apache icon in system tray

  • Check if your web server works by launching a browser and pointing it to your local machine, or http://localhost/. You should see something like on the picture below, that comes from a sample index.html located in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ directory.
It works! - default home page after Apache install
It works! - default home page after Apache install

  • Do one more test by creating a sub-directory called timetracker in your document root (C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\). Create a simple index.html file in it with the following content, which you can create in Notepad:
<html>
<head>
</head>
<body>
Hello, World!
</body>
</html>

Custom page served by Apache web server
Custom page served by Apache web server

  • If you see the "Hello, World!" page it means that the Apache web server is installed and working properly.

Install PHP

This procedure describes a manual (versus using an installer) process to install PHP.
  • Download PHP 5.2.14 zip binary distribution from http://www.php.net/downloads.php - the file name is php-5.2.14-Win32.zip.
  • Create a directory c:\php\ and extract the content of php-5.2.14-Win32.zip archive into it.
  • Using Start - Control Panel - System - Advanced - Environment Variables add c:\php to your system PATH environment variable.
  • Create PHP configuration file by copying c:\php\php.ini-recommended to a new file c:\php\php.ini. This file contains PHP settings for your system. It makes sense to look into it and study what's defined there.
  • Test if we are okay with PHP install so far by running the "php --ini" command from your command line. If everything is okay you should see something like this:
C:\>php --ini
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:            C:\php\php.ini
Scan for additional .ini files in:      (none)
Additional .ini files parsed:            (none) 

C:\>

This command shows PHP configuration file names. Note that the loaded configuration file matches the one you just created.
  • Reboot Windows (to apply PATH environment variable with C:\php directory included for Apache web server). This is needed for php_mysql.dll module (that we install later) to find libmysql.dll, which is required for its operation.

Configure Apache to Work with PHP

Our next step is to configure Apache to process PHP scripts. This requires editing Apache configuration file (httpd.conf) and restarting the Apache service.
  • Open Apache configuration file C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf
  • Add the following lines to the bottom of the file:
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

  • Save httpd.conf file.
  • Restart Apache server by clicking the Apache icon in taskbar and selecting appropriate options. Make sure your Apache server starts.
  • Now it's time for PHP "Hello, World!" act by creating a simple file called index.php in your htdocs directory (C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\) with the following content:
<?php
phpinfo();
?>

  • Point your browser to http://localhost/index.php now. If everything is configured correctly so far, you should see PHP configuration information as on the picture below.
phpinfo() output
phpinfo() output

  • Just to make sure copy the index.php file into your timetracker directory and test whether browsing to http://localhost/timetracker/index.php works similarly. If you see PHP configuration info as on the picture above it means that your Apache server is configured to run PHP scripts.

Install MySQL Extension for PHP

When our basic PHP configuration is working it is time to install and configure MySQL Extension for PHP so that it can work with MySQL Server. It is done in 2 steps:
  • Uncomment this line in php.ini by removing the semicolon:
;extension=php_mysql.dll
so that it becomes:
extension=php_mysql.dll

  • Change the value of extension_dir directive to become as:
extension_dir = "c:\php\ext"
After doing so, restart Apache server and examine the output of http://localhost/index.php - you should check that the extension_dir reflects your change and that there exist a mysql section with some values in it. For example:

mysql section in phpinfo() output
mysql section in phpinfo() output

If you don't see mysql section in phpinfo() output it means that it is not configured correctly and Time Tracker will not work.

Install mbstring Extension for PHP

In a manner similar to enabling MySQL extension for PHP we must also enable mbstring extension. It is needed to handle multiple byte strings in different languages. Uncomment this line in php.ini by removing the semicolon:
;extension=php_mbstring.dll
so that it becomes:
extension=php_mbstring.dll
Then restart Apache and examine the output of http://localhost/index.php - you should see mbstring section just above mysql section. If you don't see mbstring section in phpinfo() output it means that it is not configured correctly and Time Tracker will not work.

Install GD Extension for PHP

GD extension is needed tp display charts in Time Tracker. To install GD extension uncomment the following line in php.ini:
;extension=php_gd2.dll
so that it becomes:
extension=php_gd2.dll
Restart Apache server for this change to take effect. To make sure you have the GD extension installed take a look at phpinfo(); output for existence of a gd section.

Install LDAP Extension for PHP

The LDAP extension is only needed if you plan to use LDAP Authentication in Time Tracker. Similarly to GD extension, uncomment the following line in php.ini and then restart your web server:
;extension=php_ldap.dll

Install MySQL Server

To install MySQL server (Community edition) 5.1.49 follow these steps:
  • Download MySQL installer package (Windows Essentials edition) from http://dev.mysql.com/downloads/mysql/5.1.html#win32 named mysql-essential-5.1.49-win32.msi or mysql-essential-5.1.49-winx64.msi corresponding to your architecture. If you are installing a different version you may try searching for it at http://www.mysql.com
  • Run downloaded .msi file to install MySQL server.
  • Accept all default options during installation and proceed to MySQL Server Instant Configuration Wizard.
  • Select Standard Configuration (instead of the default "Detailed Configuration") option.
Select Standard Configuration
Select Standard Configuration

  • Make sure to select the "Include Bin Directory in Windows PATH" option as on this screen:
Include Bin directory in Windows PATH
Include Bin directory in Windows PATH

  • Finally, uncheck the "Modify Security Settings" option to install MySQL without root password.
Install MySQL without root password
Install MySQL without root password

When Configuration Wizard completes it creates and starts a Windows service called MySQL. It's probably a good idea to check in this service exists in Start - Control Panel - Administrative Tools - Services and whether you can stop and start it again.

  • To test MySQL installation type "mysql" in the command prompt. If everything is working you should see something like the following:
C:\Users\Administrator>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit;
Bye

C:\Users\Administrator>


  • Type exit; and press Enter to exit MySQL console.

Install Anuko Time Tracker

Now we have everything ready to install and configure Time Tracker. Here are the installation steps:

Deploy Time Tracker Source Code

  • Remove timetracker directory and all test files inside it (C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\timetracker\).
  • Download Time Tracker distribution archive from here.
  • Extract the archive into C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\. The extraction procedure will create the timetracker directory inside htdocs.

Create Config File

Navigate to WEB-INF subdirectory in Time Tracker installation. In there, copy config.php.dist file to config.php. This is your Time Tracker configuration file.

Create a Database

Create a database for your Time Tracker to use, as well as login and password to access it. For example, if your database name is timetracker, login is ttuser and password is ttpassword then start MySQL console and issue the following commands:
C:\Users\Administrator>mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database timetracker character set = 'utf8mb4';
Query OK, 1 row affected (0.00 sec)

mysql> grant all on timetracker.* to ttuser@localhost identified by "ttpassword"
;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye

C:\Users\Administrator>
Check if the database was actually created by using the "show databases;" sql statement in MySQL console:
C:\Users\Administrator>mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.1.49-community MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
| timetracker        |
+--------------------+
4 rows in set (0.00 sec)

mysql> exit;
Bye

C:\Users\Administrator>
If you see your database entry in the list of databases then we are okay. By this point we have created a database for time tracking and defined a user / password combination to access it.

Modify the DSN Value in config.php to Access the Database

Now, when our database is created, we need to change the DSN value in time tracker config.php file (located in its WEB-INF sub-directory) to reflect the database name and user / password combination we just defined.

Edit the C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\timetracker\WEB-INF\config.php file. Change the DSN value to provide proper database name, user name, and password to access it. For example:
define('DSN', 'mysql://ttuser:ttpassword@localhost/timetracker?charset=utf8');

The above statement defines that Time Tracker code will access timetracker database on localhost as ttuser with ttpassword password.

Populate the Database

To populate the database with schema and initial data point your browser to http://localhost/timetracker/dbinstall.php and click the Create button in DB Install section.

Modify APP_NAME in config.php

Because we installed Time Tracker in timetracker subdirectory, we have to modify APP_NAME in config.php:
define('APP_NAME', 'timetracker');

Configure Apache to Process index.php Files

Time Tracker directory index
Time Tracker directory index

Although index.php exists in it, the Apache web server is not yet configured to recognize it. We need to change this by finding the following fragment in httpd.conf:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
and changing it by adding index.php to DirectoryIndex so that it becomes like this:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>
Do not forget to restart Apache server for this change to take effect.

Remove Database Install Script

Remove the file dbinstall.php (C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\timetracker\dbinstall.php).

Change admin Password

Use browser to access the URL below.
http://localhost/timetracker
Login to Time Tracker as admin with the password secret and change admin password. Click the Options menu item and change admin password there.

At this point Time Tracker should be ready to use. See Time Tracker User Guide.

Troubleshoot

Check your web server error log if something goes wrong and Time Tracker is not working.

Time Tracker Install Guide