This should set you up with a machine sufficient for OpenMRS core or module development. Let me know if anything is missing or incorrect (or better yet - send me a pull request!)
The following will be installed and setup for you:
- Ubuntu 12.04 LTS (32 bit) (user/pass: vagrant/vagrant) NOTE: this is a headless VM (i.e. no GUI). Write all of your code on your host machine and compile it on the VM.
- OpenJDK 6
- Tomcat 6
- MySQL 5.5 (root password: OpenMRS)
- git
- vim
- OpenMRS 1.9.2 war file (deployed to /var/lib/tomcat/webapps)
-
Ensure your laptop is plugged in and connected to the Internet :)
-
Install VirtualBox: https://www.virtualbox.org/wiki/Downloads
-
Install Vagrant: http://downloads.vagrantup.com/tags/v1.0.6
-
Clone this repository: https://github.com/crolfe/vagrant-OpenMRS
-
From the command line, change to the
vagrant-OpenMRS
directory -
Type
vagrant up
-
Allow time (+/- 20 minutes) for the base image and packages to download and install. It may look like it has hung or stopped working at times, but that's just part of the process - be patient!
-
You will see errors on the last step for now, but that's OK. I plan on fixing this though! http://i.imgur.com/xwsi5Vk.png
-
Connect to the box:
- Linux or OS X type this to connect to the box:
vagrant ssh
- Windows, you will need an ssh client like Putty: http://www.putty.org/
- Host: 127.0.0.1
- Port: 2222
- User: vagrant
- Password: vagrant
- Additional info available here: http://docs-v1.vagrantup.com/v1/docs/getting-started/ssh.html
- Linux or OS X type this to connect to the box:
-
Restart the avahi-daemon service:
sudo service avahi-daemon restart
-
Within a web browser on your host machine, go to this URL to install OpenMRS core:
- http://openmrs-dev.local:8080/openmrs
- if that doesn't work try http://192.168.33.10:8080/openmrs
- if that works add
192.168.33.10 openmrs-dev.local
to hosts file (/etc/hosts or %SystemRoot%\system32\drivers\etc\hosts)
- if that works add
-
Follow the prompts and give this for the MySQL password: OpenMRS
-
Make note of the default admin credentials for this site: admin/Admin123
-
Heading back to your VM, there's a folder shared at
/vagrant
that points to the "vagrant-OpenMRS" folder on your host machine. Create a folder called "code" in /vagrant to hold the cpm and/or core source:mkdir code
-
Change to the new directory and you should now be at
/vagrant/code
-
Setup git (using your name and email, of course!):
git config --global user.name "John Doe" git config --global user.email johndoe@example.com
-
Clone the cpm code:
git clone https://github.com/OpenMRS-Australia/openmrs-cpm.git
-
Change to openmrs-cpm
-
Compile the cpm module:
./go build
- If you get an error about JAVA_HOME try exporting "/usr" instead of "/usr/"
export JAVA_HOME=/usr
- If you get an error about JAVA_HOME try exporting "/usr" instead of "/usr/"
-
Once complete, install the modules:
- Login to http://openmrs-dev.local:8080/openmrs
- Click the "Administration" link
- Click "manage modules" link
- Click "Add or Upgrade modules" button
- Click "choose file" button"
- Concept Propose Module
- Open the
/vagrant-OpenMRS/code/openmrs-cpm/conceptpropose/build/libs/*.omod
file generated by the compile - Click upload and you're done!
- Open the
- Concept Review Module
- Open the
/vagrant-OpenMRS/code/openmrs-cpm/conceptreview/build/libs/*.omod
file generated by the compile - Click upload and you're done!
- Open the