Installing Tomcat 7 on Linux (via Command Line)
With the June 2012 release, m-Power now fully supports the use of Tomcat 7.
Current customers wishing to install Tomcat 7 need to follow the steps listed below:
Note: The following instructions assume a Linux installation located in /m-power. If this is not your case, please adjust the steps below accordingly.
Note: The following instructions assume you have sudo privileges. If not, please add sudo to the beginning of all commands.
Note: You must be running the June 2012 update of m-Power or later to run Tomcat 7.
- Download Tomcat 7 from mrc by clicking on this link.
Note: You can either FTP this file to your /m-power folder or use the wget command to save this file directly to your Linux server.
- Stop your current development instance of Tomcat.
- In /m-power, use the following command to move the tomcat folder to tomcat6:
mv tomcat tomcat6
- Extract the .zip file downloaded in Step 1 within the /m-power folder with the following command:
jar -xf tomcat.zip
- Edit /m-power/tomcat/conf/server.xml file by running the following command:
Near the end of the document, verify that the docBase for each <Context> is pointing at the correct folder location. Additionally, search for Connector port=8011 and modify this, if necessary to the Tomcat port you were using prior to the upgrade.
- Navigate to the /m-power/mrcwebgui/WEB-INF folder.
- Delete the web.xml file with the following command:
- Rename web.xml_tomcat7 to web.xml with this command:
mv web.xml_tomcat7 web.xml
- Navigate to the /m-power/proddata/lib folder.
- Delete the servlet.jar file by using the following command:
- Rename servlet.jar_tomcat7 to servlet.jar with the following command:
mv servet.jar_tomcat7 servlet.jar
- Navigate to the /m-power folder and edit the update-webxml.bat file with the following command:
- Modify the home directory to point to the correct location, such as:
Be sure to save.
- Run the update-webxml(Linux).sh program with the following command:
- Restart Tomcat
Once you have verified that all is in proper working order, please repeat the steps listed above for the production version of Tomcat.
Note: Tomcat 7 requires that every application created must exist in the C:\Program Files\mrc\development\m-power\mrcjava\WEB-INF\web.xml file. Existing applications will automatically be added when the update-webxml.bat program is run. New applications generated in Tomcat 7 will automatically add the necessary entries to web.xml on compile. However, this will only handle your development instance. For production, one of the following approaches must be run every time a new program is promoted:
- Option 1: Promote the web.xml using the Promote to Production utility.
- Option 2: Run the update-web.xml bat within your production /m-power folder.
- Option 3: Copy the web.xml file from C:\Program Files\mrc\development\m-power\mrcjava\WEB-INF to C:\Program Files\mrc\production\m-power\mrcjava\WEB-INF
Note: Once you are running Tomcat 7, you will need to keep the web.xml file in m-power\mrcwebgui\WEB-INF updated after applying new updates. After taking an update, rename the web.xml file in m-power\mrcwebgui\WEB-INF to web.xml_tomcat6 and then rename the web.xml_tomcat7 file to web.xml. After doing this, restart Tomcat. This will ensure you are always using the latest version of this file. The web.xml file in m-power\mrcjava\WEB-INF will not be affected by updates and as such does not require any additional steps after taking an update.
Note: Any customization made to the Tomcat 6 files (such as SSL, context paths, web.xml, etc.) will need to be configured again to the file in the new Tomcat 7 folder. This includes any Tomcat memory allocation changes made. To change your new Tomcat 7 memory, please follow these instructions:
- Open a PC command line.
(Editor’s Note: Use the actual path that m-Power is installed at.)
- Next, type
tomcat7w //ES//TC7DEVwhere TC7DEV is the service name you chose in the previous step.
- A window will pop up. Switch to the Java tab.
- Change the Java Virtual Machine option to:
Note: Make sure this path is pointing to the correct file on your server.
- Add the following six lines to the end of the Java Options window:
- Hit OK.
- Start the service as you usually would.