Installing Tomcat 6 on Windows 7

Tomcat is an open source Java Servlet container developed by the Apache Software Foundation. It is bundled with a very capable Java based Web (HTTP) Server.

Which Java to install ?

Tomcat requires Java to be installed – it is afterall a Java Servlet container. Since Tomcat 5.5 the dependency on the JDK (Java Development Kit) for compilation of JSPs (Java Server Pages) has been removed. The Eclipse JDT Java compiler has been bundled with Tomcat to provide this capability. This means that we just need to install the JRE (Java Runtime Environment).

So its a simple decision then – or is it ?

Java Virtual Machines

From the Oracle Java SE Documentation:

The JDKTM provides one or more implementations of the JavaTM virtual machine (VM):

  • On platforms typically used for client applications, the JDK comes with a VM implementation called the Java HotSpotTM Client VM (client VM). The client VM is tuned for reducing start-up time and memory footprint. It can be invoked by using the -client command-line option when launching an application.

  • On all platforms, the JDK comes with an implementation of the Java virtual machine called the Java HotSpot Server VM (server VM). The server VM is designed for maximum program execution speed. It can be invoked by using the -server command-line option when launching an application.

The above documentation and information from other resources on the differences between the Client VM and Server VM suggest that we should be using the Server VM when running Tomcat on a server.

Unfortunately the Server VM is only bundled with the JDK. So we are back to our dependency on the JDK. If you are installing Tomcat on a server and require the optimisations around speed and for long lived processes install the JDK and use the Server VM.

Which Tomcat Binary Distribution ?

Just when you thought it was getting simpler … The Tomcat 6 Downloads page has 6 options for binary distributions.

Pick the 32-bit/64-bit Windows Service Installer option. This distribution is geared towards users planning to launch Tomcat through Windows services and also provides the compiled APR/native library.

Installing

Download and install the Java 6 SE JDK. Remember to install the 64-bit version if you are running on a 64-bit OS. The Tomcat installer will look for a 64-bit Java VM on a 64-bit OS.

Download and install the Tomcat 6.0.29 32-bit/64-bit Windows Service Installer.

Ensure that you select the Service and Native options under the Tomcat component. The Manager application component provides a web based management application.

 Tomcat 3

You will be asked to choose an HTTP connector port for Tomcat and if you chose to install the Manager component you will also be required to configure authentication details for the Manager.

Tomcat 5

When asked to provide the path to the java virtual machine to use, specify the JRE folder of the installed JDK.

Tomcat 6

When the install is complete, the Tomcat service will be automatically started if you chose Run Apache Tomcat in the final screen on the install wizard.

Tomcat 9

Confirm the install

Once the service has started, the Tomcat icon should appear in the taskbar. Right click the icon and select Configure from the menu.

Tomcat 10 Tomcat 11

 

Select the Java tab on the Apache Tomcat 6 Properties window. Confirm that the Server VM (jre6\bin\server\jvm.dll) is being used by Tomcat.

Tomcat 12

Open the Windows Services manager and confirm that the Tomcat service has been correctly installed.

Tomcat 14

Finally confirm that you can communicate with Tomcat on the configured HTTP port. Open http://localhost:8080 in your browser.

Tomcat 15

Advertisement
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

