INSTALLATION

GUIDE

VERSION 4.1 | 2014

Copyright © 2008 – 2014. All rights reserved.

No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical, for any purpose without the express written permission of Precurio. Information in this document is subject to change without prior notice.

Certain names of program products and company names used in this document might be registered trademarks or trademarks owned by other entities. Precurio is a trademark of Precurio Openfire is a trademark of Jive Software Microsoft is a trademark of Microsoft Corporation

For Sales and Technical Support:

Tel: +1 (855) 737 6327 [email protected]

2

Table of Contents

1 INTRODUCTION 4

1.1 FAQs 4

2 SYSTEM REQUIREMENTS 6

2.1 Operating Systems 6 2.2 Web Servers 6 2.3 Database Servers 6 2.4 Important Notes 6

3 STARTING INSTALLATION 7

3.1 Step 1 - Server Check 8 3.2 Step 2 – Database Configuration 9 3.3 Step 3 – Create Administrator 10 3.4 Step 4 – System Preferences 11

4 USING ACTIVE DIRECTORY 12

5 INSTALLING OPENFIRE 13

5.1 Step 1 – Download Openfire 13 5.2 Step 2 – Pre-Install Configuration 13 5.3 Step 3 – Start Installation 16 5.4 Step 4 – Follow Installation Wizard 17 5.5 Step 5 – Integrate with Precurio Database Authentication 18 5.6 Step 6 – Install Plugins 19 5.7 Step 7 – Forward Requests 19 5.8 Step 8 – Install Openfire Service 21

6 SETTING UP THE PRECURIO DAEMON 21

3

1 INTRODUCTION

