Installation Under Ubuntu Linux notes

Kindly contributed by Nandalal on the basis of his from-scratch(?) installation under Ubuntu.

Date: May 12, 2006 9:01:23 AM PDT (CA) To: James Busser Subject: Re: [openhealth] Re: request for advice re electronic medical record

It is slightly modified from the OSCAR documentation! I installed in Ubuntu Linux (Debian based). I use it without SSL. However how to setup SSL and the way to do it in Ubuntu linux is given, if you want to do all that now.

By default OSCAR will use port 8080. Since our favorite server Zope wink also uses it if installed from source, set OSCAR to work on port 80 ( I have said how to set that up)

Server Software Requirements

* Linux (tested with Redhat 7 thru 9, Fedora Core 1 thru 3); it has also been known to run on Windows XP and Professional, Debian, Mac OS-X And now UBUNTU too. * Java2 SDK 1.4 * MySQL? 3.23.x (tested with 3.23.49, 3.23.52, 3.23.53) * Jakarta Tomcat 4.1.x (tested with 4.1.29, 4.1.30, 4.1.31)

Download the Required Files *The OSCAR application itself from www.sourceforge.net (sourceforge project name is "OSCARMcMaster") (oscar_mcmaster_2.0.tar.gz as of 15/06/2004) I got 2.1.0 from somewhere but I cannot find from where! Maybe it has been taken off? *Current version of Java 2 SDK from java.sun.com (j2sdk-1_4_2_04-linux.i586.bin as of 15/06/2004) *Apache Tomcat 4.1 from jakarta.apache.org (note: does NOT work with Tomcat 5.x) (jakarta-tomcat-4.1.30.tar.gz as of 15/06/2004) *Current version of MySQL? from www.mysql.com (mysql-standard-4.0.20-pc-linux-i686.tar.gz as of 15/06/2004)

Install the Java Development Kit

1. Switch to the directory in which you saved the downloaded files, If it is the home directory as sudo cp the files to /usr/local 2. Change the j2sdk-1_4_2_04-linux-i586.bin file to an executable chmod +x j2sdk-1_4_2_04-linux-i586.bin 3. Switch to the /usr/local directory cd /usr/local 4. Run the .bin file and answer "yes" when prompted to agree to the license /root/j2sdk-1_4_2_04-linux-i586.bin 5. ls and find what the j2sdk sirectory name is and then

Add a link the java directory ln -s j2sdk1.4.2_04 java

Install Tomcat

1. Switch to /usr/local directory if you are not already there cd /usr/local 2. Use the tar command with the gunzip switch to install Jakarta Tomcat tar xvzf /root/jakarta-tomcat-4.1.30.tar.gz 3. Add a link to the tomcat directory ln -s jakarta-tomcat-4.1.30 tomcat

Edit the /etc/profile file

1. Using your favorite editor, open /etc/profile for editing. You should see a line at the bottom of the file which begins with the word "export" and has a string of upper case only names beside it. Insert the following lines somewhere before the "export" line but not inside the"if...if" code blocks you'll see scattered around

JAVA_HOME="/usr/local/java" CATALINA_HOME="/usr/local/tomcat" PATH="$PATH:/usr/local/java/bin:/usr/local/mysql/bin" export EXISTING STUFF JAVA_HOME CATALINA_HOME export PATH

Remember to remove the "existing stuff" part!! smile

2. Save your edited profile file, log out and log back in again as root to test Tomcat

Put the following at the end in the /etc/bash.bashhrc file

JAVA_HOME="/usr/local/java" export JAVA_HOME

If you are running zope on port 8080 you need to run tomcat on something else as it too runs on this as default. To do this as root edit /usr/local/tomcat/conf/server.xml replace all instances of 8080 with 80

Test Tomcat

1. Start Tomcat /usr/local/tomcat/bin/startup.sh 2. View the Tomcat test page on your browser at address http://localhost:80/ If you don't see the test page something has gone wrong. 3. Stop Tomcat /usr/local/tomcat/bin/shutdown.sh

If on running startup.sh the following error appears

