JasperReports Server & Linux CentOS

I’ve recently installed JasperReports Server (release Community Project 4.2.1) on Linux CentOS, so I would like to talk about some issues I’ve been dealing with.

First of all, I have to write about a JRStyledTextParser exception that I got and didn’t have on Microsoft Windows. Once more a forum post was the beginning of the solution, so I edited the file $JASPERSERVER_HOME/apache-tomcat/scripts/clt.sh and set the property java.awt.headless=true:

export JAVA_OPTS="-Djava.awt.headless=true ..."

I wanted to run JasperServer as a service so I had to code the following script in /etc/init.d:

#!/bin/bash
#
# jasperserver        
#
# chkconfig: 2345 95 15
# description: Script de inicio de JasperReports Server

RETVAL=$?
JASPERSERVER_HOME="/jaspersoft/jasperreports-server-cp-4.2.1"

case "$1" in
 start)
        if [ -f $JASPERSERVER_HOME/ctlscript.sh ];
          then
            echo $"Starting JasperReports Server"
            /bin/su - jasperadmin -c "$JASPERSERVER_HOME/ctlscript.sh start"
        fi
        ;;
 stop)
        if [ -f $JASPERSERVER_HOME/ctlscript.sh ];
          then
            echo $"Stopping JasperReports Server"
            /bin/su - jasperadmin -c "$JASPERSERVER_HOME/ctlscript.sh stop"      
        fi
        ;;
 restart)
        if [ -f $JASPERSERVER_HOME/ctlscript.sh ];
          then
            echo $"Restarting JasperReports Server"
            /bin/su - jasperadmin -c "$JASPERSERVER_HOME/ctlscript.sh restart"
        fi
        ;; 
 status)
        if [ -f $JASPERSERVER_HOME/ctlscript.sh ];
          then
            /bin/su - jasperadmin -c "$JASPERSERVER_HOME/ctlscript.sh status"      
        fi
        ;;
 *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac

exit $RETVAL

After that, I added the service:

chmod 755 jasperserver
chkconfig --add jasperserver

Finally, I used a specific user jasperadmin as the owner of JasperServer software, this user could not open the restricted ports 80 and 443 (I needed HTTPS), so I set up Apache to act as a proxy, adding this line to the httpd.conf configuration file:

ProxyPass / ajp://jasperserver.test.local:8009/

I hope that my experience will be useful for you!

Advertisements

One Comment on “JasperReports Server & Linux CentOS”


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s