Installation Guide for Ubuntu


this guide is intended for implementers who are familiar with the ubuntu command line interface. i use vi as a text editor, but feel free to substitute in a different (and lesser) editor (like pico or gedit).


make sure you have the latest versions of all your software

sudo apt-get update && sudo apt-get upgrade;


install openmrs components (i used openmrs as mysql root password)

sudo apt-get install sun-java6-jdk tomcat5.5 tomcat5.5-admin tomcat5.5-webapps mysql-server lcab cabextract;


make the openmrs directory

sudo mkdir /usr/share/openmrs;
sudo ln -s /usr/share/openmrs /usr/share/tomcat5.5/.OpenMRS;


add your username/password to the tomcat file (i used openmrs/openmrs as user/pass)

sudo vi /usr/share/tomcat5.5/conf/tomcat-users.xml;
<tomcat-users>
   ...
   <user username="root" password="openmrs" roles="admin,manager,tomcat"/>
   ... 
</tomcat-users>


create the runtime properties file with the following

sudo vi /usr/share/tomcat5.5/.OpenMRS/openmrs-runtime.properties;
# database options
connection.username=openmrs
connection.password=openmrs
connection.url=jdbc:mysql://localhost:3306/openmrs?autoReconnect=true
	
# module options
module.allow_upload=true
module.allow_web_admin=true

# lcab/cabextract
formentry.lcab_location=/usr/bin/lcab
formentry.cabextract_location=/usr/bin/cabextract


fix your permissions

sudo chown -R tomcat55:root /usr/share/tomcat5.5/.OpenMRS/;


bump up the ram and remove impossible to configure security (not recommended for production)

sudo vi /etc/init.d/tomcat5.5;
...
CATALINA_HOME=/usr/share/$NAME
CATALINA_OPTS='-Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m'
...
TOMCAT5_SECURITY=no 


download openmrs components

cd ~;
wget http://resources.openmrs.org/builds/releases/OpenMRS_1.3.0_/openmrs.war;
wget http://resources.openmrs.org/builds/releases/OpenMRS_1.3.0_/1.3.0-createdb-from-scratch-with-demo-data.sql;
wget http://resources.openmrs.org/builds/releases/OpenMRS_1.3.0_/update-to-latest-db.mysqldiff.sql;


add data to new database

mysql -u root -popenmrs < ~/1.3.0-createdb-from-scratch-with-demo-data.sql;
mysql -u root -popenmrs openmrs < ~/update-to-latest-db.mysqldiff.sql;


add openmrs user to database

mysql -u root -popenmrs;
create user openmrs@localhost identified by 'openmrs';
set password for openmrs@localhost=password('openmrs');
grant all on openmrs.* to openmrs;
exit;


move the war to install directory

sudo mv ~/openmrs.war /usr/share/tomcat5.5/webapps/


reboot your machine

sudo reboot

go to http://localhost:8180/openmrs and you should see the start screen. (admin/test is the user/pass). try installing the formentry module next.

if you have errors, you can get hints about the error if you use this command:

tail -f /var/log/daemon.log

if you have any problems, ask the mailing list.