How Can We Help?
Installing Pure on LinuxInstalling Pure on Linux
This guide describes how to install Pure on Linux, and it assumes that you have a basic knowledge of Linux.
Java and Tomcat will be installed manually, but you can also install them using your distributions package manager as long as the correct versions are available.
Tomcat will be setup to run as a non privileged user running on port 8080. If you want Tomcat to run on port 80, or need HTTPS, it is recommended to use an Apache HTTPD or similar as a proxy server in front of Tomcat. See the Reverse proxy documentation for more information.
Please notice that there are some requirements for Pure regarding Java, tomcat and databases. You will find information about these here: Pure requirements
Users
Create a tomcat user to run the Tomcat server
sudo useradd -r -U tomcat
This will create a tomcat system user with the default group tomcat.
If you are installing Tomcat using your Linux distributions package manager it will most likely create this user for you.
Paths
First create the paths needed for the Pure installation. The paths used here are the default paths used by Atira, but you can change them to match your system.
sudo mkdir -p /data/pure_data sudo mkdir /data/tomcat_base sudo mkdir -p /pack/scripts sudo mkdir -p /pack/software sudo chown -R tomcat:tomcat /data /pack
/data/pure_data: This is used by Pure to store the run-time data, the search index, and any files uploaded to Pure.
/data/tomcat_base: This is used for the Tomcat "Catalina Base" directory. This is where the Tomcat configuration, logs files, and deployed Pure webapps will be.
/pack: This is used for the Tomcat and Java installation.
/pack/scripts: This is used for the Pure deploy script and Pure configuration files
/pack/software: This is used for Java and Tomcat
If you are installing Tomcat using your Linux distributions package manager you can skip the /data/tomcat_base folder.
Java
Install a Supported version of Java, either a OpenJDK offered by the package manager on your Linux distribution or download and install the version supported by Oracle.
If you want to perform a manual install of Java we recommend that you unpack it in /pack/software and create a symbolic link to make it easier to upgrade later. The example here is using Java 11.
cd /pack/software sudo tar zxf /tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14.1_1.tar.gz cd /pack sudo ln -s /pack/software/jdk-11.0.14.1+1 jdk11
Tomcat
This step can be skipped if you installed Tomcat through your Linux distributions package manager
Go to tomcat.apache.org and download the Core tar.gz file. See Supported platforms for a list of supported versions.
Unpack it in /pack/software and create a symbolic link to make it easier to upgrade later. The example here is using Tomcat 9.
cd /pack/software sudo tar zxf /tmp/apache-tomcat-9.0.58.tar.gz cd /pack sudo ln -s /pack/apache-tomcat-9.0.58 tomcat9
Now we need to copy the needed folders from the Tomcat installation to the folder /data/tomcat_base
cd /pack/tomcat9 sudo cp -r conf logs temp webapps work /data/tomcat_base/. sudo chown -R tomcat:tomcat /data/tomcat_base/logs /data/tomcat_base/temp /data/tomcat_base/work sudo chmod -R ug+rw /data/tomcat_base sudo chmod -R o-w /data/tomcat_base sudo chmod o+r /data/tomcat_base/conf/*
Server.xml
Open the Tomcat server.xml file in an editor (emacs / vi / nano / etc.)
sudo emacs /data/tomcat_base/conf/server.xml
If you installed Tomcat through your Linux distributions package manager, the server.xml file will most likely be located in /etc/tomcat, but it could also be in something like /var/lib/tomcat, /opt/tomcat, /usr/share/tomcat, or /srv/tomcat
Find the HTTP and AJP connectors
< Connector port = "8080" protocol = "HTTP/1.1"
connectionTimeout = "20000"
redirectPort = "8443" />
... <!-- Define an AJP 1.3 Connector on port 8009 --> <!-- <Connector protocol="AJP/1.3" address="::1"
port="8009"
redirectPort="8443" />
--> |
You can skip configuring the AJP connector if you are not planning to use it. If you are planning to use the AJP connector from something other than localhost, also change the address parameter to "0.0.0.0". If you are not planning to use the secret for AJP, you can change the secretRequired to false.
and configure them like this
< Connector port = "8080" protocol = "HTTP/1.1"
connectionTimeout = "20000"
URIEncoding = "UTF-8"
relaxedQueryChars = "^{}[]|"
redirectPort = "8443" />
... <!-- Define an AJP 1.3 Connector on port 8009 --> < Connector protocol = "AJP/1.3"
address = "::1"
port = "8009"
connectionTimeout = "20000"
URIEncoding = "UTF-8"
secretRequired = "true"
secret = "mySecret"
redirectPort = "8443" />
|
Tomcat startup script
Elsevier script
If you installed Tomcat using your Linux distributions package manager, skip this section and look at dist_init_script
We provide a SysV init script and Systemd service file for Tomcat.
Please refer to the Tomcat command-line parameters page for details on the required, recommended and optional JVM parameters.
SysV Init
Download the tomcat script, and copy it to /etc/init.d
sudo mv /tmp/tomcat /etc/init.d/tomcat sudo chown root:root /etc/init.d/tomcat sudo chmod a+rx /etc/init.d/tomcat
Now open the tomcat script in an editor
sudo emacs /etc/init.d/tomcat
The comments in the files should explain how the variables should be configured.
The following variables needs to point to your Java and Tomcat folders:
# Tomcat home dir where the start script and general Tomcat libs are export CATALINA_HOME=/pack/tomcat9
# Java home - only to be specified if Java is installed manually export JAVA_HOME=/pack/jdk11
|
The JAVA_HOME parameter should only be set if you have installed Java manually.
You might also want to change the "MEM_OPTIONS" variable, as it defaults to the absolute minimum that Pure will run with.
Systemd
Download the following 3 scripts and copy them into the correct folders: tomcat.service, tomcat.conf, tomcat_pre_start.sh
sudo mv /tmp/tomcat.service /etc/systemd/system/tomcat.service sudo chown root:root /etc/systemd/system/tomcat.service mv /tmp/tomcat.conf /pack/scripts/tomcat.conf chown tomcat:tomcat /pack/scripts/tomcat.conf chmod 0644 /pack/scripts/tomcat.conf mv /tmp/tomcat_pre_start.sh /pack/scripts/tomcat_pre_start.sh chown tomcat:tomcat /pack/scripts/tomcat_pre_start.sh chmod 0744 /pack/scripts/tomcat_pre_start.sh
Now open tomcat.conf in an editor
sudo emacs /pack/scripts/tomcat.conf
Make sure the differents patsh are correct for your system. This is also where you can tweak the memory setting and other command line configurations for Pure.
Then we should edit the tomcat_pre_start.sh in and editor.
sudo emacs /pack/scripts/tomcat_pre_start.sh
This file is run by Systemd just before it starts Tomcat. It will backup old log files and do some cleanup of old files. The primary thing to check here is if you want old Tomcat log files to be backed up.
Now edit the tomcat.service file in an editor
sudo emacs /etc/systemd/system/tomcat.service
Make sure the paths are correct for your system.
Now reload the Systemd daemon to pickup the new service
sudo systemctl daemon-reload
Distribution provided script
If you installed Tomcat manually it is recommended to use the Atira init script
You will need to set some extra options for Pure to work correctly.
This should be set in the JAVA_OPTS
variable in the Tomcat configuration, the is most likely found in /etc/default/tomcat or /etc/tomcat/tomcat.conf. It can also be set in the setenv.sh
file in the Tomcat bin folder.
The example here is set to 4 GB memory which is the recommended minimum, so you might want to set it higher.
JAVA_OPTS="-Xms4G -Xmx4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/somewhere/with/a/lot/space"
For a list of all the possible command line parameters supported by Pure see Tomcat command-line parameters
Database Connection Configuration
The database connection needs to be configured as command line parameters for Tomcat. These should be set in the JAVA_OPTS
variable, but if you are using the Atira init script, you can use the DATABASE_OPTS
variable to specify them.
You can set the parameters directly, or you can put them in a properties files, and then reference than instead. The primary difference is that if you set the parameters directly you might be able to see the username and password for the database in the process list on the server.
Setting the parameters directly
If you want to set the parameters directly, add the following to JAVA_OPTS
or DATABASE_OPTS
-Ddb.user=user -Ddb.password=password -Ddb.url=database_url
For examples of database URLs see Pure database URL
Setting the parameters using a properties file
To configure the database connection using a properties file, add the following to JAVA_OPTS
or DATABASE_OPTS
-DpropFile=/pack/scripts/startup.properties |
Create the properties file in /pack/scripts/ and edit it.
emacs /pack/scripts/startup.properties
And add the following:
db.user=user db.password=password db.url=database_url |
For examples of database URLs see Pure database URL
Deploy script
We supply a script to help deploy Pure to Tomcat. This is not required, but we recommend using it, or that you create your own similar script.
Download the deploy script and copy it to /pack/scripts and make it executable
sudo cp /tmp/deploy /pack/scripts/deploy sudo chmod ug+x /pack/scripts/deploy
Open the script in an editor
sudo emacs /pack/scripts/deploy
Check that the configuration values at the top of the scripts are correct compared to your system.
The comments in the files should explain how the variables should be configured.
For information about how to deploy Pure manually see Manual Pure deployment on Linux
Deploy Pure
Download the Pure distribution file and run the deploy script with this file
sudo /pack/scripts/deploy /tmp/cust-dk-abc-5.2.0-distribution.tar.gz
Create the database
If you have not already created the database and user for Pure, it should be created now.
Make sure that you have set up the requirements for the selected database: Pure Requirements#Database
Start Pure
You can now start Pure using the init script
sudo /etc/init.d/tomcat start
or Systemd
sudo systemctl start tomcat
Check the Tomcat log file to make sure that it starts correctly
less /data/tomcat_base/logs/console.log
If you installed Tomcat using your Linux distributions package manager, the log files will most likely be located in /var/log/tomcat and named catalina.out
Pure maintenance page
Next we need to access the maintenance page: Pure maintenance mode (installation)
Updated at July 27, 2024