Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
<role rolename="tomcat"/> <role rolename="admin"/> <role rolename="manager"/> <role rolename="manager-gui"/> <user name="admin" password="XXXXXX" roles="tomcat,admin,manager,manager-gui"/>
Then save the file
(Optional) If you've installed Tomcat as a service, you can configure it to start automatically when the computer boots:
sudo useradd tomcat6 cd /opt sudo tar zxvf apache-tomcat-7.0.29.tar.gz sudo ln -s apache-tomcat-7.0.29 tomcat7 sudo chown tomcat7.tomcat7 apache-tomcat-7.0.29
Open the Tomcat users file (e.g. /opt/tomcat/conf/tomcat-users.xml) in a text editor. Create a new user called admin with the roles admin,manager and manager-gui. This file should be protected so you will need to open it as root (e.g. sudo nano /opt/tomcat/conf/tomcat-users.xml)
<role rolename="tomcat"/> <role rolename="admin"/> <role rolename="manager"/> <role rolename="manager-gui"/> <user name="admin" password="XXXXXX" roles="tomcat,admin,manager,manager-gui"/>
sudo apt-get install tomcat7
Open the Tomcat users file (e.g. /etc/tomcat7/tomcat-users.xml) in a text editor. Create a new user called admin with the roles admin,manager and manager-gui. This file should be protected so you will need to open it as root (e.g. sudo nano __/etc/tomcat/tomcat-users.xml)
<role rolename="tomcat"/> <role rolename="admin"/> <role rolename="manager"/> <role rolename="manager-gui"/> <user name="admin" password="XXXXXX" roles="tomcat,admin,manager,manager-gui"/>
Turn off tomcat security flag in /etc/init.d/tomcat7 file: Find "TOMCAT7_SECURITY=yes" and change it to "TOMCAT7_SECURITY=no" For Tomcat 7, it is "no" by default.
Create OpenMRS application data directory and make it writable by Tomcat: (so that the runtime properties file can be written by the webapp during initial startup)
sudo mkdir /usr/share/tomcat7/.OpenMRS sudo chown -R tomcat7:tomcat7 /usr/share/tomcat7/.OpenMRS/
To know more about the recommended application directory for OpenMRS refer to this discussion on Talk.
To start/stop/restart tomcat7, please type the following commands:
sudo service tomcat7 start sudo service tomcat7 stop sudo service tomcat7 restart
In newest versions of Tomcat(> version 7), by default HttpOnly flag will be set by the server. But in older versions of Tomcat, it needs to set this flag through a configuration. The HttpOnly flag is an additional flag that is used to prevent an XSS (Cross-Site Scripting) exploit from taking access to the session cookie. Because one of the most known ways of subjecting to an XSS attack is access to the session cookie, and to subsequently hijack the victim’s session, the HttpOnly flag is a useful prevention mechanism where a client side script won't be able to access the session cookie from. To add the HttpOnly flag to session cookies in older versions of Tomcat, you need to edit the <TOMCAT_HOME>/conf/context.xml to add useHttpOnly="true" attribute as below:
<Context useHttpOnly="true"> <Manager pathname="" /> <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> </Context>
2 Comments
Stephen Waweru
Also it would be important to add permissions to the tomcat location on var/lib in ubuntu
Daniel Kayiwa
Neha Verma i see you made edits to the paths. But on some systems, those are the actual paths. So i think you would just add alternative paths for other systems instead of overwriting them.