The JAVA_HOME environment variable is not defined This environment variable is needed to run this program

DO this:

as SU export JAVA_HOME=/usr/local/java

Enable SSL (not absolutely necessary if you are using locally only)

1. Go to /usr/local/java/bin

Create an SSL certificate by executing the following command keytool -genkey -alias tomcat -keyalg RSA -keystore /root/.keystore

When prompted, specify a keystore password value of "changeit". When prompted for your first and last name, enter the hostname or IP address of the server (whichever you will use when connecting to it from the client workstations). Fill out the other fields as appropriate. (Organizational unit refers to the branch or department of your organization that you work in, whereas organization is the name of the organization itself). city, state/province, two letter country code (lk) . Leave the certificate password the same as the keystore password.

2. Uncomment the "SSL HTTP/1.1 Connector" entry in /usr/local/tomcat/conf/server.xml and tweak as necessary. You can uncomment the SSL HTTP/1.1 section by removing the "" tags that surround it. If you're feeling paranoid, save a backup of server.xml first.

COMMENT=This needs further clarification as well as the next step

3. In the SSL HTTP/1.1 section of server.xml place the following string after the clientAuth="false" statement (note the capitalisation - very important!) and save the edited file. keystoreFile="/root/.keystore"

Disable Directory Listing

1. Open the file /usr/local/tomcat/conf/web.xml 2. Search for listings mapping

listings true

3. Change the status from true to false and save the file

listings false

Test Tomcat and SSL

1. Start Tomcat /usr/local/tomcat/bin/startup.sh 2. View the Tomcat test page on your browser at address https://localhost:8443/ If you don't get a secure connection to the Tomcat test page something has gone wrong. ( If you do not use SSL test it on port 80) 3. Stop Tomcat /usr/local/tomcat/bin/shutdown.sh

Install MySQL?

apt-get installmysql-server or use Synaptic and select muysql server, client and mysql administrator.

To do it with the source file - if ever necessary smile Enter the following commands to set up the MySQL? user and group (substituting the password of your choice for the asterisks below):

groupadd mysql useradd -g mysql mysql cd /usr/local tar xvzf /root/mysql-standard-4.0.20-pc-linux-i686.tar.gz ln -s mysql-standard-4.0.18-pc-linux-i686 mysql cd mysql ./scripts/mysql_install_db chown -R root /usr/local/mysql-standard-4.0.20-pc-linux-i686 chown -R mysql /usr/local/mysql/data chgrp -R mysql /usr/local/mysql-standard-4.0.20-pc-linux-i686 ./bin/mysqld_safe --user=mysql & ./bin/mysqladmin -u root password ********

Remember for security reasons to always start the MySQL? daemon as the mysql user (using the --user=mysql option)

Set up MySQL?

Note: Those unfamiliar with MySQL? note that all commands in MySQL? end with the semicolon

Set the root password like this if left blank or you do not know! $ mysql -u root mysql> UPDATE mysql.user SET Password=PASSWORD('yourpassword') WHERE User='root'; mysql> FLUSH PRIVILEGES; mysql> quit

$ mysqladmin -u root -p create oscar_mcmaster or Start the MySQL? command prompt $ mysql -u root -p mysql> create database oscar_mcmaster;

Now, still at the MySQL? command prompt, type the following commands to grant local and network user permissions to root, again substituting the password you've chosen for the asterisks (include the quotes) mysql> use oscar_mcmaster; mysql> GRANT ALL PRIVILEGES ON oscar_mcmaster.* TO root@localhost IDENTIFIED BY "yourpassword"; mysql> FLUSH PRIVILEGES; mysql> \q (to quit)

Before we begin the installation of OSCAR software we will assume that the JAVA 2 SDK, Apache Tomcat and MySQL? are properly installed and configured.

Install the OSCAR Software

1. Decompress the OSCAR tarball cd /root tar xvzf oscar_mcmaster_2.0.tar.gz 2. Copy the oscar_mcmaster and OscarDocument? web archives to Tomcat's webapps directory cp /root/oscar_mcmaster_2.0/oscar_mcmaster.war /usr/local/tomcat/webapps cp /root/oscar_mcmaster_2.0/OscarDocument.war /usr/local/tomcat/webapps

