The recommended and tested platform is RHEL/CentOS 6.5
These instructions are for installing version 3.3 of OpenClinica, and also apply to installing the maintenance releases of 3.3 for example 3.3.1. When you see v.x or v.x.y in the instructions, use your version number, e.g. 3.3.1.
Overview of Installation on Linux Systems
Use the following process to acquire, install, and configure OpenClinca and its software dependencies. In each step, click the link to view detailed instructions for that step:
- Ensure your operating system meets the specified requirements
- Download the installation files
- Install Java
- Install Tomcat
- Install PostgreSQL database
- Set up the PostgreSQL database
- Deploy OpenClinica within Tomcat
- Set Tomcat to start
- Configure the OpenClinica application
- Restart the system and verify access to OpenClinica
- Configure Tomcat to use HTTPS
- Verify the installation by ensuring you can log in to OpenClinica.
After completing the OpenClinica installation, see the Overview of OpenClinica for instructions to start using the application. A good first step is to define one or more users (especially a Study Director) and then build a Study.
Operating System Requirements
The following packages should be installed for your Operating System:
- vim
- unzip
- tar
You require “root” user access. Run all commands in the installation instructions using root-level permission.
Download Installation Files
OpenClinica and OpenClinica Web Services run and depend on several external software technologies: the Java Development Kit, the Apache Tomcat Servlet Container, and the PostgreSQL relational database
The OpenClinica website has a copy of the neccessary installers for Java, Tomcat, and PostgreSQL for you to download. If you choose to use versions of Java, Tomcat, and PostgreSQL other than those provided on the website, please note that they have not been tested with the OpenClinica application.
There are 32-bit and 64-bit editions of the software, when applicable. To determine if your system is running a 32-bit or 64-bit operating system, in your Linux terminal, run
uname -a
The display reports the version:
- If i386 or i686 displays, it is a 32-bit operating system.
- If x86_64 displays, it is a 64-bit operating system. (Recommended)
To download the installation files:
- Run the following commands to create the OpenClinica directory on your system and to make it the current directory:mkdir -p /usr/local/oc/install
cd /usr/local/oc/install - Run the following commands to download the Java, Tomcat, and PostgreSQL files for your architecture. In the commands, substitute v.x with the version of OpenClinica you are installing ( e.g. 3.1):
- For 32-bit operating systems, to get the files from OpenClinica run:
Apache Tomcat: https://openclinica.app.box.com/oc-downloads/1/2186656927
JDK and Postgres:
https://openclinica.app.box.com/oc-downloads/1/2186650849 - For 64-bit operating systems, to get the files from OpenClinca, run:Apache Tomcat: https://openclinica.app.box.com/oc-downloads/1/2186656927
JDK and Postgres:
https://openclinica.app.box.com/oc-downloads/1/2186651363 - Instead of downloading the files from the above links, you can download them directly from their native websites but those versions may not be explicited tested to work with OpenClinica:
- For 32-bit operating systems, to get the files from OpenClinica run:
- Download the OpenClinica software from the OpenClinica website, using this location:https://community.openclinica.com/project/openclinica. To download the software, you need an OpenClinica community user account, which is free to create; you will be required to log in to the account to download the OpenClinica software.
After downloading the OpenClinica software, move it to the directory where you downloaded the other software components to:
/usr/local/oc/install
Install Java
The OpenClinica software is written in the Java programming language, so you must have Java installed on your system in order to run the OpenClinica application.
- The current directory on your system should be /usr/local/oc/install. If it is not, make it the current directory by running:
cd /usr/local/oc/install
- Install Java by running:
tar -zxvf jdk-7*
Install Java in the operating system by running:
mv jdk1* /usr/local/
ln -s /usr/local/jdk1* /usr/local/java
Java is now installed in the correct location.
Install Tomcat
The OpenClinica software uses the Apache Tomcat Java application server.
- The current directory on your system should be /usr/local/oc/install. If it is not, make it the current directory by running:
cd /usr/local/oc/install
- Install Tomcat by running the following:tar -zxvf apache-tomcat-*
mv apache-tomcat-* /usr/local/
ln -s /usr/local/apache-tomcat-7.0.52 /usr/local/tomcat
/usr/sbin/adduser tomcat - Move the web apps provided with Tomcat that are not needed by OpenClinica to another location by running:
mkdir /usr/local/tomcat/oldwebapps
mv /usr/local/tomcat/webapps/* /usr/local/tomcat/oldwebapps
Tomcat is now installed.
Install PostgreSQL Database
The OpenClinica software uses PostgreSQL as an underlying relational database management system. Complete these instructions to install the PostgreSQL database.
- The current directory on your system should be /usr/local/oc/install. If it is not, make it the current directory by running:
cd /usr/local/oc/install
- Start the PostgreSQL setup by running:
chmod a+x postgresql-8.4.*
./postgresql-8.4.* –mode textThe PostgreSQL Setup Wizard starts.
- For most of the options in the Setup Wizard, accept the defaults. Complete the Setup Wizard as follows:
Prompt Action Installation Directory [/opt/PostgreSQL/8.4] Press Enter to accept. Data Directory [/opt/PostgreSQL/8.4/data] Press Enter to accept. Password Enter a password for the PostgreSQL database superuser, then press Enter. Record the password because you will need it again in this installation. Retype Password Type the password again, then pressEnter. Port [5432] Press Enter to accept. Please choose an option [1] Press Enter to accept. Install pl/pgsql in template1 database? [Y/n] Type n, then press Enter. Do you want to continue? [Y/n] Press Enter to accept. Setup has finished installing PostgreSQL on your computer. Stack Builder may be used to download and install additional tools, drivers and applications to complement your PostgreSQL installation. [Y/n]
Type n, then press Enter.
PostgreSQL is now installed on your system and will start when you start up your system.
Set Up the PostgreSQL Database
Complete these instructions to set up the PostgreSQL database.
- Run the following commands to create the PostgreSQL database and database user OpenClinica uses to connect to the database:
/opt/PostgreSQL/8.4/bin/psql -U postgres -c “CREATE ROLE clinica LOGIN ENCRYPTED PASSWORD ‘clinica’ SUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE”
/opt/PostgreSQL/8.4/bin/psql -U postgres -c “CREATE DATABASE openclinica WITH ENCODING=’UTF8′ OWNER=clinica”
- The database user password is set to clinica by default, which is not a secure password. Change the password as follows:
- Run:
/opt/PostgreSQL/8.4/bin/psql -U postgres
- A psql prompt displays with this message:
ALTER USER clinica WITH PASSWORD ‘XXXX’;
- Replace XXXX with a secure password. Record the password for use in a later installation step.
- Exit the psql prompt by running:
q
- Run:
Deploying OpenClinica within Tomcat
- The current directory on your system should be /usr/local/oc/install. If it is not, make it the current directory by running:
cd /usr/local/oc/install
- Run the following commands. In the commands, v.x is your version of OpenClinica, e.g. 3.2:
unzip OpenClinica-v.x*
cd OpenClinica-v.x*/distribution
unzip OpenClinica.war -d OpenClinica
cp -rf OpenClinica* /usr/local/tomcat/webapps
OpenClinica is now deployed for use with the database.
Deploying OpenClinica Web Services within Tomcat
- The current directory on your system should be /usr/local/oc/install. If it is not, make it the current directory by running:
cd /usr/local/oc/install
- Run the following commands. In the commands, v.x is your version of OpenClinica, e.g. 3.2:
unzip OpenClinica-ws-v.x*
cd OpenClinica-ws-v.x*/distribution
unzip OpenClinica-ws.war -d OpenClinica-ws
cp -rf OpenClinica* /usr/local/tomcat/webapps
OpenClinica web services are now deployed for use with the database.
Set Tomcat to Start
You can set Tomcat to automatically start when you start your system, or you can start and stop Tomcat manually by issuing commands.
To set Tomcat to start automatically on system startup, run the following:
cp /usr/local/oc/install/OpenClinica-v.x*/install-docs/linux/tomcat /etc/init.d/
cd /etc/init.d
chmod a+x /etc/init.d/tomcat
/sbin/chkconfig –add tomcat (Note: This command is only for Red Hat Linux. For other operating systems, see the operating system instructions for adding an init script.)
To stop and start Tomcat manually by issuing commands, run the following:
/usr/local/tomcat/bin/shutdown.sh (stops Tomcat)
/usr/local/tomcat/bin/startup.sh (starts Tomcat)
Configure OpenClinica for Optimum Performance
Under stress tests, OpenClinica 3.1.3 has performed well with the following JVM (Java Virtual Machine) settings:
Edit the init.d/tomcat and replace the JAVA_OPTS with following:
export JAVA_OPTS=”$JAVA_OPTS -Xmx1280m -XX:+UseParallelGC -XX:ParallelGCThreads=n -XX:MaxPermSize=180m -XX:+CMSClassUnloadingEnabled”
For the setting -XX:ParallelGCThreads=n, n should be replaced with the # of cores of your CPU as long as the total number of cores are lesser than 8.
The number of cores can be determined by using ‘top’ command.
Please note that the minimum RAM requirement is 1280 MB of memory for these settings, so the server is expected to have much higher RAM available. The amount of available memory can be determined by using the command free -m to give the memory (in MB). The MaxPermSize value depends on the number of war files that you are deploying. The web war needs a 180m of PermGen and the ws war needs a 90m of PermGen memory settings.
For the settings to take effect, restart the Tomcat server.
Configure the OpenClinica Application
If you followed all the previous instructions exactly, there is only one property in the configuration file, datainfo.properties, that you may need to change in order for OpenClinica to start. There are other properties in the configuration file you will probably want to modify for your system.
- Open the configuration file: /usr/local/tomcat/webapps/OpenClinica/WEB-INF/classes/datainfo.properties
- Edit values for the properties in the datainfo.properties file. You must change the value for dbPass to the password you selected in Set Up the PostgreSQL Database. Change the values for any other properties, then save the file.
- Update the filePath parameter to the right value.
- Run the following commands:
chown -R tomcat /usr/local/tomcat/*
chown -R tomcat /usr/local/apache-* - You may also need to configure OpenClinica for internationalization should you wish to utilize OpenClinica in different languages. Also, if you need to use some UTF-8 characters in your application, you may need to modify your default connecter configuration. For more information regarding configuring OpenClinica for internationalization and using UTF-8 characters, please refer to https://docs.openclinica.com/3.1/technical-documents/openclinica-and-internationalization
Configure the OpenClinica Web Services
If you followed all the previous instructions exactly, there is only one property in the configuration file, datainfo.properties, that you may need to change in order for OpenClinica Web Services to start. There are other properties in the configuration file you will probably want to modify for your system.
Note: Most of the properties are not needed or used for Web Services, see Description of datainfo.properties File for Web Services for more information on what settings are actually used.
- Open the configuration file: /usr/local/tomcat/webapps/OpenClinica-ws/WEB-INF/classes/datainfo.properties
- Edit values for the properties in the datainfo.properties file. You must change all values from Database Configuration section of datainfo.properties file to reflect your settings in datainfo.properties file for OpenClinica application. Change the values for any other properties.
- Run the following commands:
chown -R tomcat /usr/local/tomcat/*
chown -R tomcat /usr/local/apache-*
Verify Access to OpenClinica
At this point, Java, Tomcat, PostgreSQL, and OpenClinica are installed and set up. Restart the system by running:
reboot
Strictly speaking, rebooting is not necessary but ensures that all the relevant services are setup correctly to start on boot. After the system starts up, access OpenClinica at the following URL:
http://localhost:8080/OpenClinica
The Log In page should display.
To verify your set-up, try to access OpenClinica from another computer by running the same command from that computer, but replace localhost with the server’s IP or hostname.
Verify Access to OpenClinica Web Services
http://localhost:8080/OpenClinica-ws
The Welcome page should display.
To verify your set-up, try to access OpenClinica Web Services from another computer by running the same command from that computer, but replace localhost with the server’s IP or hostname.
Configure Tomcat to Use HTTPS
OpenClinica strongly recommends securing the Tomcat application server using a Secure Socket Layer protocol (SSL). SSL is a data transport encryption technology used to make secure https:// connections. SSL requires a third-party security certificate to be effective. Information about configuring SSL certificates for Tomcat is at this website: http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html.
Verify the Installation
Log in to OpenClinica with the username root and the password 12345678. OpenClinica requires you to change the password for the user “root” to a secure password. See Update User Profile if you need more information.
The user “root” is assigned to the Study “Default”. Create a user account login for yourself, with the User Type set to “technical administrator” and the User Role set to Data Manager. For instructions to create the user account, see Create a New User.