Step-by-Step Installation Guide for Ubuntu 8.10 for Developers
Contents |
Note: Some of the command line commands have EDIT in them. Substitute your favorite editor (e.g. vim, gedit, emacs).
Note: This installation procedure also works for Ubuntu 9.10.
Downloading Required Software
Make sure your system is up-to-date:
sudo aptitude update
Enable the multiverse package so we can install the Sun Java 6 packages. Open up /etc/apt/sources.list and make sure the multiverse repositories are there:
deb http://us.ec2.archive.ubuntu.com/ubuntu/ intrepid main multiverse deb-src http://us.ec2.archive.ubuntu.com/ubuntu/ intrepid main multiverse deb http://us.ec2.archive.ubuntu.com/ubuntu/ intrepid-updates main multiverse deb-src http://us.ec2.archive.ubuntu.com/ubuntu/ intrepid-updates main multiverse
Update aptitude so it knows about the repositories we just added:
sudo aptitude update
Install the following packages: tomcat6 tomcat6-admin mysql-client mysql-server sun-java6-bin sun-java6-jdk sun-java6-jre
sudo aptitude install tomcat6 tomcat6-admin mysql-client mysql-server sun-java6-bin sun-java6-jdk sun-java6-jre
If you are using InfoPath for form entry, install the additional packages: lcab cabextract
sudo aptitude install lcab cabextract
If you get the following error:
Setting up tomcat6-common (6.0.18-0ubuntu3.2) ... Setting up tomcat6 (6.0.18-0ubuntu3.2) ... Adding system user `tomcat6' (UID 110) ... Adding new group `tomcat6' (GID 117) ... Adding new user `tomcat6' (UID 110) with group `tomcat6' ... Not creating home directory `/usr/share/tomcat6'. * Starting Tomcat servlet engine tomcat6 ...fail! invoke-rc.d: initscript tomcat6, action "start" failed. Setting up tomcat6-admin (6.0.18-0ubuntu3.2) ... invoke-rc.d: initscript tomcat6, action "status" failed.
Purge and reinstall tomcat (bug 372233):
sudo aptitude purge tomcat6 tomcat6-admin sudo aptitude install tomcat6 tomcat6-admin
Make sure you have the proper development tools.
- If you are using Eclipse, download the latest version of Eclipse IDE for Java EE Developers and install Subclipse.
- If you are not using Eclipse, you must at least have the latest versions of Ant and a Subversion client.
Set Up Tomcat
- Set environment variables needed by Tomcat.
-
EDIT ~/.bashrc
- Add the following lines:
-
export JAVA_HOME=/usr/lib/jvm/java-6-sun
- export JRE_HOME=/usr/lib/jvm/java-6-sun
-
- In your open terminal window:
-
source ~/.bashrc
-
-
- Modify the Tomcat security settings.
-
sudo EDIT /etc/init.d/tomcat6
- Update/add the following lines:
-
Use the Java security manager? (yes/no)
- TOMCAT6_SECURITY=no
- CATALINA_OPTS='-Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m'
-
-
- Add a Tomcat user.
-
sudo EDIT /etc/tomcat6/tomcat-users.xml
- Update the following lines:
-
<?xml version='1.0' encoding='utf-8'?>
- ...
- <tomcat-users>
- <role rolename="admin"/>
- <role rolename="manager"/>
- <role rolename="tomcat"/>
- <user username="test" password="test" roles="admin,manager,tomcat"/>
- </tomcat-users>
-
- Ensure the code inside <tomcat-users> is no longer surrounded by a comment.
-
- Restart Tomcat
-
sudo sh /etc/init.d/tomcat6 restart
-
- Verify that Tomcat is running correctly.
- Go to http://localhost:8080/ and see It works!
- Click the manager webapp link and see the Tomcat Web Application Manager
- username: test
- password: test
Download OpenMRS Source
- With just Subversion (svn) installed:
- Create a new directory for the code. Our example will call it OPENMRS.
- At a command line prompt in the OPENMRS directory, run (SVN_HOME)/bin/svn checkout http://svn.openmrs.org/openmrs/trunk
or
- With Subclipse installed as plugin in Eclipse:
- File-->New-->Project...-->SVN-->Checkout project from SVN
- Use Repository - http://svn.openmrs.org/
- Browse in new tree to /openmrs/trunk
- Go through various prompts with Next>
Set Up Project
- Update the project properties.
- Edit properties.xml (at the root of the source tree)
- Update the following lines:
-
<property name="tomcat.home" value="/var/lib/tomcat6"/>
- <property name="catalina.home" value="/var/lib/tomcat6"/>
-
- Set up the OpenMRS runtime directory.
-
sudo mkdir /usr/share/tomcat6/.OpenMRS
- sudo chown -R tomcat6:root /usr/share/tomcat6/.OpenMRS
-
Build the Source and Install the Webapp
- From within Eclipse
- Click Window > Show View > Ant
- Drag and Drop build.xml from the 'openmrs' project into the Ant view
- In the Ant view (left pane), expand the 'openmrs-trunk' build file
- Double click on the install ant task (this may take a few minutes)
- NOTE: Subsequent re-installs can be done using the update Ant task.
or
- Command Line
- Open a terminal / bash shell
- Change directories to the openmrs project directory where you checked out the OpenMRS trunk code using svn.
- Type 'ant install'
- Future compilations can run (ANT_HOME)/bin/ant update or, if really needed, (ANT_HOME)/bin/ant -k clean remove install
- Go to http://localhost:8080/manager/html.
- If openmrs is not running, click start.
- Once OpenMRS is running, click /openmrs.
- If openmrs is not starting, check your tomcat logs: (tomcathome)/logs/catalina.out
Set Up OpenMRS Database
When you start OpenMRS for the first time, you will see the Installation Wizard.
- Step 1 of 5
- Select No, you do not currently have a database installed.
- database name: openmrs
- username: root
- password: your database root password
- Step 2 of 5
- Select Yes, you need to automatically create the tables.
- Select Yes, you want to add demo data.
- Select No, you do not currently have a database user.
- username: root
- password: your database root password
- Step 3 of 5
- Select Yes, you want to be able to upload modules.
- Select Yes, you want updates to be applied on startup.
- Step 4 of 5
- username: admin
- password: choose a password
- Step 5 of 5
- Click finish.