34 Responses to Installing Tomcat 6 on Windows 7

  1. Anis says:

    Hello,
    How to install tomcat 6 on windows 7, I don’t found how to do it
    Thanks

  2. Anis says:

    Thank you for your reply,

    I downloaded Tomcat 6.0.29, then I extracted it in a folder, after that I does not found an exe file that permit me to install it,
    I double clicked on file catalina (under bin), also the file startup (under bin) but it does not work,
    I haven’t an exe file that permit me to launch the installation

    Thanks

  3. Anis says:

    I forget to notice that in the run of windows 7, it shows a msgBox that says:
    Unable to open service topmcat6
    Have you any idea about this
    Thanks

  4. sakura says:

    thank you . your post was very useful

  5. rakesh says:

    Thanks a lot your post was very usefull….??

    However i have a new problem when i click on “configure tomcat” in All programs to start/stop the server my screen resolution changes… same repeats even when i click on “monitor tomcat”.

  6. Ashish says:

    Thanks Paul Bouwer. This was very useful information.

  7. naresh says:

    when i clicked the config/monitor tomcat in Allprogrames it shows access is denied.
    i am using tomcat6.0.32 and jdk6 in my windows7

  8. Pratheeba says:

    wow… thanks… really its useful for me….

  9. Mohammed Aleem says:

    Hi,I installed the tomcat6 on windows 7 but am unable to connect to http://localhost:8080/
    Thought i started the service , the Tomcat icon appears in the taskbar, can anybody suggest me..

    • Paul Bouwer says:

      Check that the Apache Tomcat 6 service is running via the Windows Services Management Console.

      If the service is running and you still cannot connect then check that the configured port for tomcat is correct. Check in the %TOMCAT_INSTALL_FOLDER%/conf/server.xml file for the port value in the tag under .

  10. Satyavrat says:

    Tomcat seems to work perfectly fine for me but connecting it to an Oracle Database is causing huge headaches!

  11. YG says:

    Thanks Mr.Paul

  12. B says:

    Hi….just incase this helps…..noticed that service name on my windows 7 install is tomcat6…not “Apache tomcat 6″ as shown in screen above.

    Not sure if this is specific to my installation, but thought it worth mentioning in case anyone else is looking for the more verbose service name.

    • Paul Bouwer says:

      Generally the longer DisplayName property on the service is used in the service console. I’m not sure why you are seeing the shorter Name property …

      
      PS C:\> Get-Service | where { $_.Name -match "tomcat"}
      
      Status   Name               DisplayName
      ------   ----               -----------
      Running  Tomcat6            Apache Tomcat 6
      Stopped  Tomcat7            Apache Tomcat 7
      
  13. manolis says:

    Hello! I have a problem with the installation. I finish the above steps but when i go to http://localhost:8080 my browser only shows a blank page. :\

    • Paul Bouwer says:

      As per the reply to Mohammed Aleem:

      Check that the Apache Tomcat 6 service is running via the Windows Services Management Console.

      If the service is running and you still cannot connect then check that the configured port for tomcat is correct. You can get the configured port in the %TOMCAT_INSTALL_FOLDER%/conf/server.xml file by checking the port attribute’s value in the Connector tag at the following XPath location – /Server/Service[@name="Catalina"]/Connector[@protocol="HTTP/1.1" ].

      • Paul,

        Thank you for all the information you have in here. It is definitively very useful. I have the same problem than manolis and Mohammed. Basically when I try to open http://localhost:8080 I get the webpage not found error, but the apache icon still shows up in the inferior right corner. I went to the file you said and I get this from there: “Connector port=”8080″ redirectPort=”8443″ connectionTimeout=”20000″ protocol=”HTTP/1.1″/”. So I am assuming the port 8080 is correct. I have installed tomcat 6.0.33 in a windows 7 professional machine. I have tried giving the tomcat executable administrator privileges (right click, compatibility), I have tried installing tomcat 7, I have tried restarting the machine multiple times, I have tried both installing jre 7 and jdk 7, I have tried starting tomcat from eclipse. Nothing seems to work. I feel that I am running out of ideas. Any suggestion ?

        Boris

    • Paul Bouwer says:

      Are you using Internet Explorer when trying to get to the http://localhost:8080 URL ? If so, make sure you are using the http:// prefix – IE doesn’t seem to route correctly without it.

      Otherwise try Chrome and see if you have the same issue.

      • Paul,

        Thank you for your answer. I should have mentioned that I though about that and I included the prefix “http://” when trying to access the server from IE, additionally I went ahead and I installed Chrome. It is interesting that in IE I get the bad request error, but in Chrome I get a blank page that only says “fail”. Additionally, I should mention that I added the variable %JAVA_HOME% to the environment variables and to path, but not success yet. Any ideas ?. Thanks,

        Boris

  14. Ben says:

    Paul

    Great blog. I am attempting to install Tomcat7 on a Win7pro machine. Installation went fine and the installer was able to start the service. As part of the installation for the specific webapp I am trialling however, I had to stop the service (which was done via the Tomcat monitor). I made some config changes using the monitor, specifically adding

    -XX:PermSize=128m
    -Xincgc

    \ also the initial mermory pool and maximum mem pool to 512M

    However when I restart the service using either windows service manager or Tomcat Monitor. The service simple enters a “Starting” state, never reaching the Started state. In this state it will not respond to stop commands or most other commands using sc.exe.

    Any advice for debugging the installation.

    • Paul Bouwer says:

      Ben

      Make sure that any Java options entered in the Tomcat Monitor’s Java Options text box do not have trailing whitespace – this has caught me out before.

      If that still doesn’t help your best bet is to look in the latest %TOMCAT_INSTALL_FOLDER%/logs/catalina.*.log file to determine why tomcat is not starting up.

  15. selvamuthukumaran says:

    This site is very useful and important

  16. Ravali says:

    Thank you…has been very very useful :)

  17. M says:

    Thank you Paul. Your info pushed me out of the rut I have been for the past couple of hours. Maybe you can help the Apache/Tomcat group with clearer installation steps on their website :)

    Have a great one!

  18. Nirav Patel says:

    Great thankx….loved your blog….

  19. Rodrigo says:

    Realy useful.
    Thanx

  20. neeraj says:

    hi
    I have install tomcat on my window 7 machine,when typing localhost:8080 on i.e its showing unsuccessful but with chrome its showing installed

    • Paul Bouwer says:

      I seem to have the same issue with IE – you need to specify the http:// prefix otherwise IE does not seem to be able to route correctly to the site.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s