Info |
---|
Unix/ Linux installation: these instructions guide you to setting up tomcat to run as a service under the classic init mechanism on unix/ linux (System V) since this will be available on all platforms, but you should consider using Upstart, a more modern init mechanism that will be available on most modern unix/ linux distributions. Installation using upstart is widely covered on the web. Further, at some versions of tomcat, on certain unix/ linux versions, a complete tomcat installation can be performed using a few simple package commands. Before you begin, a web search for tomcat installation at the desired version of tomcat, on the installed version of your unix/ linux distribution, may give you a much simpler installation method. However you install tomcat, please note the settings that are needed under configuring tomcat |
Download
The System Administrator should have set up a linked directory structure like [c:]/opt/tomcat. The details of this may differ between installations so from this point on, the “root” Tomcat tomcat directory will be referred to as $TOMCAT.
Download the appropriate version of Tomcat 8.0 from tomcat.apache.org and unpack (unzip/uncompress) into the $TOMCAT. (Refer to Compatibility Guide and Upgrade Planning for supported versions).
Install
Installing on Unix / Linux
Tomcat login scripts
Install the login scripts in Appendix A Some instructions are given here for installing tomcat, and making it run as a service. You should ensure that any installation meets with your company standards.
Installing on windows
Run the tomcat installation program.
Installing on unix/ linux
Install the login scripts in tomcat login scripts into the tomcat user home directory. These scripts are correct as of Tomcat 8.0 but the PhixFlow consultant you should confirm that no changes are needed because of environment differences or because of different version of Tomcat.
Installing on Windows
Run the tomcat installation program.versions of tomcat.
Anchor | ||||
---|---|---|---|---|
|
context.xml: cache settings
The default Tomcat cache settings are insufficient for PhixFlow:
Add <Resources ... /> to at the end of the <Context/> block in context.xml so that the file looks something like this:
Code Block | ||
---|---|---|
| ||
<Context>
<!-- lines omitted -->
<Resources cachingAllowed="true" cacheMaxSize="1000000" />
</Context> |
server.xml:
...
Connector settings
Edit the <Connector block in $TOMCAT/conf/server.xml to specify the port that PhixFlow will use (usually 8081). Find the following lines and change as needed:
...
to:
- Use the required port number (port="8080"). Tomcat defaults to port 8080 for HTTP, but you may need to use a different port if you are running other web servers on the same host.
- Enable compression (compression="force"). Compressing responses from the server is particularly important if you are going to access the PhixFlow server over a slow connection (e.g. a mobile data connection).
After editing, the <Connector/> block should look like this:
Code Block | ||
---|---|---|
| ||
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> |
...
<Connector |
...
port="8081"
...
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
compress="force"/> |
Remember to enable this port in the server’s firewall (if enabled).
...
Modify $TOMCAT/conf/web.xml to change the Tomcat session timeout period from its default value (30 mins). Find the following lines and change as needed:
Code Block | ||
---|---|---|
| ||
<session-config> |
...
<session- |
...
timeout>720</session-timeout> |
...
</session-config> |
Update <session-timeout> to the value you need, e.g. to 1440 720 (minutes i.e. 1 day12 hours).
Java and JVM Options
Download and install Java from java.com. Java JDK 1.8 is required (and version 1.8.0_74 or greater is recommended). The following JVM (Java Virtual Machine) options should be set to control (amongst other things) the amount of memory reserved for Tomcat and therefore made available for PhixFlow. The options are:
Option | Recommended Setting | Syntax | |||
Initial Memory Pool | 1024Mb on 32bit architecture. 40% of physical memory on x64 architecture. Consult your sys admin for recommended settings on virtual servers. | -Xms1024m | |||
Max Memory Pool | As much as possible. 1024Mb on 32bit architecture. 75% of physical memory on x64 architecture. Consult your sys admin for recommended settings on virtual servers. | -Xmx1024m | Max PermGen Memory Pool | 150Mb on 32bit. 1024Mb on x64. | -XX:MaxPermSize=150m |
Garbage Collector Diagnostics | Enabled | -verbose:gc |
...
Disable direct GUI access | Some JDBC (database) drivers generate warning messages direct to the screen if running under a GUI (graphical user interface). These messages are confusing at best for a background service such as the PhixFlow web application server, and should be disabled. This setting tells Java to behave as though there were no GUI present. | -Djava.awt.headless=true |
To set JVM options:
Windows |
| |||||
Unix/Linux | If you have installed the scripts in tomcat login scripts, these option will already be set however for clarity, these options are defined in the JAVA_OPTS environment variable set in the tomcat user’s shell startup file (e.g. .profile / .bash_profile / .cshrc in the user’s home directory – the actual startup file is determined by the user’s default shell settings).
|
Database JDBC Drivers
The drivers needed to connect to PhixFlow’s own database are now included in within the release and do not have to be downloaded separatelypack and no action is needed.
Drivers used to connect to external databases may still have to be downloaded.
For information on using SQLServer with Integrated Authentication, see Appendix B SQLServer Integrated Authentication.
Start Tomcat
To start Tomcat:
Windows | Run the Tomcat Monitor. Click on Right mouse menu -> Start Service | ||||||
Unix | Login to the unix server as user tomcat.
|
To make Tomcat start automatically when the server boots:
Make tomcat run as a service
Windows
- Run the Tomcat Monitor.
- Right click on the Apache Tomcat icon in the system tray and select Configure …
- On the ‘General’ tab:
- Set Startup Type to Automatic.
Unix/ Linux
As the root user, install the
...
tomcat script listed
...
in tomcat service scripts and create a
...
soft link to it from the appropriate run-level directory. The actual run-level directories are specific to the particular unix variant.
...
You may wish to install tomcat to support secure connections over SSL.
This is described in the standard tomcat documentation - for example https://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html - but some notes are given here to get you started.
Type of certificate
If access to PhixFlow is only intended for people in your organisation, you may wish to create a self-signed certificate. This still provides a secure connection, but this will generate security warnings when users first connect, and they will not see a padlock in the address bar of their browser. If this is not acceptable to your users or by your company policy, or if you are going to provide access to people outside your organisation, you should obtain your certificate from a certificate authority (CA).
Both approaches are well documented on the web. For example:
Generate a self-signed certificate on ubuntu: https://help.ubuntu.com/14.04/serverguide/certificates-and-security.html.
From the website of a certificate authority: a list of these is given on https://en.wikipedia.org/wiki/Certificate_authority.
Info |
---|
Two example installations are given here: a self-signed certificate on ubuntu, and a self-signed certificate on windows. There are the two commonest platforms for PhixFlow, and the instructions are provided to help you set PhixFlow up quickly to operate securely over with HTTPS. Please remember that these are examples only - your organisation may have standards that apply to certificate installation and use, you may need to use certificates from a certificate authority (CA). If you need to use certificates from a CA and there are no special standards in your organisation that apply to the installation process, you can review the example installations below, following special steps where indicated for CA certificates. |
Overview
All installations process will contain the steps:
- Obtain a certificate - whether self-signed or from a certificate authority
- Create a keystore
- Tell tomcat where to find the keystore
Install certificate
The rest of these instructions assume that:
- you have a certificate file and private key - either a self-signed certificate you have generated, or obtained from a certificate authority
- the private key password, if you specified one
- if you obtained your certificate from a certificate authority, any intermediate certificates representing the chain of authenticating certificates up to a root certificate; your certificate authority should provide instructions for obtaining these
Linux
- Copy the private key to /etc/ssl/private, e.g.
Code Block |
---|
sudo cp server.crt /etc/ssl/certs |
- Copy the certificate to /etc/ssl/certs, e.g.
Code Block |
---|
sudo cp server.key /etc/ssl/private |
Windows