Whether you use Windows, Linux or Mac, you can use this process to have Bahmni running on your machine for Testing or Development. Note that it is NOT recommended to use this in production. The idea is to download the Bahmni Virtual (Vagrant) Box which is pre-installed with CentOS, and all softwares. To make the vagrant box run on your machine you will need Virtual Box, Vagrant and GIT installed (See steps below). Once you have this Vagrant box running, you can then make changes to file in the box, and see them reflect immediately. If you still wish to go ahead, and make code changes, and deploy them - then development setup will be needed, so that you can modify files in your base OS, and run them inside the Vagrant box after recompilation.
For development purposes we use Vagrant and Virtual Box. The vagrant box for v0.92 Bahmni should be Centos 7.6. To understand Vagrant better, you can read the following links:
Step 2: Create a folder bahmni where you would like all project related files to be present
Step 3: Clone the following projects from Github inside the newly created folder bahmni
git clone https://github.com/Bahmni/bahmni-vagrant.git
Step 4: From within directory bahmni-vagrant execute "vagrant up" command
This command will download a CentOS Vagrant Box from the internet, and install it on your machine ('vagrant box list' command shows a list of locally installed boxes).
# Make sure that the command prompt is running "As Administrator" otherwise the next command vagrant up will hang on 'Clearing any previously set network interfaces'.
#This command will download the Vagrant box from Atlas first time. Next time onwards, the already downloaded vagrant box will be used.
# The download box size is about 2.5 GB. Please ensure you have a good and stable internet connection to download the box. Usually vagrant will continue download from where it got disconnected.
If the vagrant up command throws some error, please refer to the following page for possible error resolution: Vagrant and VirtualBox tips
If download of the box fails in the step above, and you wish to directly download the box using a downloader utility, then you can try the steps documented here: Direct Download of Vagrant Box.
Step 5: You should have Bahmni up and running, and accessible on the below mentioned links
If any service isn't running, then maybe you won't see the login screen. Please start that service, and then check. For details on all services in Bahmni, please refer to this document: Install Bahmni on CentOS (Services)
Configure Valid SSL Certificates
When you first access the web application your browser may show a warning about an invalid security certificate, and that your connection is not secure / private. If you are testing or evaluating Bahmni you may get around this by using a self-signed certificate or adding a security exception/choosing to proceed to the site (this varies across web browsers). Otherwise please read the following document for recommended guidelines on generating SSL certificates for securing Bahmni access over HTTPS connections: Configure Valid SSL Certificates. In Firefox browser, the Advanced link will allow you to continue forward. In Chrome you may need to run the browser with temporarily disable warning (read this). For security, please don't disable this on browser permanently.
#ssh into the box
# The bahmni code folder of host machine is mapped to /bahmni of the VM
# For httpd server (where the EMR UI runs from):
Starting / Stopping your Vagrant Box
# Stops your vagrant box (and remembers all file system changes)
# Brings your vagrant back on (if you did 'vagrant halt' earlier to stop)
# Destroy and free up space - Any changes you made inside the vagrant will also be lost
# Creates and starts a fresh box (won't download anything) from the originally downloaded Bahmni box template
Updating your Vagrant Box to the Latest Version
If you already have a Bahmni vagrant box on your machine, but would like to update to the latest published box, please perform the following steps.
# See which versions of Bahmni vagrant box are installed on the machine
vagrant box list
# Warning!! This will destroy any changes you made in the vagrant box
# (Optional Step) Delete the box template of a specific version if you don't want it, or you want to download it again
vagrant box remove bahmni-team/bahmni --box-version="0.81"
# Will search and download the latest Bahmni vagrant box (about 1.5GB +)
vagrant box update
# You new box should come up now
Transferring your Vagrant box to another machine
If you wish to transfer the same vagrant box from your machine to another machine, you can also do that. This has the following advantages:
Any data you setup in your vagrant box will also be available to the other box/machine.
If the other machine doesn't have fast internet access, then also you can perform this machine to machine box transfer, and save on bandwidth.