Page 1 of 3

Deploying Unimus in Tomcat (or other application servers)

Posted: Sat Jun 25, 2016 11:23 pm
by Tomas
This article assumes that you already have Java (JRE) installed on your machine.
We support any Java Application Server, not just Tomcat. This short tutorial will use Tomcat for the remainder of the article.

You can install Tomcat directly from:
http://tomcat.apache.org/download-80.cgi

Additionally, many Linux distributions contain Tomcat in their package repositories.
You can also install Tomcat from there.

Please note that Unimus creates '/etc/unimus' ('C:\ProgramData\Unimus' on Windows) directory to keep its configuration file in. Please make sure that the user your Tomcat runs under has access to this directory. You can create '/etc/unimus' (or its Windows equivalent) manually and assign rights to your Tomcat user. Final configuration file is '/etc/unimus/unimus.properties'

Example on how to configure this on Linux (change "tomcat" user to the right one if required):

Code: Select all

mkdir /etc/unimus
chown tomcat:tomcat /etc/unimus
touch /etc/unimus/unimus.properties
chown tomcat:tomcat /etc/unimus/unimus.properties
After installing Tomcat (or your chosen application server), simply deploy the .war distribution of Unimus and navigate to the appropriate URL. You can deploy using the Manager app, or manually into the "webapps" directory.
After deployment, you should also see in your Tomcat logs that Unimus started as is running.

If you are using the Tomcat Manager app, there is an additional step that needs to be performed. By default, the Manager app has a limitation of 50MB .war files. You can change this in ".../webapps/manager/web.xml"

Change this section:

Code: Select all

    <multipart-config>
      <!-- 50MB max -->
      <max-file-size>52428800</max-file-size>
      <max-request-size>52428800</max-request-size>
      <file-size-threshold>0</file-size-threshold>
    </multipart-config>

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 4:05 am
by jermudgeon
This may be slightly out of scope, but for quick-and-dirty I spun up Bitnami/Tomcat on Google and got the following failures:

http://pastebin.com/cdM0vwEw

max-file and request size are 83886080

Going to try AWS next.

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 10:00 am
by Tomas
jermudgeon wrote:This may be slightly out of scope, but for quick-and-dirty I spun up Bitnami/Tomcat on Google and got the following failures:

http://pastebin.com/cdM0vwEw
As a part of the first startup, Unimus creates a configuration file in '/etc/unimus/unimus.properties' (and on later startups loads its configuration from it).
It seems Google is not allowing us to create the '/etc/unimus/' directory, so of course creating the '/etc/unimus/unimus.properties' file fails.

Do you know if this is a Google restriction?

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 12:04 pm
by squeezypiano
I have run the .exe on my desktop and it is look great, thanks. However, when I try to use the WAR in Tomcat (Tomcat7 on a clean Ubuntu 14.04 server, downloaded the file, dropped it in /webapps and let it expand itself as I would with any other WAR) but only get a 404 error when browsing to it. Any suggestions, please?

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 12:32 pm
by Tomas
squeezypiano wrote:I have run the .exe on my desktop and it is look great, thanks. However, when I try to use the WAR in Tomcat (Tomcat7 on a clean Ubuntu 14.04 server, downloaded the file, dropped it in /webapps and let it expand itself as I would with any other WAR) but only get a 404 error when browsing to it. Any suggestions, please?
Tomcat 7 is supported, but Java 8 is required (and the Tomcat must be running using JRE 8).

Are you running Java 7 or Java 8?
Are there any erros in catalina.out or other Tomcat logs?

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 1:26 pm
by squeezypiano
Hi Tomas,

Yes, Tomcat is running JRE 8. The log looked much the same as jermudgeon's so I manually created /etc/unimus, chown'd it to the tomcat user and restarted Tomcat. Working a treat now.

Many thanks.

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 08, 2016 6:16 pm
by Tomas
squeezypiano wrote:Hi Tomas,

Yes, Tomcat is running JRE 8. The log looked much the same as jermudgeon's so I manually created /etc/unimus, chown'd it to the tomcat user and restarted Tomcat. Working a treat now.

Many thanks.
It might be that the user that Tomcat runs under by default doesnt have access to '/etc', so creating a directory in there fails.

I will add it to the top post, that will hopefully help others solve this.

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Mon Jul 11, 2016 2:36 am
by jermudgeon
squeezypiano wrote:Hi Tomas,

Yes, Tomcat is running JRE 8. The log looked much the same as jermudgeon's so I manually created /etc/unimus, chown'd it to the tomcat user and restarted Tomcat. Working a treat now.

Many thanks.
Thanks squeezypiano, I'll try this.

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 15, 2016 7:27 am
by SimonK
Hi,
just installed a fresh ubuntu 16 with tomcat 8. all good
did a WAR deploy using web application manager in tomcat. but i cant start unimus.
i have attached a screenshot from web app manager

getting this error on war deploy:
FAIL - Application at context path /Unimus could not be started
FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Unimus]]

Re: Deploying Unimus in Tomcat (or other application servers)

Posted: Fri Jul 15, 2016 8:16 am
by squeezypiano
Have you created the /etc/unimus folder and given permissions for Tomcat to access it? For example...

Code: Select all

mkdir /etc/unimus
chown tomcat7:tomcat7 /etc/unimus