Deploying Unimus in Tomcat (or other application servers)

Unimus support forum
User avatar
Tomas
Posts: 1269
Joined: Sat Jun 25, 2016 12:33 pm

Sat Jun 25, 2016 11:23 pm

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>
jermudgeon
Posts: 4
Joined: Thu Jul 07, 2016 9:23 pm

Fri Jul 08, 2016 4:05 am

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.
User avatar
Tomas
Posts: 1269
Joined: Sat Jun 25, 2016 12:33 pm

Fri Jul 08, 2016 10:00 am

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?
squeezypiano
Posts: 6
Joined: Thu Jul 07, 2016 9:11 pm
Location: Scotland

Fri Jul 08, 2016 12:04 pm

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?
User avatar
Tomas
Posts: 1269
Joined: Sat Jun 25, 2016 12:33 pm

Fri Jul 08, 2016 12:32 pm

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?
squeezypiano
Posts: 6
Joined: Thu Jul 07, 2016 9:11 pm
Location: Scotland

Fri Jul 08, 2016 1:26 pm

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.
User avatar
Tomas
Posts: 1269
Joined: Sat Jun 25, 2016 12:33 pm

Fri Jul 08, 2016 6:16 pm

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.
jermudgeon
Posts: 4
Joined: Thu Jul 07, 2016 9:23 pm

Mon Jul 11, 2016 2:36 am

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.
SimonK
Posts: 5
Joined: Fri Jul 15, 2016 7:23 am

Fri Jul 15, 2016 7:27 am

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]]
Attachments
Tomcat8 - web screenshot.jpg
Tomcat8 - web screenshot.jpg (106.87 KiB) Viewed 18304 times
squeezypiano
Posts: 6
Joined: Thu Jul 07, 2016 9:11 pm
Location: Scotland

Fri Jul 15, 2016 8:16 am

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
Post Reply