Install OSCAR DB and initialize the tables

1. Load the OSCAR DB Script from into MySQL?. Enter your password when prompted. /usr/local/mysql/bin/mysql -uroot -p oscar_mcmaster < /root/oscar_mcmaster_2.0/oscarinit.sql /usr/local/mysql/bin/mysql -uroot -p oscar_mcmaster < /root/oscar_mcmaster_2.0/oscardata.sql


a. If located in Ontario, add the Ontario-specific data: /usr/local/mysql/bin/mysql -uroot -p oscar_mcmaster < /root/oscar_mcmaster_2.0/oscardata_on.sql

b. If located in British Columbia, add the BC-specific data: /usr/local/mysql/bin/mysql -uroot -p oscar_mcmaster < /root/oscar_mcmaster_2.0/oscarinit_bc.sql /usr/local/mysql/bin/mysql -uroot -p oscar_mcmaster < /root/oscar_mcmaster_2.0/oscardata_bc.sql
2. Check that the OSCAR DB is installed property mysql -uroot -p oscar_mcmaster 3. In the MySQL? shell list all DB tables (there should be over 100 of them) show tables; 4. Exit the MySQL? command prompt quit

Configure the OSCAR Properties Files

1. Install the properties files in the root directory cp /root/oscar_mcmaster_2.0/oscar_mcmaster.properties /root/ 2. Go to the /root directory cd /root 3. Configure oscar_mcmaster.properties. In particular, make sure that the db_username and db_password fields are correct. The password should be the same as that used to replace the asterisks above when MySQL? was set up. The logintitle can be changed to reflect your organization's name. The logintext option can be used to change the text displayed at the bottom of the login screen. And the loginlogo option can be used to specify a URL to your organization's logo (in gif, jpeg, or png format) which will then replace the OSCAR logo on the login screen. As long as you have a standard install, don't worry too much about the other options.

However, if you choose to rename the webapp, make sure you update project_home to reflect the new webapp name. If you have tomcat installed in another location, change all the paths containing /usr/local/tomcat to reflect the new location. If you have mysql running on a separate machine, change the db_uri to jdbc:mysql:/

# Mysql connection db_name = oscar_mcmaster db_username = root db_password = xxxPASSWORDxxx

db_type = mysql # db_type = postgresql

# Driver for mysql db_driver = com.mysql.jdbc.Driver db_uri = jdbc:mysql:/

db_selectuser = oscarsql db_selectpassword = xxxPASSWORDxxx

. . logintitle = Your Name Goes Here loginlogo = logo.jpg logintext = Address/Contact Info/etc. . .

Restart Tomcat

If Tomcat is running, restart it to make sure any configuration changes are loaded. To stop it, use /usr/local/tomcat/bin/shutdown.sh

and to start it use cd /usr/local/tomcat/webapps ../bin/startup.sh

Note that from now on Tomcat must be started from the webapps directory or OSCAR will be unable to find certain files. All Done!

Once setup To start OSCAR without SSL

Open a terminal and start Tomcat like this sudo su (give password) cd /usr/local/tomcat/webapps ../bin/startup.sh

You should now be able to view the OSCAR login page at http://localhost:80/oscar_mcmaster You should now be able to view the OSCAR login page at https://localhost:8443/oscar_mcmaster (or http://localhost:8080/oscar_mcmaster for the insecure version). The default users are 'oscardoc', 'oscarrep', and 'oscaradmin', corresponding to the three doctor, receptionist, and administrative views. The passwords and pin numbers for all three are 'mac2002' and '1117', respectively.

Note: 'oscarrep', and 'oscaradmin' were not correctly set in the Oscar CVS as at June 15, 2006, their privileges within Oscar need to be adjusted in the Admin tool.

-- JamesBusser - 28 Jun 2006
Topic revision: 28 Jun 2006, JamesBusser
 
Download.png
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
Powered by Olark