How to Install Apache Tomcat Web App Server in 10 Minutes

Share your find
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

How to Install Apache Tomcat on Mac OS X Snow Leopard

This tutorial will guide the user through the steps of installing Apache Tomcat on Mac OS X.

Prepare the Mac OS X to use the cURL command as Wget : Open a Terminal Window (Applications -> Utilities -> Terminal) and add wget as an alias for curl to the bash_profile file with the following command. Close the Terminal Window when complete.

Apache Tomcat Web App Server

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. There is an open invitation to participate in this open development project. To learn more about getting involved, click here.

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.  Learn more here.

Mac OS X Snow Leopard

Mac OS X is renowned for its simplicity, its reliability, and its ease of use. So when it came to designing Snow Leopard, Apple engineers had a single goal: to make a great thing even better.  Learn more here.

7 Steps for Installing Tomcat on Mac OS X

Open a Terminal Window and follow these seven steps to install and configure Tomcat on Mac OS X. Application developers can download Tomcat and configure it with various editors, but the method described here can save time and reduce mistakes. This method also supports remote installation. The steps described here, with a modification to step six, can be used to remotely install Tomcat on Unix based systems. This is helpful in “Cloud Computing” environments.

Apache Tomcat App Server Successfully Installed on Mac OS X

Open a web browser and navigate to http://localhost:8080 Application developers should see the main Tomcat page displayed in their web browser.

How to Access Tomcat Virtual Host Manager

Application developers should also configure authorization for the Tomcat Virtual Host Manager.

How to Access Tomcat Application Manager

Application developers should also configure authorization for the Tomcat Application Manager.

How to Configure Authorization for Tomcat Administrators

Go back to the Terminal Window and edit “tomcat/conf/tomcat-users.xml” to add roles and users to “tomcat-users” that can access the Tomcat Administrator areas.

Apache Tomcat Web Application Manager

Authorization has now been configured for the Tomcat Application Manager.

Apache Tomcat Virtual Host Manager

Authorization has now been configured for the Tomcat Virtual Host Manager

Tomcat Mac OS X Resources

25 thoughts on “How to Install Apache Tomcat Web App Server in 10 Minutes”

  1. Dainish,

    I’m glad you found this tutorial on “How to install Tomcat” helpful. I also have methods on how to virtualize Tomcat Web Servers. Let me know if you are interested in learning how to create virtual servers.

    Thanks,
    Dan

  2. Normally, install the following apps, java, apache tomcat 6.xxxx and postgressql and finally MapleTA, Ver 7
    when the concurrent login reaches, 160, the server will start dragging and its performance will seriously reduced, tweak all that i could find on the apps installed.
    My connection is stiil is there a way to configure tomcat to create maxthread of about 1000 with count accept of say 500, so that I could like 500 users on the single server.
    thanks

    1. Thanks Joe, I’m glad you found this “How to install Tomcat App Server” helpful!

      I believe most people are busy, so simple is usually best.
      I see you are very busy on many interesting projects.
      Your JavaScript Sound Library, “Thunder JS” is impressive!

      I’m ( @WebTechMan ) also now following you on Twitter.

      Thank you for connecting and sharing,
      Dan

  3. i followed the instructions but i am still getting this error after executing the command sh tomcat/bin/startup.sh

    : command not foundsh: line 2:
    : command not foundsh: line 17:
    : command not foundsh: line 23:
    ‘omcat/bin/startup.sh: line 26: syntax error near unexpected token in
    'omcat/bin/startup.sh: line 26:
    case “uname” in

    any help ?

  4. Maya,

    Thanks for using this tutorial on How to Install Apache Tomcat!

    I have seen this issue before. The “sh command not found” error can be easily fixed. This problem can occur when installing Tomcat’s .zip package, instead of Tomcat’s tar.gz package on Unix-based systems. The incorrect package will throw these type of errors because of the wrong type of line return in the files. Reviewing the “startup.sh” file in a vi text editor would reveal strange line return characters that look like this: ^M

    How to fix sh errors in Tomcat
    Visit Tomcat and download a .tar.gz package http://apache.deathculture.net/tomcat/tomcat-7/v7.0.25/bin/apache-tomcat-7.0.25.tar.gz, as outlined in the steps above.

    Alternative method to fixing sh issues with Tomcat Install
    # Backup your file
    $ cp -p startup.sh startup.sh.bak
    # Remove carriage returns from your file
    $ cat startup.sh | tr -d ‘\r’ > startup.sh.new
    # Update real file without bad carriage returns
    $ mv startup.sh.new startup.sh
    # Start Tomcat
    $ sh startup.sh
    (You may need to repeat this process for other Tomcat files, which is why the first method is preferred)

    Please let me know if this helps you fix your Tomcat Installation.

    Thank you,
    Dan

    1. hey Dan it worked very well, i installed the .tar file and entered perfectly to localhost, but when u run the server shouldn’t we have on the terminal tomcat starting in XXX ms or something like that ?

      thanks ,

  5. Maya,

    That’s great news about the install of Tomcat working for you!

    When installing Tomcat Server on Microsoft Windows the standard behavior shows the log feedback in a terminal window when starting Tomcat.

    This type of behavior can also be accomplished on unix type of systems by configuration or with a simple command:

    #Open an additional terminal window and view the default tomcat log file:
    $ tail tomcat/logs/catalina.out

    #Review the last 200 lines of the tomcat log file with this command:
    $ tail -200 tomcat/logs/catalina.out

    Hope this helps,
    Dan

  6. One of the best tutorials ever seen on Internet …and I see them for at least 25 years…
    Just do what is written and it’s working

  7. Liked the tutorial but; when tried to serve a page I got HTTP 500 error.

    I saw the following msgs:

    javax.ws.rs.WebApplicationException: net.sf.ehcache.config.InvalidConfigurationException: There are 3 errors in your configuration:
    * CacheManager configuration: You’ve assigned more memory to the on-heap than the VM can sustain, please adjust your -Xmx setting accordingly
    * CacheManager configuration: You’ve assigned more memory to the on-heap than the VM can sustain, please adjust your -Xmx setting accordingly
    * CacheManager configuration: You’ve assigned more memory to the on-heap than the VM can sustain, please adjust your -Xmx setting accordingly

    Any suggestions on what I need to adjust?

    Thanks

    Bob

Comments are closed.