Changes between Initial Version and Version 1 of OpenClinicaRedHat


Ignore:
Timestamp:
10/13/09 16:38:03 (9 years ago)
Author:
joshuadf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OpenClinicaRedHat

    v1 v1  
     1= OpenClinica Quick Install on Red Hat = 
     2 
     3This "quickstart" guide is a condensed version of the verbose instructions found in the Open``Clinica download at `install-docs/linux/install.txt`. It should allow you to get Open``Clinica installed on a fully updated install of Red Hat Enterprise Linux 5 Update 3 (EL5.3) in a short amount of time. 
     4 
     5Note: For Sun Java, you may need to add the channel "RHEL Supplementary (v. 5)" in the RHN web interface, or separately install and configure a JDK as described in the Open``Clinica instructions. We prefer to use standard RHEL components when possible to take advantage of Red Hat's security/QA process. EL5.3's version of postgres is slightly older than in the Open``Clinica recommendations, but Red Hat backports updates. '''Warning: we have experienced some issues with dataset extracts related to PostgreSql version.''' 
     6 
     7See also OpenclinicaFedora for installation on Fedora. 
     8 
     9== 1. Download and install software. == 
     10 
     11 
     12 
     13=== 1a. Install prerequisite software === 
     14{{{ 
     15# install Java separately first because there are multiple options (Sun, IBM, BEA) 
     16yum -y install java-1.6.0-sun-devel  
     17yum -y install postgresql-server tomcat5-admin-webapps  
     18 
     19rpm -q tomcat5 postgresql java-1.6.0-sun 
     20# As of 2009 Mar 19 
     21# tomcat5-5.5.23-0jpp.7.el5_2.1 
     22# postgresql-8.1.11-1.el5_1.1 
     23# java-1.6.0-sun-1.6.0.12-1jpp.3.el5 
     24}}} 
     25 
     26 
     27=== 1b. Download and extract OpenClinica for Linux === 
     28 
     29First we'll set up links so that both Red Hat's default OS tools and OpenClinica install.txt instructions will work.  
     30In short the downloads will live in `/usr/local/oc/` while the live webapp and data will be visible as `/usr/local/tomcat/` 
     31but really live in `/var/lib/tomcat5/` per Linux Standard Base (LSB). 
     32{{{ 
     33mkdir /var/lib/tomcat5/openclinica.data 
     34chown tomcat:tomcat /var/lib/tomcat5/openclinica.data 
     35ln -s /var/lib/tomcat5/openclinica.data /usr/share/tomcat5 
     36ln -s /usr/share/tomcat5 /usr/local/tomcat 
     37mkdir /usr/local/oc 
     38}}} 
     39 
     40Next [http://www.openclinica.org/register.php Register at OpenClinca.org] and get latest version at the [http://www.openclinica.org/page.php?pid=40 OpenClinica Downloads] website. 
     41 
     42Upload your OpenClinica-*.tar.gz download to `/usr/local/oc/` on your EL5 host with a command like `rsync -vaz OpenClinica-*.tar.gz $RHEL_HOST:/usr/local/oc/`. 
     43 
     44Now, on your EL5 host, decompress the download : 
     45{{{ 
     46cd /usr/local/oc 
     47tar zxvf OpenClinica-*.tar.gz  
     48}}} 
     49 
     50Make sure you only have one `/usr/local/oc/OpenClinica-*` directory or some of the commands below will fail. 
     51If you have older versions of OpenClinica you can move them to an `oldversions/` directory. 
     52 
     53== 2. Setup software == 
     54 
     55=== 2a. PostgreSQL === 
     56 
     57Prepare '''a strong password''' to use for the db user and run the following: 
     58 
     59{{{ 
     60/etc/init.d/postgresql start 
     61chkconfig postgresql on 
     62# change localhost access type to "md5"  
     63sed -i 's;127.0.0.1/32          ident sameuser;127.0.0.1/32          md5;' /var/lib/pgsql/data/pg_hba.conf 
     64# switch to postgres user        
     65su - postgres 
     66  createuser --no-superuser --no-createrole --no-createdb --pwprompt clinica 
     67  # type a strong password and note it! 
     68  createdb openclinica  
     69  psql -d openclinica -f /usr/local/oc/OpenClinica-*/config/database/PostgreSQL/*/install/create_database_*_tables_with_data.sql 
     70exit 
     71/etc/init.d/postgresql restart 
     72# test the connection from localhost -- type your strong password  
     73psql --user clinica --host localhost openclinica 
     74}}} 
     75 
     76=== 2b. Tomcat === 
     77 
     78Below are several small Tomcat configuration changes, bugfixes, and workarounds:  
     79 
     80{{{ 
     81# set tomcat to start automatically on boot 
     82chkconfig tomcat5 on 
     83 
     84# install postgresql JDBC driver per OpenClinica instructions 
     85cp /usr/local/oc/OpenClinica-*/config/libraries/postgresql-8.1-405.jdbc3.jar /usr/local/tomcat/common/lib/ 
     86 
     87# remove problematic impl jars; this must be done after each Red Hat tomcat update 
     88# or OpenClinica rule import will fail with "Cannot find the declaration of element 'RuleImport'" 
     89rm -f /usr/local/tomcat/common/endorsed/* 
     90# Bug: https://bugzilla.redhat.com/show_bug.cgi?id=217630 
     91wget https://staff.washington.edu/joshuadf/java/naming-factory-dbcp.jar -O /var/lib/tomcat5/common/lib/naming-factory-dbcp.jar 
     92# Open``Clinica is only compatible with Sun Java``Mail http://java.sun.com/products/javamail/ 
     93wget https://staff.washington.edu/joshuadf/java/mail.jar -O /usr/share/java/mail.jar 
     94/usr/sbin/alternatives --install /usr/share/java/javamail.jar javamail /usr/share/java/mail.jar 4289 
     95/usr/sbin/alternatives --set javamail /usr/share/java/mail.jar  
     96}}} 
     97 
     98By default, Tomcat is not configured for encrypted (HTTPS) requests. If you want to 
     99pass requests through an Apache httpd server, see ApacheConfig for details. Alternatively you 
     100can [http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html configure Tomcat to serve SSL requests]  
     101by editing `/etc/tomcat/server.xml`. First uncomment the `Connector port="8443"` section,  
     102then create a keystore with a self-signed certificate for Tomcat: 
     103{{{ 
     104keytool -genkey -alias tomcat -keyalg RSA -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -storepass changeit -keypass changeit 
     105mv /root/.keystore /usr/local/tomcat/ 
     106 
     107service tomcat5 start 
     108# verify it is now running 
     109netstat -anp |grep 8443 
     110# tcp        0      0 :::8443                     :::*                        LISTEN      581/java             
     111}}} 
     112 
     113 
     114=== 2c. OpenClinica Deployment === 
     115 
     116{{{ 
     117# pre-deploy the WAR; we will edit some files before restarting Tomcat 
     118cp /usr/local/oc/OpenClinica-*/distribution/OpenClinica.war /usr/local/tomcat/webapps  
     119}}} 
     120 
     121Lastly, in `/usr/local/tomcat/conf/Catalina/localhost/OpenClinica.xml` change the `JDBCRealm` and `SQLPostgres` password lines for the "clinica" user to your db password and then run 
     122{{{ 
     123# change OpenClinica settings 
     124sed -i 's;smtpHost=mail.example.com;smtpHost=localhost;' /usr/local/tomcat/webapps/OpenClinica/properties/datainfo.properties 
     125sed -i 's;adminEmail=.*;adminEmail=you@your.domain;' /usr/local/tomcat/webapps/OpenClinica/properties/datainfo.properties 
     126/etc/init.d/tomcat5 restart 
     127}}} 
     128 
     129Now go to https://localhost:8443/OpenClinica/MainMenu (root/12345678) and enjoy! If you cannot log in, check the log files in `/usr/local/tomcat/logs/` for details. 
     130 
     131 
     132= Debugging OpenClinica = 
     133 
     134There are many places to find logs of errors occurring in OpenClinica. Ideally users will see helpful messages, but sometimes it is a generic message. 
     135For example, one of our users had a created a CRF with different RESPONSE_OPTIONS_TEXT columns, but identical RESPONSE_LABEL columns. When trying to 
     136preview the CRF, OpenClinica simply output "An error has occurred in the application." 
     137 
     138I found the following message in the tomcat log `/usr/local/tomcat/logs/catalina.out`: 
     139{{{ 
     140java.util.MissingResourceException:  
     141  Can't find resource for bundle java.util.PropertyResourceBundle, key resp_label_with_different_resp_values_html_error 
     142}}} 
     143 
     144I searched for the internationalization properties files in the webapp 
     145{{{ 
     146grep -lrsi resp_label /usr/local/tomcat/webapps/OpenClinica/ 
     147}}} 
     148I found the default file at `/usr/local/tomcat/webapps/OpenClinica/WEB-INF/classes/org/akaza/openclinica/i18n/page_messages.properties`  
     149and edited it with a text editor to add the `resp_label_with_different_resp_values_html_error` key: 
     150{{{ 
     151resp_label_with_different_resp_options=RESPONSE_OPTIONS_TEXT can not be different for the same RESPONSE_LABEL. Error on row 
     152resp_label_with_different_resp_values=REPONSE_VALUES can not be different for the same RESPONSE_LABEL. Error on row 
     153resp_label_with_different_resp_values_html_error=REPONSE_VALUES can not be different for the same RESPONSE_LABEL. Error on row 
     154}}} 
     155 
     156 
     157You may also want to read about query debugging at our PostgreSql page.