Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
Tomcat Port | This is the port at which to run Tomcat |
MySQL Port | This is the port at which to run MySQL |
File → Quit | This stops Tomcat and MySQL and then closes the application |
File → Launch Browser | This opens the OpenMRS login page for the current web application context |
File → Clear Output | This clears the output log in the user interface text area, but does not clear the log file written on the file system |
Start | This button runs Tomcat, which will automatically start the MySQL database engine if it was not already running. For the embedded MySQL, the first connection automatically starts the MySQL engine |
Stop | This button stops Tomcat and then also stops the MySQL database engine, without closing the application |
Minimizing or maximizing the application window does not have any effect on the server. The Close window icon will stop the server (behaves as File → Quit) but will first ask you to confirm.
-commandline | Run from the commandline |
-mysqlport | Use to override the MySQL port in the runtime properties file |
-tomcatport | Use to override the Tomcat port in the runtime properties file |
start | Use to start the server |
stop | Use to stop the server |
browser | Use to launch a new browser instance |
-noninteractive | No prompting, installs demo data |
-noninteractive -expert | No prompting, installs without demo data (just basic metadata) |
-noninteractive -empty | No prompting, installs with an empty database |
After running the standalone jar, it will take you to the OpenMRS log in web page where you can log in with the following default username and password:
OpenMRS username: admin
OpenMRS password: Admin123 or test
The MySQL database has these credentials by default:
MySQL username: openmrs
MySQL password: randomly generated at initial startup. Look in openmrs-runtime.properties
file under connection.password
Go to the extracted standalone folder and copy the password from the openmrs-runtime.properties
file. Then go to the database/bin folder and execute this at the commandline:
./mysql -u openmrs -p
That will prompt you for a password which you copied from the openmrs-runtime.properties
file.
If you are using graphical tools like Navicat and others, just create a new connection and enter the appropriate properties of username, password, port, etc as in the run-time properties file.
If running windows, then you can change the above command to: mysql.exe -u openmrs -p
If you are running multiple instances locally and want to specify a port, you can use something like this:
./mysql -u openmrs -p --port=3317 --host=127.0.0.1
You can override the default tomcat memory by changing these values in the "vm_arguments" run-time properties file property as below:
vm_arguments=-Xmx512m -Xms512m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:NewSize=128m
You can run the embedded tomcat in debug mode by appending values to the "vm_arguments" run-time properties file property as below:
vm_arguments=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5000
After starting the standalone with those vm arguments, if you are using an IDE like eclipse,
Go to "Run->Debug Configurations...". Click on "Remote Java Applications", then click "New". Type in the title. Set the port as 5000 and click the Debug button. Feel free to change the port to any other value.
You can profile the standalone with YourKit by appending values to the "vm_arguments" run-time properties file property as below:
vm_arguments=-agentpath:<full agent library path>
This is an example: vm_arguments = -agentpath:/Projects/YourKit_Java_Profiler_11.0.8.app/bin/mac/libyjpagent.jnilib
You can get details of the vm arguments from: http://www.yourkit.com/docs/10/help/agent.jsp
openmrs.war
file in "tomcat/webapps
" to something different. e.g openmrs-1.7.war
, openmrs-1.8-beta.war
, openmrs-1.8.war
, etc.openmrs-1.7-runtime.properties
, openmrs-1.8-beta-runtime.properties
, openmrs-1.8-runtime.properties
tomcat/webapps
" directory.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
":&server.socket=/tmp/openmrs.sock
" (without the double quotes) at the end of the value in the connection.url
key of the runtime properties file, and then restart the standalone application. If after doing that, you still get the same error message, then on your command line, add this: --socket=/tmp/openmrs.sockconnection.url
in the runtime properties file in this format: &server.parametername=value
.max_allowed_packet
=32M
, you would add it as: &server.
max_allowed_packet
=32M
Visit our Standalone FAQ section for a detailed FAQ list.
Please create a ticket in our issue tracker under the "OpenMRS Standalone" project.
The standalone is an executable jar. Inside the jar is a Java embedded MySQL jar and an embedded Tomcat jar. (TODO, add links to mysql and tomcat pages) The Tomcat home folder is the directory where you unzipped the standalone. The tomcathome/webapps already has the openmrs war file inside of it, ready to be run. When you execute the standalone jar, MySQL and Tomcat are started on open ports. Because the openmrs war file is in the tomcat webapps directory, it starts automatically.
Code for the standalone can be found in git: https://github.com/openmrs/openmrs-standalone
See the readme.txt file in the openmrs standalone code for instructions on how to build, package, and release the standalone application.
5 Comments
Daniel Kayiwa
Some one put information on this page which is not related to the standalone version of OpenMRS. I have removed and backed it up on the Non-Standalone Information child page.
Burke Mamlin
Running OpenMRS Standalone on Ubuntu 14.04, I needed to
&server.socket=/tmp/openmrs.sock
to the end of the connection.url in the runtime properties file (as suggested in the tips).Create a file called "mysql" in the main folder of the standalone (same folder as runtime properties)
chmod 755 mysql
on that file to make it executableAfter that, I can go into the OpenMRS Standalone folder and type this command to run MySQL connected to its database:
If manually setting the socket file doesn't cause any harm, perhaps we could do provide this by default.
Willa Mhawila
How does a developer go about building a standalone version themselves?
Pascal Brandt
There are some instructions here Willa Mhawila: https://github.com/openmrs/openmrs-standalone.
Daniel Kayiwa
Neha Verma first of all, thank you so so much for updating this documentation!
Do you mind create a new page for your dummies instructions and then make it available as part of the child pages?
Regarding the Java versions, have you tried out the reference application 2.5 standalone or platform 2.x standalone that run on Java 8?
Have you also run the standalone in commandline mode without the need of the browser?