Thank you for downloading Precurio. Now in your possession, is the most simple and affordable enterprise intranet solution you will ever come across. Installing Precurio is very straightforward if you are familiar with setting up web applications. If at any time you get stuck, please request support by visiting our support portal (http://hub.precurio.com).

If you are an experienced web developer and you feel confident enough, simply take a look at the system requirements and proceed to installing Openfire when you are finished installing Precurio.

1.1 FAQs

How do I start installation? To start installation, go to http://[your server]/precurio4/public/install

Should I delete the install folder after installation? Yes, you should. The system will try to do this automatically.

Can I perform the installation if I do not have any web development experience? No, you can’t install Precurio without good knowledge of web servers and web server configuration. Please send an email to [email protected] and we will put you in touch with someone that can assist with the installation and initial setup.

Why do I get a blank page when I try to start installation? An error has most likely occurred on the page. Make sure “display_errors” is on, so you can see errors. Alternatively, check your error log file. Sometimes, on a non-windows server, this could be due to folder permissions. Make sure the following folders have 0777 permissions.

 public (precurio4/public)  tmp (precurio4/application/tmp)

My web server is properly configured, but the install system check page still says something is missing. Most times, our install check page is correct. Make sure you are editing the correct server configuration file. This happens a lot with Wampserver.

4

Can I install on IIS instead of Apache? Well yes, but you have to be knowledgeable at converting .htaccess rewrite statements to its IIS equivalent.

I enabled mod_rewrite but it still doesn’t work. Sometimes, rewrite rules doesn’t seem to take effect even if mod_rewrite has been enabled on your apache configuration. When this happens, the culprit is usually the “Allowoverride” setting. Check your directory setting in the apache configuration; make sure “Allowoverride” is set to “all”. By default, “Allowoverride” is usually set to “none”, which means the special “.htaccess” file in the precurio folder is unable to override settings. Once it is set to “all”, everything should work fine.

5

2 SYSTEM REQUIREMENTS

Here, we will highlight the basic requirements necessary to run Precurio. For a full list of requirements, see document “Precurio Data Sheet” (available on our website).

2.1 Operating Systems

Microsoft Windows Server (version 2003 or later) Distributions (Red Hat, Ubuntu, Fedora etc)

2.2 Web Servers

Apache Server (version 2.2.x, PHP version 5.3+) Microsoft Internet Information Service (IIS 6 & 7)

2.3 Database Servers

MYSQL Server (version 5.1+) Microsoft SQL Server 2005 and above Note: If using Microsoft SQL Server, it is recommended you deploy on 2 servers. One will serve as your application/web server while the other is your database server.

2.4 Important Notes

 You can’t install without an internet connection  PHP must have ioncube Loader installed.  Web server must support .htaccess files.  The “tmp” folder (found in precurio/application) must be fully writeable. Same also applies to folders “schemas” (precurio/application/workflow) and “public” (precurio/)

6

3 STARTING INSTALLATION

To start the installation, unzip the downloaded file and copy the precurio4 folder to your web root (i.e. the root directory of your web server, i.e. Apache). Then point your browser to http://[your server]/precurio4/public/install.

At the first step of the installation, you will be asked to register your Precurio installation.

If this is not the first time you are installing Precurio4, then you have most likely completed this step before. You can click on the “Already Registered? Click here to login” link and you will be able to login instead.

When you register your Precurio installation, you are also registered on our support portal. On the support portal, you can request technical support, extend your trial license and generate quotes.

7

If you get a blank page when you access the install page, then an error must have occurred. Please check your php error log file.

Once you are done with installation, please see the “Getting Started” chapter of your administrator guide. The administrator guide is available on the support portal (http://hub.precurio.com).

3.1 Step 1 - Server Check

After successful registration or login, you will begin a 4 step installation process. The first step is a system check. During this step, Precurio will check all necessary configurations to make sure everything is set. The result of the check will be displayed, as shown below.

Tip: Mouse over the status icon to get more information about a requirement.

For Apache related requirements, simply locate your Apache configuration file “httpd.conf”, and edit accordingly.

For PHP related requirements, locate your php configuration file “php.ini”, and edit accordingly. Please note that some web server stacks (e.g. Wampserver)

8 create multiple php.ini files, using phpinfo(), you can easily know which particular php.ini file is in use.

Setting up the ionCube loader can be a bit problematic, but luckily they have provided a loader wizard which we have bundled with the installation. You can access the loader wizard using http://[your server]/precurio4/public/install

3.2 Step 2 – Database Configuration

So, you finally sorted out the system requirements. The second step is a lot easier. You only need to enter the correct database settings (host and port), and choose a database name.

If your MYSQL server was installed using default setting, then the defaults chosen by Precurio should work. Otherwise, you should enter the appropriate MYSQL server settings.

Database Name “precurio4” is the chosen default; you can change this to any value. But remember the database will be truncated if it exists.

9

If you want to you Microsoft SQL Server, still go ahead with setting up MYSQL. Once you are done setting up, send an email to [email protected] and we perform a data transfer to your Microsoft SQL Server (this service is only available to paying customers).

3.3 Step 3 – Create Administrator

Now it is time to create the first user who will be “super administrator”. You will notice some fields are prefilled with data; this is gotten from your registration information.

NOTE: The information provided here will be displayed to other users.

10

3.4 Step 4 – System Preferences

This is the final step of the installation. Here, you will make the first steps toward configuring your intranet.

NOTE: All of the settings here (except the Demo Data option) can be changed later from your admin control panel.

Once you click the “FINISH” button, the software will begin the actual installation process (i.e. creating database, installing data etc). This may take some time, roughly 2mins, depending on the server specs.

Please note that the whole installation process is just a convenient way of editing the Precurio configuration file. In some unforeseen situations, you may have to edit this file directly, you can find it at “[SERVER ROOT]/precurio/application/configs/precurio.ini”

11

4 USING ACTIVE DIRECTORY

To integrate Precurio with Active Directory, you MUST have selected the Active Directory option during registration, or login. Once selected, you will notice step 3 is now “Active Directory” instead of the default “Admin Details”

If you didn’t setup your active directory, then you are definitely going to need the assistance of your Active Directory administrator.

Once you are done entering the AD settings, click on the “NEXT” button. If the settings are correct, you will be taken to the next step, else, you will be redirected back to this step and an error will be displayed.

NOTE: The username used will be assigned the “super administrator” role.

12

5 INSTALLING OPENFIRE

Openfire is a powerful instant messaging (IM) and chat server from Jive Software, that implements the XMPP protocol. This document will guide you through installing Openfire.

Before proceeding, please make sure you have JDK or JRE 1.7.0 (i.e. Java 7) or later installed on your system. You can upgrade your Java installation by visiting http://java.sun.com.

Please note that you can always get settings you used during Precurio installation by logging in to Precurio, go to your administrator page and select “System Settings”.

5.1 Step 1 – Download Openfire

Click here to download Openfire. (Download the ZIP file!) Unzip and copy the Openfire folder to any location on your server (we recommend you copy it to the root location of a root drive, so that it’s path is simply “C:/openfire/” or “D:/openfire”).

Throughout the rest of this guide, we are going to assume you copied the Openfire folder to your “C:” drive, hence the path to your Openfire installation is ASSUMED to be “c:/openfire”.

If you are opted to use the database authentication during Precurio Installation, the next step is very important, else if you chose LDAP Authentication, skip to step 3.

5.2 Step 2 – Pre-Install Configuration

If you are going to be using the database authentication, you have to integrate Openfire tightly with your Precurio database, to do that, open “c:/openfire/conf/Openfire.xml”.

The content of the file will look similar to this:

13

9090 9091

en

Now, between “en” and “” , you are going to paste the content below.

******************************** start here*************************************

com.mysql.jdbc.Driver

jdbc:mysql://localhost/precurio?user=root&passwor d= admin,administrator

org.jivesoftware.openfire.auth.JDBCAuthProvider

org.jivesoftware.openfire.user.JDBCUserProvider

org.jivesoftware.openfire.group.JDBCGroupProvider SELECT password FROM user_details WHERE username=? md5 SELECT concat(first_name,' ',last_name) as full_name,email FROM user_details WHERE username=? SELECT COUNT(*) FROM user_details SELECT username FROM user_details SELECT username FROM user_details WHERE username first_name

14

email SELECT count(*) FROM groups SELECT title FROM groups SELECT title FROM user_groups join groups on user_groups.group_id = groups.id WHERE user_id = (select user_id from user_details where username = ?) SELECT description FROM groups WHERE title=? SELECT username FROM user_groups join user_details on user_groups.user_id = user_details.user_id WHERE group_id = (select id from groups where title = ?) SELECT username FROM user_groups join user_details on user_groups.user_id = user_details.user_id WHERE group_id = (select id from groups where title = ?)

********************************stop here*************************************

After pasting the content in the Openfire.xml file,

Please note line 4 (i.e. connectionString):

 jdbc:mysql://localhost/precurio?user=root&password=

This means we are connecting to a “Mysql” database named “precurio” located on “localhost” server, using username “root” and no password. Please change this to what you used in the database settings, during Precurio Installation.

So, for example, you are going to have

 jdbc:mysql://kdl/precurio?user=root&password=ad214min

if you installed the MySQL server on the “kdl” server, and you connect using username “root” and password “ad214min” to the default precurio database “precurio”.

Also note line 8 (i.e admin):

admin,administrator

This means only admin and administrator will be allowed to login to the Openfire administrator console. If you used something other than

15 [email protected] or [email protected] when creating your first account, during Precurio installation, please include it in the comma seperated list.

So, for example, you are going to have

admin,administrator,smith

If, you used [email protected] as your administrator’s account, during Precurio installation.

Now save the Openfire.xml file, and proceed to step 3.

5.3 Step 3 – Start Installation

Run the file at “C:/openfire/bin/openfire.exe”, a window will open, give it a few seconds to initialise, then click the ‘Launch Admin’ button. This lauches a browser window, beginning the Openfire setup.

16

5.4 Step 4 – Follow Installation Wizard

Setting up Openfire is a relatively easy process. It begins with the language selection, then Server Settings, Database Settings, Profile Settings and finally Admin Account. While setting up Openfire is pretty straighforward, there a few places we would like to offer our advice.

5.4.1 Server Settings : Domain

At the second step of the setup, you will be required to put in the host settings for your Openfire server, make sure the value you put in the “Domain” field corresponds to the same value you put in the “Host” field, when you were setting up the live server, during Precurio Installation.

5.4.2 Database Settings

When asked to choose between a “Standard Database Connection” or “Embedded Database”, choose the “Standard Database Connection”.

17

5.4.3 Database Settings : Database URL

The host name is the name of the computer you installed the MySQL server, if it is the same computer as the one on which you are installing Openfire, put in “localhost”. The database name is the name of the database to use for Openfire, use the same database you used when setting up your database during Precurio installation. So your database URL should look something similar to this : jdbc:mysql://localhost:3306/precurio

5.4.4 Profile Settings

Choose “Default”, if you are using the database authentication mechanism for Precurio, else choose “Directory Server”.

5.4.5 Admin Account

Click the “Skip this Step ” button if you selected the database authentication mechanism during Precurio Installation, else add as many administrators as you want, then click “Continue”.

5.5 Step 5 – Integrate with Precurio Database Authentication

IMPORTANT : If you are authentication through a directory server such as Active Directory or OpenLDAP, please skip this step and proceed to step 6.

Just after finishing the Openfire installation, right before you login to the Openfire Administrator console. Open up your browser and enter the URL below:

 “http://[your server]/precurio4/public/install /chat/index/integrate “

You should see a page telling your Openfire has been successfully integrated with Precurio, as shown below.

18

5.6 Step 6 – Install Plugins

 Stop and Start the Openfire program  Login to the Openfire administrator console  Select the “Plugins” tab  Select “Avaliable Plugins”

 If you can’t find the “Broadcast” plugins on the list of available plugins, scroll down and click the “Update Now” link, to update the list.  Now click the plus “+” sign, to install the “Broadcast” plugin.  Stop and Start the Openfire program.

5.7 Step 7 – Forward Requests

This step is actually the most problematic because even though what you want to achieve is relatively simple, sometimes for some weird reasons, it might just not work.

19

What we want to do, is to let your Apache server be aware of your Openfire server. And the only way to do this, is to forward all ‘/http-bind/’ requests coming to your web server (Apache) to “http://[your server]: 7070/http- bind/”, i.e Openfire.

To do this, open your Apache “httpd.conf” file and put in the configuration below.

 ProxyRequests off ProxyPass /http-bind/ http://[YOUR-DOMAIN]:7070/http-bind/

Save the “httpd.conf” file. Before restarting your Apache server, point your web browser to this url ; “http://[your server]: 7070/http-bind/” your brower should display a “page not found” error.

Now restart Apache, and point your web browser to the same url, this time you should either get a ‘bad url’ error, or a ‘forbidden access’ error. (If your apache does not restart successfully, make sure you ‘mod-proxy’ and ‘mod- proxy-http’ enabled. see minimum requirments).

If you get a ‘bad url’ error, congratulations, please proceed to step 8. If you get a ‘forbidden access’ error, open your Apache “httpd.conf” file again and put in this configuration:

Order deny, allow Allow from all

(Please make sure there is no other proxy tag, else do not add this one, edit the already existing one.).

Save the “httpd.conf” file and restart Apache, you should now get a ‘bad-url’ error if you refresh your browser.

IMPORTANT!!! If you are using a virtual host setup, all this configurations MUST be put in between the opening and closing VirtualHost tags.

20

5.8 Step 8 – Install Openfire Service

You have finally set up openfire, and have installed the “Broadcast” plugin. Everything thing should be working fine now (one way to know, is to login to Precurio and the Chat status will no longer be “Disconnected”), but there is one problem, you will always have to start the Openfire program each time the systems starts.

To avoid that, simply run “c:/openfire/openfire-service.exe”. This will add Openfire to the list of system services, thus enabling Openfire start anytime the system is booted up. If this does not work, find a way to add openfire.exe to the list of start-up programs.

Congratulations you have just completed installing Precurio and integrating with Openfire. If you had any problems with the installation, please send an email to [email protected] or visit the support portal (http://hub.precurio.com).

6 Setting up the Precurio Daemon

Precurio has a daemon script which needs to be run frequently. The script basically handles sending email notifications.

NOTE: This section applies to Windows SERVERS; you can easily do the equivalent on Linux using Cron Jobs.

To make this script run frequently, you will need to add it to your task scheduler. To do that, first edit “run.bat” (located at “[WEB_ROOT_PATH]/precurio/bin/”) using your text editor.

21

(note: to edit, right-click on batch file, and select ‘edit’. Do not double-click, since this will run the program)

You should see something similar to this:

 php.exe -q C:\wamp\www\precurio\bin\daemon.php

The first part i.e “php.exe” is the path to the php executable file, please make sure it is correct. Also make sure your php server is enabled to run in cgi mode.

The second path i.e “C:\wamp\www\precurio\bin\daemon.php” is the path to a file ‘daemon.php’ in the same folder as ‘run.bat’. Now save the edited file i.e. ‘run.bat’, and add this to your task scheduler. Please check your operating system manual on how to add tasks to your task scheduler. Below are screenshots, for a Windows Vista operating system.

Figure 1 : Create a new task

22

Figure 2: Start a program

Figure 2 Set task triggers

Figure 3: Set task action. i.e. start 'run.bat'

23

Figure 5 Action added

Figure 4: Set Conditions

Figure 6: Other Settings

After you finished creating the task, make sure you perform the trigger, to make sure everything works properly.

24

THIS PAGE INTENTIONALLY LEFT BLANK.

25

26