Installing SpagoBI 5.1 on Centos 6.5 -Tomcat 7 with MySQL 5.6.

Print Friendly and PDF
linux spagobi bi spago centos tomcat mysql

The SpagoBI project is a free software/open source initiative by the SpagoBI Labs of Engineering Group. It aims to realize the most complete 100% open source business intelligence suite, aggregating developers, integrators, companies, users and passionate people in an open community.

Prerequiste Downloads and setup.

  1. Install JAVA JDK.
  2. Install MySQL on CentOS 6.5, HOWTO Install Instructions are here.
  3. Download SpagoBI 5.1.
  4. Download Mysql Script from SpagoBI Website.
  5. Download Mysql Connector.
  6. Download Tomcat 7. (Optional - if you want to run SpagoBI on a Dedicated Tomcat Server.)

Extracting SpagoBI.


[ahmed@ahmed-server ~]# unzip

Move to /opt and create a softlink as spagobi

[ahmed@ahmed-server ~]# mv All-In-One-SpagoBI-5.1-21012015 /opt/
[ahmed@ahmed-server ~]# ln -s  /opt/All-In-One-SpagoBI-5.1-21012015 /opt/spagobi

Setting Heap memory in

[ahmed@ahmed-server ~]# vim /opt/spagobi/bin/

Add below content. Depending on the Server Memory set the Xms and Xmx appropriately.


Update SpagoBI lib with Mysql Connector.

Extract the connector.

[ahmed@ahmed-server ~]# tar xvzf mysql-connector-java-5.1.34.tar.gz

Copy jar to spago lib directory.

[ahmed@ahmed-server ~]# cp mysql-connector-java-5.1.34/mysql-connector-java-5.1.34-bin.jar \

NOTE : If you already have a older connector in the directory /opt/spagobi/lib/ then remove it. USE THE LATEST CONNECTOR.

Setting up Mysql Database.

Before we populated the scripts we need to create basic setup on Mysql.

Setting spagobi Database and spagobi User.

Assuming that mysql-server is installed and we have set the root password as root@123.

[ahmed@ahmed-server ~]# mysql -uroot -proot@123
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 475739
Server version: 5.6.21-log MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

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

Creating spagobi database.

mysql> create database spagobi;
Query OK, 0 rows affected (0.00 sec)

Creating a user spagobi with password as spagobi for spagobi database.

mysql> grant all privileges on spagobi.* to spagobi@localhost identified by 'spagobi';
Query OK, 0 rows affected (0.00 sec)

Optional - If we are running mysql in a different machine then we have give permission to the server which is trying to connect to mysql-server. Assuming that web server is we give the permission as below.

mysql> grant all privileges on spagobi.* to spagobi@ identified by 'spagobi';
Query OK, 0 rows affected (0.00 sec)

Commit and we are done.

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> exit

Populating Tables for SpagoBI.

Extract script from

[ahmed@ahmed-server ~]# mkdir mysql-spagobi
[ahmed@ahmed-server ~]# cd mysql-spagobi
[ahmed@ahmed-server mysql-spagobi]# unzip 
[ahmed@ahmed-server mysql-spagobi]# ls -l
total 136
-rw-r--r-- 1 root root   4400 Nov 19 12:38 MySQL_create_quartz_schema.sql
-rw-r--r-- 1 root root   7954 Dec  3 11:44 MySQL_create_social.sql
-rw-r--r-- 1 root root 111910 Nov 19 12:38 MySQL_create.sql
-rw-r--r-- 1 root root    856 Nov 19 12:38 MySQL_drop_quartz_tables.sql
-rw-r--r-- 1 root root   3821 Nov 19 12:38 MySQL_drop.sql
[ahmed@ahmed-server mysql-spagobi]#	

Now lets populate tables.

[ahmed@ahmed-server ~]# mysql -uspagobi -pspagobi spagobi < MySQL_create.sql
[ahmed@ahmed-server ~]# mysql -uspagobi -pspagobi spagobi < MySQL_create_quartz_schema.sql
[ahmed@ahmed-server ~]# mysql -uspagobi -pspagobi spagobi < MySQL_create_social.sql

Now we are ready.

SpagoBI MySQL Connection Setup.

