Deploying OpenMRS on an Amazon EC2 Server

64 views
Skip to first unread message

Amogh Karnik

unread,
May 23, 2013, 5:45:47 AM5/23/13
to implem...@openmrs.org
I'm trying to install OpenMRS on an Amazon EC2 server running Ubuntu 12.04 LTS. Thus far I've followed the documentation for completing fresh installs of Java, Tomcat, and MySQL, and have the default page for my server running (the default page says "It Works!". However, I have not been able to deploy OpenMRS 1.9.3 and access the webapp from my local machine. 
I have downloaded the .war file for version 1.9.3 and have unpackaged it in:

    /var/lib/tomcat6/webapps/openmrs

After unzipping the contents of the war file, I restarted Tomcat using:

    sudo service tomcat6 restart

After restarting Tomcat, I ran the following commands (as suggested in the Wiki Documentation)

    cd /var/lib/tomcat6/webapps/openmrs
    sudo chown -R tomcat6 /var/lib/tomcat6/webapps/openmrs

When I try and access the webapp from my local machine using my server address and :8080/openmrs, the page fails to load. How can I fix this so that I can configure OpenMRS and finish the installation on my server? 


Ali Habib

unread,
May 23, 2013, 6:02:42 AM5/23/13
to implem...@openmrs.org
Hi Amogh,

Do you see any error messages in the tomcat logs (they're usually found in /var/lib/tomcat6/logs)

Also what is the error message your browser is showing you when you access your_server_address:8080/openmrs?

Ali


Ali Habib
Director, Informatics
Interactive Research and Development




--
OpenMRS Implementers: http://go.openmrs.org/implementers
Post: implem...@openmrs.org
Unsubscribe: implementers...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/
 
 

Harsha Siriwardena

unread,
May 23, 2013, 6:33:18 AM5/23/13
to implem...@openmrs.org
Hi Amogh,

Did you add the inbound port 8080 into your EC2 Instance's Secrity group ?
In Amazon EC2 by default all the HTTP ports (other than 80) are blocked. So to access them from outside you need to add particular port (i.e. 8080) as a inbound port.

Additional information can be found here:  Installing OpenMRS on Amazon EC2
 
-Harsha

Harsha Siriwardena
[harshadura.net]

Rowan Seymour

unread,
May 23, 2013, 7:23:38 AM5/23/13
to implem...@openmrs.org
OpenMRS is probably failing to start - and you should be able to see the reason in /var/logs/tomcat6/catalina.out

Could be that it's unable to find a suitable data directory. By default OpenMRS tries to create a data directory called .OpenMRS in the current user's home folder. For Tomcat on a Ubuntu server this will be /usr/share/tomcat6/.OpenMRS so you should create this directory and make sure Tomcat has permissions to access it.

sudo mkdir /usr/share/tomcat6/.OpenMRS
sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6/.OpenMRS


Rowan Seymour
tel: +250 783835665

Amogh Karnik

unread,
May 23, 2013, 8:05:48 AM5/23/13
to implem...@openmrs.org
Hi Ali, Harsha, and Rowan, 
Thanks for your responses.  I did see error messages in the the catalina.out log file related to the /usr/share/tomcat6 directory. Specifically, I get this series of warnings at the start of the log file:
May 22, 2013 11:07:17 AM org.apache.catalina.startup.ClassLoaderFactory validat$
WARNING: Problem with directory [/usr/share/tomcat6/server/classes], exists: [f$
May 22, 2013 11:07:17 AM org.apache.catalina.startup.ClassLoaderFactory validat$
WARNING: Problem with directory [/usr/share/tomcat6/server], exists: [false], i$
May 22, 2013 11:07:17 AM org.apache.catalina.startup.ClassLoaderFactory validat$
WARNING: Problem with directory [/usr/share/tomcat6/shared/classes], exists: [f$
May 22, 2013 11:07:17 AM org.apache.catalina.startup.ClassLoaderFactory validat$
WARNING: Problem with directory [/usr/share/tomcat6/shared], exists: [false], i$
 

I also have the following error message:

ERROR - Listener.clearDWRFile(325) |2013-05-22 13:14:20,221| Unable to clear ou$
java.io.FileNotFoundException: /var/lib/tomcat6/webapps/openmrs/WEB-INF/dwr-mod$


I followed Rowan's directions for creating the /usr/share/tomcat6/.OpenMRS directory and assigning permissions, but I still can't access the webapp. When I attempt to access the :8080/openmrs url, I don't get an error message in my browser. The page continues to load until it eventually times out. 
As for the inbound ports, I have already enabled 8080 in my instance's security group. 


Thanks again for all of your help.
Amogh Uday Karnik
Duke University '13 | M.S. Candidate, Global Health
Duke University '12 | B.S.E., Biomedical Engineering

Raaj S

unread,
May 23, 2013, 5:26:02 PM5/23/13
to implem...@openmrs.org
some troubleshooting:

echo $LD_LIBRARY_PATH
echo $PATH
paste /var/log/apache/<error_log>
>>> EC2<https://wiki.openmrs.org/display/docs/Installing+OpenMRS+on+Amazon+EC2>
>> *Rowan Seymour*
>> tel: +250 783835665
>>
>> --
>> OpenMRS Implementers: http://go.openmrs.org/implementers
>> Post: implem...@openmrs.org
>> Unsubscribe: implementers...@openmrs.org
>> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>>
>>
>>
>
>
>
> --
> Amogh Uday Karnik
> Duke University '13 | M.S. Candidate, Global Health
> Duke University '12 | B.S.E., Biomedical Engineering
>
Reply all
Reply to author
Forward
0 new messages