Skip to content

HowtoInstallOpeneSignFormsOnCentOS7 (obsolete)

Yozons Open eSignForms edited this page Apr 17, 2019 · 1 revision

OUT OF DATE COMMUNITY CONTRIBUTION - Contributed earlier but not updated by the author and kept for historical reasons only.

How To Install Open eSignForms on CentOS 7

Contributing Author: Daniel Alfaro

** NOTE: This wiki was not written by Yozons / Open eSignForms. It is a contribution that we do not support, but we will update if corrections are provided. This is an add-on document that was not created or maintained by Yozons. Please visit https://github.com/OpenESignForms/openesignforms/wiki/InstallationUsingVaadin7 for generic install instructions. **

NOTE WELL: Do not use any example passwords in production.

(Original post in the forum: https://groups.google.com/forum/#!topic/openesignformsdev/GaLOmcDX7nk)

The following walkthrough could not have been written and proven in the real-world without the contributions of:

We're going to use a few different packages to build the Open eSignForms AGPL server. It's important to keep in mind that:

  • Open eSignForms runs as the user esignforms
  • All of the necessary software is run from respective folders in the directory /home/esignforms

So, yes, unless you want to spend time configuring a non-root user account (the esignforms user account) to be able to run services that were installed as root you'll want to perform most of the installation while signed in as the esignforms user.

First, we need the latest version of CentOS, minimal version. Next, a virtual machine set to 1 CPU, 2GB of RAM and 40gb disk (or whatever you want, your server, your call) Keep in mind that I'm not installing iptables or any other software firewall.

*** Perform all of these steps as 'root' unless otherwise indicated! ***

Prepare the OS:

Install CentOS onto the new VM

  • Change time zone to your time zone
  • Change time format to AM/PM
  • In the Network and Host Name section click the OFF button to change it to ON. Now you're connected to the network. While you're in here change the IPv6 option to Ignore.
  • In the same window change the host name
  • In the Installation Destination section we need to select our only hard disk
  • Click the Begin Installation button
  • On the Installation Progress window click Set Root Password and set a password for your root account
  • Wait for the install to finish

Configure networking (add a static IP):

  • vi /etc/sysconfig/network-scripts/ifcfg-ens33
  • Change BOOTPROTO to "none"
  • Change IPV6INIT to "no"
  • Add the following lines to the end of the file:
    • IPADDR="<ip_address>"
    • PREFIX="24"
    • GATEWAY="<gateway_ip>"
    • DNS1="<dns_ip>"
    • DNS2="<dns_ip>"
  • Save the file and exit vim
  • Restart networking for your changes to go into effect:
    • systemctl restart network.service
      • If for some reason your network interface doesn't come back up:
        • ifup <interface_name>
  • Use ip a to verify your static IP is configured and in use

Install some pre-requisites and tools we'll need to complete the rest of the build:

  • yum install wget open-vm-tools vim net-tools ntp logwatch dos2unix gpg bind-utils jwhois telnet traceroute make gcc libgcc gcc-c++ glibc-devel readline readline-devel ncurses ncurses-devel zlib zlib-devel zip unzip bzip2 pam pam-devel postfix screen lynx dovecot rsync fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo openssl

Ensure your hostname is set properly:

  • vi /etc/hosts
    • NOTE: <ip_address> <TAB> <hostname.domain_name.suffix>
  • vi /etc/sysconfig/network
    • HOSTNAME=esign.example.com

Ensure your time and time zone are set properly:

  • Date
    • If your time zone is incorrect you can use the following the correct it:
      • rm -f /etc/localtime
      • ln -s /usr/share/zoneinfo/<country>/<city/region/area> /etc/localtime
  • vi /etc/sysconfig/clock (create a new file if it doesn't already exist)
    • ZONE="<county>/<city/region/area>"
    • UTC=true
    • Save and exit VIM
  • Start the network time daemon and set it to start on boot:
    • service ntpd start
    • chkconfig ntpd on

Double-check name servers are set properly:

  • cat /etc/resolv.conf
    • If you need to make changes:
      • vim /etc/resolv.conf
        • Search <domain.suffix>
        • nameserver <ip_address_of_name_server>
        • nameserver <ip_address_of_secondary_name_server>

Ensure CentOS is up-to-date:

  • yum update -y

Create and secure the esignforms user account:

  • useradd esignforms
  • passwd esignforms

Switch to the esignforms user account:

  • su esignforms

Install Java:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Download Java JDK:

Extract Java JDK files and rename folder:

  • tar xvf jdk-8u102-linux-x64.tar.gz
  • mv jdk1.8.0_102 java

Add the Java bin directory to the PATH:

  • vim /home/esignforms/.bash_profile
  • Add :$HOME/java/bin to the end of the PATH= line
  • Save and exit vim

Reload the bash_profile:

  • . /home/esignforms/.bash_profile

Ensure the PATH has been updated properly:

  • echo $PATH
  • You should see your PATH change in the output

Verify the installed and recognized version of Java is 1.8.0_102:

  • java -version

Install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files:

  • Download Jurisdiction Policy Files 8 using:
  • Unzip the files using:
    • unzip jce_policy-8.zip
  • Move the .jar files from the UnlimitedJCEPolicyJDK8 folder you just created into your Java security folder:
    • mv UnlimitedJCEPolicyJDK8/*.jar /home/esignforms/java/jre/lib/security/

Install Open eSignForms:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Download Open eSignForms into /home/esignforms:

  • Upload the Open eSignForms zip file via SCP, SFTP, FTP, whatever

Unzip the Open eSignForms zip file:

  • unzip open-eSignForms-16.8.20.zip
  • A folder named open-eSignForms-16.8.20.zip is now available at /home/esignforms/
  • mv open-eSignForms-16.8.20/* /home/esignforms/

Create a bin directory in the home folder for the esignforms user account:

  • (You should still be in /home/esignforms at this point)
  • mkdir bin

Copy and configure scripts to /home/esignforms/bin:

  • cp scripts/* bin/.
  • chmod 755 bin/*
  • dos2unix ~/bin/*

Prep the ddl directory contents:

  • chmod +x /home/esignforms/database/postgresql/ddl/*
  • dos2unix /home/esignforms/database/postgresql/ddl/*

Modify .bashrc:

  • vim .bashrc
    • Add these lines to the new file:
      alias ls='ls --color=auto'
      PS1='[\u@\h \W] '
      PS1="[\e]0;\u@\h: \w\a]$PS1"
      PATH=$PATH:~/bin
  • Save the file and exit VIM

Modify bin/profile:

  • vim bin/profile
    • PGUSER=esignforms (this is used to create the default postgres user account during the Postgres source make/installation below! It must match the username you're installing all of these packages as which for this walkthrough is esignforms!)
    • PGPASSWORD=esignforms
    • JAVA_HOME=~/java
    • CATALINA_HOME=~/tomcat
    • Save and exit vim

Install PostgreSQL:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Download PostgreSQL source:

Untar the source files:

  • cd /home/esignforms
  • tar xvf postgresql-9.5.4.tar.bz2
  • cd postgresql-9.5.4

Import settings from:

  • source /home/esignforms/bin/profile
  • source /home/esignforms/bin/bashrc

Build PostgreSQL from source:

  • ./configure --prefix=/home/esignforms/postgresql/pg92 --with-pam
  • gmake
  • gmake install
  • cd contrib/vacuumlo/
  • gmake
  • cp -p vacuumlo ../../../bin/
  • cd ../pg_standby
  • gmake
  • cp -p pg_standby ../../../bin/
  • cd ~/postgresql
  • initdb -D $PGDATA
    • NOTE! If the previous command doesn't work you'll need to re-run these two commands again:
      • source /home/esignforms/bin/profile
      • source /home/esignforms/bin/bashrc

Start the database:

  • postgres -D /home/esignforms/postgresql/data92 &

Sign into PostgreSQL as template1

  • psql template1

Create the esignforms PostgreSQL user account:

  • ALTER USER esignforms WITH PASSWORD 'esignforms';

Exit PostgreSQL prompt:

  • \q

Modify pg_hba.conf PostgreSQL configuration file to change "trust" to "md5"

  • vim /home/esignforms/postgresql/data92/pg_hba.conf

Install Tomcat 8:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Download Tomcat to the new folder:

Create the ROOT webapp folder:

  • mkdir -p /home/esignforms/tomcat/webapps/ROOT

Move the contents of WebContent to the ROOT webapp folder:

  • mv /home/esignforms/WebContent/* /home/esignforms/tomcat/webapps/ROOT

Copy the themes files to the proper folder in the ROOT webapp folder:

  • cp -r /home/esignforms/VAADIN-release-extras/VAADIN/themes/openesf/* /home/esignforms/tomcat/webapps/ROOT/VAADIN/themes/openesf

Move all of the jar files into place:

  • mv /home/esignforms/lib/*.jar /home/esignforms/tomcat/webapps/ROOT/WEB-INF/lib
  • mv /home/esignforms/VAADIN-release-extras/WEB-INF/lib/*.jar /home/esignforms/tomcat/webapps/ROOT/WEB-INF/lib

Modify the connectionpools.properties file:

  • vim /home/esignforms/tomcat/webapps/ROOT/WEB-INF/classes/connectionpools.properties
    • esf.dbUserName=esignforms (this is the username that is used during the create_db process when we deploy our Open eSignForms database below. It also serves as the name of the database.)
    • esf.dbPassword=esignforms (this is the password that is used during the create_db process when we deploy our Open eSignForms database below)
    • esf.dbURL=jdbc:postgresql://localhost/esignforms

Modify the openesignforms.properties file:

  • vim /home/esignforms/tomcat/webapps/ROOT/WEB-INF/classes/openesignforms.properties
    • boot.password.1=test1 (these passwords are using during the rundbsetup process when we deploy our Open eSignForms database. Use good passwords for production deployments)
    • boot.password.2=test2

Edit the server.xml file and set autoDeploy to false:

  • vim /home/esignforms/tomcat/conf/server.xml
    <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false">

Edit the web.xml file:

  • vim /home/esignforms/tomcat/conf/web.xml
  • And add this line:
    <init-param>
    <param-name>development</param-name>
    <param-value>true</param-value>
    </init-param>
    • Immediately below this line:
      <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>

Make Tomcat's bin folder contents executable:

  • chmod 740 /home/esignforms/tomcat/bin/*

Install wkHTMLtoPDF:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Download wkHTMLtoPDF:

Deploy the Open eSignForms Database:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Create the database:

  • mkdir deployments
  • cd database/postgresql/ddl
  • Stop PostgreSQL service:
    • pg_ctl stop
  • postgres -D /home/esignforms/postgresql/data92 &
    • REMEMBER: If for some reason you get "postgres: command not found" you'll need to source ~/bin/profile and ~/bin/bashrc again. This will re-setup your environment variables.
    • NOTE! If you've already installed Open eSignForms you'll need to drop the current database:
      • ./drop_db
  • To create the Open eSignForms database:
    • ./create_db
      • During this process you'll be asked for creds… enter esignforms for both. (Again, use good passwords for production.)
  • To setup the newly created database:
    • ./rundbsetup ROOT
      • During this process:
      • Enter setup command = initdb
        • NOTE!: If you get an authentication error here you have a mismatch between: PGPASSWORD= in /home/esignforms/bin/profile
        • And
        • esf.dbPassword= in /home/esignforms/tomcat/webapps/ROOT/WEB-INF/classes/connectionpools.properties
          • Both of these values have to match!
      • Enter boot password 1: test1 (these are the passwords you set in /home/esignforms/tomcat/webapps/ROOT/WEB-INF/classes/openesignforms.properties)
      • Enter boot password 2: test2
        • NOTE!: If you get an authentication error here you need to check your creds in your Tomcat openesignforms.properties file.
      • Enter setup command = addsuperuser
        • Enter super user's email address: test@example.com
        • Enter super user's first name: Super
        • Enter super user's last name: User
        • Initial super user password: testuser (again, use good passwords in production
      • Enter setup command = initsetup
        • Enter Commercial DB license size in MB (enter 0 for AGPL deployment) [0] : 0
        • Enter company name:
        • Enter company street address:
        • Enter company city:
        • Enter company state:
        • Enter company zip:
        • Enter company default phone number:
        • Enter company group EsfName:
        • Enter company default email address:
        • Enter initial programmer user's email address:
      • Enter setup command = quit

Create the Start/Stop Script for Open eSignForms:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

Create a script to start and stop Open eSignForms:

  • cd /home/esignforms/bin
  • touch esf
  • chmod +x esf
  • vim esf
    • Script contents should be as follows:

### BEGIN esf script
#!/bin/bash
arg=
echo $arg | egrep -q "^start$|^stop$" ||
{
echo -e "\n\tStart/stop Open eSignForms service\n"
echo -e "\tUsage:\tesf start"
echo -e "\t\tesf stop\n"
exit 1
}
# If started service
echo $arg | grep -q "^start$" &&
{
#If already running, do nothing
ps -aef | grep esignforms | egrep -q "postgres|tomcat" &&
{
echo -e "\n\tERROR: Either postgres and / or tomcat are already running for user esignforms\n"
exit 1
}
# Start the service
echo -e "\n\tStarting Open eSignForms:"
echo -e "\tStarting postgres..."
postgres -D /home/esignforms/postgresql/data92 &
echo -e "\tStarting tomcat...\n"
/home/esignforms/tomcat/bin/startup.sh
exit
}
# Otherwise, stop service
#Check if running
ps -aef | grep esignforms | egrep -q "postgres|tomcat" &&
{
echo -e "\n\tStopping Open eSignForms\n"
ps -aef | grep esignforms | egrep "postgres|tomcat" | awk '{print }' | xargs kill -9
exit
}
echo -e "\n\tERROR: Open eSignForms not running!\n"
### END esf script

Launching Open eSignForms for the First Time:

*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***

To start Open eSignForms:

  • esf start
    • NOTE! If you get an error saying postgres is already running you can stop it gracefully with:
      • pg_ctl stop

To stop Open eSignForms:

  • esf stop

Open a web browser and Visit http://localhost:8080 to open the logon page for Open eSignForms

Log in as test@example.com, pass testuser

Clone this wiki locally