Update server.xml.


Change the GlobalNamingResources to the below tag.

<!-- server.xml -->
	<!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users--> 
	<Resource auth="Container" 
                    description="User database that can be updated and saved" 
	<Environment name="spagobi_resource_path" 
	<Environment name="spagobi_sso_class" 
	<Environment name="spagobi_service_url" 
	<Environment name="spagobi_host_url" 
	<Resource auth="Container" 
	<Resource auth="Container" 
                    maxActive="20" maxIdle="10" maxWait="-1" 
                    name="jdbc/spagobi" password="spagobi" 

Update context.xml.


Change the contents of the file as below.

<Context docBase="SpagoBIProject" path="/SpagoBI" privileged="true" 
                        reloadable="true" source="org.eclipse.jst.j2ee.server:SpagoBIProject">  
	<ResourceLink global="jdbc/spagobi" 
                            name="jdbc/spagobi" type="javax.sql.DataSource"/> 
	<ResourceLink global="spagobi_resource_path" 
                            name="spagobi_resource_path" type="java.lang.String"/> 
	<ResourceLink global="spagobi_sso_class" 
                            name="spagobi_sso_class" type="java.lang.String"/> 
	<ResourceLink global="spagobi_host_url" 
                            name="spagobi_host_url" type="java.lang.String"/>  

Update hibernate.cfg.xml.


Update the hibernate-configuration tag, leave the other tag details as it is.

	<session-factory name="HibernateSessionFactoryMySQL"> 
	<property name="hibernate.connection.datasource">java:/comp/env/jdbc/spagobi</property> 
	<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
	<property name="hibernate.cache.use_second_level_cache">false</property> 
	<property name="hibernate.cache.use_query_cache">false</property> 
		Leave rest of the Configuration as it is.

Update jbpm.hibernate.cfg.xml.


Update the hibernate-configuration tag, leave the other tag details as it is.

		<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
		<property name="hibernate.connection.datasource">java:comp/env/jdbc/spagobi</property> 
		<property name="hibernate.cache.use_second_level_cache">false</property> 
		<property name="hibernate.cache.use_query_cache">false</property> 
			Leave rest of the Configuration as it is.



Comment below


Uncomment Below for Mysql.


Starting SpagoBI Server.

Lets go to Location and start.

[ahmed@ahmed-server ~]# cd /opt/spagobi/bin

Since we are not using HSQLDB and have configured MySQL, we need to start just the tomcat server.

[ahmed@ahmed-server bin]# ./ 

This will start the server on 8080.


Moving SpagoBI to Dedicated Tomcat7 Server.

NOTE : Before we start stop spagobi server, which we started earlier.

[ahmed@ahmed-server ~]# /opt/spagobi/bin/

Extract tomcat to /opt and create a softlink as tomcat.

[ahmed@ahmed-server ~]# tar xvzf apache-tomcat-7.0.59.tar.gz -C /opt
[ahmed@ahmed-server ~]# ln -s /opt/apache-tomcat-7.0.59 /opt/tomcat

Copy lib Files.

Copy without overwrite.

[ahmed@ahmed-server ~]# cp -n /opt/spagobi/lib/* /opt/tomcat/lib/

Option Details

-n, --no-clobber
      do  not  overwrite  an  existing  file  (overrides a previous -i option)

Copy webapps Directory.

Remove existing webapps directory as we dont need it any more.

[ahmed@ahmed-server ~]# rm -rf /opt/tomcat/webapps

Since we have already updated all the config files in the /opt/spagobi/webapps directory, we will copy them as it is.

[ahmed@ahmed-server ~]# cp -f /opt/spagobi/webapps /opt/tomcat/

Copy conf server.xml from /opt/spago.

Lets copy server.xml and overwrite the file.

[ahmed@ahmed-server ~]# cp -f /opt/spagobi/conf/server.xml /opt/tomcat/conf/server.xml

Copy to /opt/tomcat/bin.

Finally copy file to bin directory.

[ahmed@ahmed-server ~]# cp  /opt/spagobi/bin/  /opt/tomcat/bin/

Starting Tomcat Server.

[ahmed@ahmed-server ~]# sh /opt/tomcat/bin/

We are done.

Written on March 4, 2015