JSE/Apache Tomcat: Web Services API Installation
LeasePak Documentation Suite NETSOL website
Web Services API (mPower) Server

Web Services API symbol Web Services API (mPower) Server

JSE/JBoss: Web Services API Installation


Note Level 1 This document assumes you have a working knowledge of JSE and JBoss. Contact your NetSol representative for more information.

JSE Installation and Configuration

To install, refer to Java SE Platform Installation and follow the instructions specific to your operating system.

Installation of JBoss Web Server on Red Hat Enterprise Linux

Pre-requisite

Before installing JBoss Web Server, you must first install a supported Development Kit (JDK).

Operating System Chipset Architecture Java Virtual Machine
Red Hat Enterprise Linux 8 x86_64 OpenJDK 8, OracleJDK 8


Execute

sudo yum install java-8-openjdk

to install JDK 8 as a root user.

Download and Extract JBoss Web Server

To install JBoss Web Server, download and extract the installation ZIP files. Following are the steps:

  1. Log in to the Red Hat Customer Portal
  2. Go to Downloads
  3. Select Red Hat JBoss Web Server in the Product Downloads list.
  4. Select the correct JBoss Web Server version from the Version drop-down menu.
  5. Download for each of the following files, ensuring the selection of correct platform and architecture for your system:
    • The Red Hat JBoss Web Server 5.5 Application Server (jws-5.5.0-application-server-RHEL8-x86_64.zip).
    • The Red Hat JBoss Web Server 5.5 Native Components for RHEL (jws-5.5.0-application-server.zip).
  6. Unzip the downloaded ZIP files to your installation directory.

    unzip jws-5.5.0-application-server-RHEL8-x86_64.zip -d /opt/

    unzip -o jws-5.5.0-application-server.zip -d /opt/

    The directory created by extracting the ZIP archieves is the top-level directory for JBoss Web Server. This is referred to as /opt/jws-5.5.

Setting the JAVA_HOME Environment Variable

Setting JAVA_HOME environment variable for Tomcat before running JBoss Web Server.

  1. Create a file named setenv.sh in the bin directory of Tomcat (/opt/jws-5.5/tomcat/bin)
  2. Insert the JAVA_HOME path definition.

    For example: export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.432.b06-2.el8.x86_64

Create Tomcat User

Follow this procedure to create tomcat user and its parent group:

  1. In a shell prompt as a root user, change directory to /opt/jws-5.5.
  2. Execute following command to create tomcat user group:
    groupadd -g 53 -r tomcat
  3. Execute following command to create tomcat user in the tomcat user group:
    useradd -c "tomcat" -u 53 -g tomcat -s /bin/sh -r tomcat
Move the ownership of tomcat directory to the tomcat user

  1. Execute
    chown -R tomcat:tomcat tomcat/

    from /opt/jws-5.5 to assign the ownership of the Tomcat directories to the tomcat user that allows a user to run Tomcat service.
  2. Ensure that the tomcat user is permitted to all parent directories. If not then execute permissions first For example:
    chmod -R u+X tomcat/
Setting up and using the JBoss Web Server with system

As a root user, execute .postinstall.systemd script:

cd /opt/jws-5.5/tomcat
sh .postinstall.systemd

Edit jws5-tomcat-service

Edit following changes in jws5-tomcat.service.

  1. cd /usr/lib/systemd/system
  2. nano jws5-tomcat.service

    See below image for details to edit the file.

edit jws5 tomcat service

Controlling the JBoss Web Server with systemd

Systemd commands can only be issued by the root user.

  1. To enable the JBoss Web Server services to start at boot using systemd:

    systemctl enable jws5-tomcat.service
  2. To start the JBoss Web Server using systemd:

    systemctl start jws5-tomcat.service
  3. To stop the JBoss Web Server using systemd:

    systemctl stop jws5-tomcat.service
  4. To verify the status of the JBoss Web Server using systemd (the status operation can be executed by any user):

    systemctl status jws5-tomcat.service
  5. Information note:  By default JBoss Web server listen on port 8080. Paste the URL http://ipaddress:8080 in browser to confirm.

    Jboss Web Server Redirection to Port 8443:

    To redirect Jboss web server from port 8080 to 8443 we need to create certificate in jks format and edit server.xml file.

    1. Certificate Creation (jks Format):
      keytool -genkey -alias tomcat -keyalg RSA -keystore "/opt/jws-5.5/tomcat/conf/nutcannon2.jks"

    2. Edit server.xml file:
      cd /opt/jws-5.5/tomcat/conf/
      vi server.xml

      add connector for port 8443 in server.xml file.
             <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
                     maxThreads="150" SSLEnabled="true">
              <SSLHostConfig>
                  <Certificate certificateKeystoreFile="/opt/jws-5.5/tomcat/conf/nutcannon2.jks" certificateKeystorePassword="changeit" Alias="tomcat"
                               type="RSA" />
              </SSLHostConfig>
          </Connector>
      		

      JBoss Web Server Redirection to Port 8443

    3. Restart JBoss Web Server service.
      Systemctl restart jws5-tomcat-service

    Where nutcannon2 is the name of the jks file created in this step.

    Install Apache Web Server front-end and mod-ssl:

    yum -y install httpd openssl openssl-devel mod_ssl

    Apache Web Server:

    Use valid CA certificate and place on this location /etc/httpd/ssl

    Modify the /etc/httpd/ssl.conf file for httpd
    vi /etc/httpd/conf.d/ssl.conf
    * Set the server name 
    ServerName hostname:443
    * Set stronger ssl/cipher strength
    	SSLProtocol -All +TLSv1.2
    	SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-> 
    * Point to valid CA certifica
    Line 88:
    	SSLCertificateFile /etc/httpd/ssl/apache.crt
    
    Line 96:
    	SSLCertificateKeyFile /etc/httpd/ssl/apache.key
    

    Warning note: Use CA certificate name which you have placed in above directory.

    Create new file for httpd to perform vhost redirection:

    vi /etc/httpd/conf.d/vhost_redir.conf
    
    <VirtualHost *:80>
       ServerName hostname
       Redirect permanent / https://hostname/
    </VirtualHost>
    
    

    Startup and Shutdown Scripts

    If you install JBoss directly (for example, using tar instead of the RPM or package installer), you may just have the script files startup.sh and shutdown.sh in the directory /opt/jws-5.5/tomcat/bin directory. In this case, you will need to use export or setenv to set values for JAVA_HOME and JAVA_OPTS before using these scripts. Contact your NetSol representative for assistance if needed.

    Web Services API Installation

    To install the mPower software:

    1. Stop Tomcat if it is running using service jws5-tomcat.service stop.
    2. Copy the file mpower-v77a.war to the /opt/jws-5.5/tomcat/webapps directory. .
    3. Start the service it will extract the WAR file in the same directory.