When the test and the production applications are present on the same server and a service with the name openspecimen is already created. User will have to create a service manually for the one of the applications since installer creates the service with the name openspecimen by default.Please follow the below steps to set tomcat Tomcat as service:
- Go to ${TOMCAT_HOME}/bin
- Open 'openspecimen' file in edit mode. Please use openspecimen file if not present in the folder
- Search for 'CATALINA_HOME'
- Set the 'CATALINA_HOME' to your tomcat home. The value of this variable will be same as ${TOMCAT_HOME}
- Rename the file to 'os_prod' and change the service name in the file as well.
- Copy 'os_prod' file and paste it into /etc/init.d
- Stop the tomcat
- Go to ${TOMCAT_HOME}/bin
- Run the command: sudo ./os_service_install.sh This will install the service and start the tomcat
Set the service to start on reboot
- sudo /sbin/chkconfig --list os_prod
If nothing lists then run the below command otherwise directly run #3. - sudo /sbin/chkconfig --add os_prod
- sudo /sbin/chkconfig os_prod on
sudo chkconfig --level 6 os_prod on