Monday, November 2, 2015

Configure Apache Tomcat with a service on Windows

As a result of some problems with my local Apache Tomcat and the windows services here are some notes when installing the software on windows.
As first you have to decide which version you want to install. When working with APEX and the ORDS the minimum supported Version of Apache Tomcat is 7, but you can also use 8. So i downloaded the newest version here https://tomcat.apache.org/download-80.cgi
Use the 32-bit/64-bit Windows Service Installer to install the software including the service for tomcat.
If you use the zip-version or you have trouble with your tomcat service you can to create the service on your own. Therefor start the windows shell and go into your tomcat\bin directory. Check at first whether JAVA_HOME and JRE_HOME are set correctly. Type SET and search for both Parameter in your listing. If one of the is missing you can set these values like that:

C:\SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_45
C:\SET JRE_HOME=C:\Program Files\Java\jre1.8.0_65

Keep in mind that you should always use the newest version of Java. When i updated to the newest version of java and removed the old one my tomcat throw the Errorcode 1 when trying to start the service. When the Java-Parameters are correct you can create the service with this command:

C:\Program Files\Tomcat 8.0\bin\service install

if the service is already installed you can remove the service with

C:\Program Files\Tomcat 8.0\bin\service remove

If you still have trouble check whether another application is using the port you have choosen when installing Apache Tomcat. For example the standard port for the Oracle XE EPG is 8080 and Apache Tomcat also uses 8080 per default. There can only be one application on this port. To change the port look into your tomcat\conf\server.xml and search for the connector with the protocol="HTTP...". This is the port where Apache Tomcat is listening for the browser call.