Installing JasperReports Server manually on Linux

The steps you need to follow to install JasperReports Server (JRS) manually on Linux.

Before you begin

  • For WorldServer 11.8.2, install OpenJDK 17.
  • For WorldServer 11.8.0 or 11.8.1, install OpenJDK 11 or, if you want to use the Report Center on a machine that uses a version of Java other than version 11, configure JasperReports Server to use Java 11. This is mandatory if you intend to run both WorldServer and JasperReports Server on the same machine.
    To install Java on CentOS 7, for example, you can find more information here. Also, make sure that the JAVA_HOME and PATH variables are configured properly for your session. For example:
    export JAVA_HOME=/usr/local/jdk-17.0.6+10
    export PATH=$JAVA_HOME/bin:$PATH
    java -version
  • Install Tomcat 9.x.

    You can find a Tomcat 9 installation kit in the /Reports/tomcat folder of the JasperReports Server installation kit. For more information about installing Tomcat 9, see the official installation instructions. Make sure the logs folder is created under Tomcat.

Procedure

  1. Go to the integrations\JasperSoft_<version> folder of the WorldServer distribution kit and extract the jasperreports-server-<version>-bin.zip package to a path of your choice, such as /opt/jasper/jasperreports-server-9.0.0-bin.
    Make sure that you assign the required permissions to the JasperReports Server installation directories, as in the following examples:
    chmod 755 <js-install>/apache-ant/bin/*
    chmod 755 <js-install>/buildomatic/*
    chmod 755 <js-install>/buildomatic/bin/*
  2. The jasperreports-server-<version>-bin.zip package contains a folder called Reports, in which you can find Tomcat 9. Copy the Reports folder to the installation path according to the Tomcat installation instructions.
  3. If you are running both WorldServer and JasperReports Server on the same machine, go to <js-install>/Reports/tomcat/conf, open the server.xml file with a text editor, and make sure that the Tomcat ports in the following entries are different from the ports used by the WorldServer Tomcat server:
    Connector port="<port>" protocol="org.apache.coyote.http11.Http11Protocol"
    Server port="<port>" shutdown="SHUTDOWN"
    "Connector port="<port>" protocol="AJP/1.3" redirectPort="<port>"
  4. Check that your environment has been set up properly:
    CommandNotes
    export JAVA_HOME=/usr/local/jdk-<version>This should be the path of the Java installation directory up to the /bin folder.
    export PATH=$JAVA_HOME/bin:$PATHThis is to set the system Path variable.
    java -versionThis is to check that your system is running on Java 17 (for WorldServer 11.8.2) or Java 11 (for WorldServer 11.8.0 and 11.8.1).
    cd <js-install>/buildomaticReplace <js-install> with the path where you extracted the jasperreports-server-<version>-bin.zip package.
  5. Prepare the JasperReports Server configuration file:
    1. Go to $cd <js-install>/bin/buildomatic/sample_conf.
    2. Copy the sqlserver_master.properties or oracle_master.properties file (depending on the type of relational database management system you use on your machine) to <js-install>/buildomatic, and then rename it to default_master.properties:
      $cd ..
      
      $mv  sqlserver_master.properties  default_master.properties
    3. Open the default_master.properties file and set the following properties:
      NameDescription
      appServerTypeThis should always be tomcat.
      appServerDirThis path should be <js-install>/Reports/tomcat.
      dbTypeIf you copied and renamed the correct file in the previous step, do not change the value of this property.
      dbHostThe name of the database server or its IP address.
      dbUsernameThe username that will be used to log in to the JasperReports Server database.
      dbPasswordThe password that will be used to log in to the database. Do not encrypt it.
      sysUsernameOnly on Oracle databases. If you want to create and deploy the JasperReports Server database automatically, enter the username of the database administrator. If you want to create and deploy the database manually, enter the same value as for dbUsername.
      sysPasswordOnly on Oracle databases. If you want to create and deploy the JasperReports Server database automatically, enter the password of the database administrator. If you want to create and deploy the database manually, enter the same value as for dbPassword.
      js.dbNameUncomment this property and enter a name for the database on which you want your new JasperReports Server version to run. This database will be created automatically. This is particularly important if you are upgrading from a previous version of JasperReports Server, because using the same database on multiple versions will lead to an unsuccessful installation.
      webAppNameProOptional: If you want to change the folder name (thus, making it part of the URL), uncomment this property and enter a new name. The default name is jasperserver-pro.
      encryptSet this property to true for database passwords to be encrypted in configuration files. During the installation, this property creates certain encryption keys in the user's home folder. Pass this folder to js-install-service.bat as a second argument or set the following Java option: -Duser.home=<user-home>
  6. Create the JasperReports Server database and deploy the JasperReports Server web app: $<js-install>/buildomatic /js-install.sh minimal
  7. Copy the following JasperReports Server repository files and key files from the WorldServer distribution kit (integrations/JasperSoft_<version>/jasperreports-server-repository) to the <js-install> directory:
    • Oracle: FullRepo_WorldServerOra.zip, FullRepo_WorldServerOra_Key.txt
    • SQL Server: FullRepo_WorldServerSql.zip, FullRepo_WorldServerSql_Key.txt
  8. Import the WorldServer repository resources:
    1. Open the appropriate FullRepo_WorldServer*_key.txt file and copy the secret key.
    2. Run the full import command and make changes as appropriate:
      $cd  <js-install>/buildomatic
      
      $./js-import.sh  --update  --input-zip <js-install>/FullRepo_WorldServer(sql or ora).zip   --secret-key "<paste-key-here>"
  9. Go to <js-install>/Reports/tomcat/webapps/jasperserver-pro/WEB-INF and open the applicationContext-worldserver.xml file with a text editor. In the applicationContext-worldserver.xml file, configure the wsLoginUrl and wsRestAuthUrl properties as follows:
    <property name="wsLoginUrl">
        <value><ws-protocol>://<ws-host>:<ws-port>/ws-legacy/login</value>
    </property>
    <property name="wsRestAuthUrl">
        <value><ws-protocol>://<ws-host>:<ws-port>/ws-api/v2/login/checkToken</value>
    </property>
    In this case, <ws-protocol> is the protocol on which WorldServer is installed (http or https), <ws-host> is the name or the IP address of the machine on which WorldServer is installed, and <ws-port> is the number of the port on which WorldServer is installed. Save and close the applicationContext-worldserver.xml file when finished.
  10. Go to <js-install>/Reports/tomcat/webapps/jasperserver-pro/WEB-INF and open the applicationContext-security-pro-web.xml file with a text editor. In the applicationContext-security-pro-web.xml file, add the WorldServer domain as allowed to the additionalWhitelistAttributes property:
    <property name="additionalWhitelistAttributes">
    	...
    	<list>
    		<value><ws-protocol>://<ws-host>:<ws-port></value>
    	</list>
    </property>
    Save and close the applicationContext-security-pro-web.xml file when finished.
  11. On the WorldServer installation machine, go to the path where the WorldServer configuration files are stored and create a file called reports.properties. Add the following properties:
    • report_center_url=http://<jasper-host>:<jasper-port>/<webAppNamePro-value>/flow.html?_flowId=searchFlow&mode=search&filterId=resourceTypeFilter&filterOption=resourceTypeFilter-reports, where <jasper-host> is the name or the IP address of the machine on which JasperReports Server is installed, <jasper-port> is the number of the Tomcat port on which JasperReports Server is installed, and <webAppNamePro-value> is the value of the webAppNamePro property in the default_master.properties file (see step 5c). By default, the value of this property is jasperserver-pro.
    • ws_dashboard_url=http://<jasper-host>:<jasper-port>/<webAppNamePro-value>/dashboard/viewer.html?viewAsDashboardFrame=true#/Dashboards/WSDashboard, where <jasper-host> is the name or the IP address of the machine on which JasperReports Server is installed, <jasper-port> is the number of the Tomcat port on which JasperReports Server is installed, and <webAppNamePro-value> is the value of the webAppNamePro property in the default_master.properties file (see step 5c). By default, the value of this property is jasperserver-pro.
    • web_app_name=<webAppNamePro-value>, where <webAppNamePro-value> is the value of the webAppNamePro property in the default_master.properties file (see step 5c). By default, the value of this property is jasperserver-pro.
    Save and close the reports.properties file when finished.
  12. Restart WorldServer.
  13. Restart the Tomcat server or service used by JasperReports Server: $service tomcat start
  14. Configure the WorldServer data source in JasperReports Server:
    1. Log in to WorldServer and go to Tools > Report Center.
    2. In the WorldServer Report Center, select View > Repository, and then, in the Folders tree, go to <root> > Organizations > WorldServer > DataSources.
    3. Select WorldServerDB, and then select Edit.
    4. In the Set Data Source Type and Properties page, specify the following information:
      FieldValue
      JDBC Driver (required)One of the following:
      • Microsoft SQL Server (tibcosoftware.jdbc.sqlserver.SQLServerDriver)
      • Oracle (tibcosoftware.jdbc.oracle.OracleDriver)
      Host (required)The name or IP address of the machine on which WorldServer is installed.
      Port (required)The port on which WorldServer is installed.
      Database (required) (for Microsoft SQL Server) or Service (required) (for Oracle)The database name (for Microsoft SQL Server) or the cluster/SID (for Oracle).
      URL (required)The URL is generated automatically based on the values you entered in the previous fields. The structure of the URL is as follows:
      • Microsoft SQL Server: jdbc:tibcosoftware:sqlserver://<db-host-name>:<port>;DatabaseName=<ws-database-name>
      • Oracle: jdbc:tibcosoftware:oracle:@<db-host-name>:<port>:<SID>
      User NameThe user name that will be used to log in to the database.
      PasswordThe password that will be used to log in to the database.
    5. Select Test Connection, and then select Save.

Results

At this point, you should be able to see the reports from Tools > Report Center in WorldServer. Also, the dashboard should be displayed on the Home page in WorldServer Classic.