Setting Up a Production Environment
When the time comes to set up development/production instances of Tomcat for serving your applications, some customers have the luxury of separating this process out to two different physical boxes. However, other customers might only have access to one application server. This document will explain how to load Dual Tomcat services to a Windows Operating System. This document will assume that you have access to only one physical drive.
- Create a folder off of the root called “production”.
- Copy the m-Power folder into the production folder.
- Edit this file: \production\m-power\tomcat\conf\server.xml in Notepad.
- Change the Server Port to 8006 on line 22.
- Change the Connector port to 80 on line 67 (If 80 is in use, please select a different port).
- Delete lines 144 through 149.
- Edit the docBase reference on line 152 from “/m-power/mrcjava” to “/production/m-power/mrcjava”.
- Save and close.
- Lastly, you’ll need to setup Production Tomcat as a Service. Open cmd and type
cd\. - Type
cd production\m-power\tomcat\bin. - Type
service.bat install TC6PROD. If sucessful, you should see the image below. Otherwise, please see the Notes at the end of this document. - Type
tomcat6w //ES//TC6PROD. This will cause a dialog box to appear to modify your newly created service. - Change the startup from “Manual” to “Automatic”.
- Navigate to the Java Tab. Uncheck the “Use Default” option, and change the Java Virtual Machine to “C:\Program Files\Java\jdk1.6.0_07\jre\bin\server\jvm.dll”.
- Add the following lines to the Java Options Window:
- -Xmx512m
- -Xms512m
- -XX:PermSize=256m
- -XX:MaxPermSize=256m



Notes
- When you take an m-Power update be sure to apply the update to development as well as production.
- When pointing users to production, be sure to use the non-port address if you have set your connector port as 80. If you have not, commonly done when another service is already using port 80, please point to the port referenced in the connector port setting within your server.xml file.
- When you need to promote an application to production, simply copy the affected files from c:\m-power\mrcjava\WEB-INF\classes\DD to c:\production\m-power\mrcjava\WEB-INF\classes\DD.
- When installing Tomcat as a service, there are three common problems people run into:
- Not starting the command line as an administrator — Since you will be running commands that require administrator access, please be sure to right click on CMD and choose “Run As Administrator”, otherwise the installation step of Installing Tomcat as a service will fail, as indicated in the picture below.
- There is already a service with that name — Sometimes, whether from other users or even your development instance of Tomcat, there is already a service with the name you are trying to assign to your production instance of Tomcat. When this happens, you will receive an error message when trying to install Tomcat as a service that the installation failed, as indicated in the picture above. In this situation, either try a new, unique name or remove the old version by typing
sc delete TCNAME, where TCNAME is the name of the service you are trying to remove. - You are running the wrong version of Tomcat — There are 32 bit versions as well as 64 bit versions. Please ensure you are running the correct version for your system, otherwise you will not be able to start Tomcat, even though you have installed it correctly with the correct settings.

