-
Notifications
You must be signed in to change notification settings - Fork 50
HowtoInstallOpeneSignFormsOnCentOS7 (obsolete)
OUT OF DATE COMMUNITY CONTRIBUTION - Contributed earlier but not updated by the author and kept for historical reasons only.
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! ***
- 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
- 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>
- If for some reason your network interface doesn't come back up:
- systemctl restart network.service
- Use ip a to verify your static IP is configured and in use
- 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
- vi /etc/hosts
- NOTE: <ip_address> <TAB> <hostname.domain_name.suffix>
- vi /etc/sysconfig/network
- HOSTNAME=esign.example.com
- 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
- If your time zone is incorrect you can use the following the correct it:
- 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
- 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>
- vim /etc/resolv.conf
- If you need to make changes:
- yum update -y
- useradd esignforms
- passwd esignforms
- su esignforms
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz"
- tar xvf jdk-8u102-linux-x64.tar.gz
- mv jdk1.8.0_102 java
- vim /home/esignforms/.bash_profile
- Add :$HOME/java/bin to the end of the PATH= line
- Save and exit vim
- . /home/esignforms/.bash_profile
- echo $PATH
- You should see your PATH change in the output
- java -version
- Download Jurisdiction Policy Files 8 using:
- wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip"
- 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/
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- Upload the Open eSignForms zip file via SCP, SFTP, FTP, whatever
- 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/
- (You should still be in /home/esignforms at this point)
- mkdir bin
- cp scripts/* bin/.
- chmod 755 bin/*
- dos2unix ~/bin/*
- chmod +x /home/esignforms/database/postgresql/ddl/*
- dos2unix /home/esignforms/database/postgresql/ddl/*
- 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
- Add these lines to the new file:
- Save the file and exit VIM
- 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
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- cd /home/esignforms
- tar xvf postgresql-9.5.4.tar.bz2
- cd postgresql-9.5.4
- source /home/esignforms/bin/profile
- source /home/esignforms/bin/bashrc
- ./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
- NOTE! If the previous command doesn't work you'll need to re-run these two commands again:
- postgres -D /home/esignforms/postgresql/data92 &
- psql template1
- ALTER USER esignforms WITH PASSWORD 'esignforms';
- \q
- vim /home/esignforms/postgresql/data92/pg_hba.conf
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- NOTE! We're going to use Tomcat 8.0.36 since .35 is what Yozons is using as per their Version History notes.
- wget http://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.5.4/bin/apache-tomcat-8.5.4.zip
- unzip apache-tomcat-8.5.4.zip
- mv apache-tomcat-8.5.4.zip tomcat
- mkdir -p /home/esignforms/tomcat/webapps/ROOT
- mv /home/esignforms/WebContent/* /home/esignforms/tomcat/webapps/ROOT
- cp -r /home/esignforms/VAADIN-release-extras/VAADIN/themes/openesf/* /home/esignforms/tomcat/webapps/ROOT/VAADIN/themes/openesf
- 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
- 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
- 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
- vim /home/esignforms/tomcat/conf/server.xml
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="false">
- 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>
- Immediately below this line:
- chmod 740 /home/esignforms/tomcat/bin/*
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- wget http://download.gna.org/wkhtmltopdf/obsolete/linux/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2
- cd bin
- tar ../xvf wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2
- mv wkhtmltopdf-amd64 wkhtmltopdf
- cd .. (to get back to /home/esignforms)
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- 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.)
- ./create_db
- 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: [email protected]
- 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
- ./rundbsetup ROOT
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- 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
*** You should be at /home/esignforms at this point! ***
*** You should still be signed in as the esignforms user! ***
- esf start
- NOTE! If you get an error saying postgres is already running you can stop it gracefully with:
- pg_ctl stop
- NOTE! If you get an error saying postgres is already running you can stop it gracefully with:
- esf stop
Open a web browser and Visit http://localhost:8080 to open the logon page for Open eSignForms
Log in as [email protected], pass testuser
Documentation for eSignForms by Yozons Inc.