How To

How to Install Tomcat on Mac

How to Install Tomcat 7 on Mac

Step 1: Download and Install Tomcat
  1. Goto http://tomcat.apache.org ⇒ Download ⇒ Tomcat 7.0 ⇒ 7.0.{xx} (where {xx} denotes the latest release) ⇒ Binary distribution ⇒ Core. Download the “tar.gz” package (e.g., “apache-tomcat-7.0.{xx}.tar.gz“).
    • Goto “~/Downloads“, double-click the downloaded TAR file (e.g., “apache-tomcat-7.0.{xx}.tar.gz“) to expand it into a folder (e.g., “apache-tomcat-7.0.{xx}“).
      (Notes for Advanced Users)
      Alternatively, you can use the tar command to expand the tarball as follow:

      $ cd ~/Downloads
      $ tar xvf apache-tomcat-7.0.{xx}.tar.gz
    • Move the extracted folder (e.g., “apache-tomcat-7.0.{xx}“) to “/Applications“.
    • Rename the folder “tomcat”, for ease of use.
  2. (Notes for Advanced Users):

    • It is probably better to keep the tomcat in “/usr/local” or “/Library”.
    • Instead of renaming the tomcat’s folder, it it better to create a symlink called tomcat as follows:
      $ cd /Applications
      $ sudo ln -s apache-tomcat-7.0.{xx} tomcat
    • For security reason, you should not run Tomcat as root user. Instead, assign Tomat to user nobody (of group nobody):
      $ sudo chown -R nobody:nobody /Applications/tomcat
      // -R: recursive thru sub-directories
      // {user}:{group}


      // To start tomcat as user nobody

      $ cd /Applications/tomcat/bin
      $ sudo -u nobody ./startup.sh // No console message
      $ sudo -u nobody ./catalina.sh run // See console message

      // To stop tomcat
      $ sudo -u nobody ./shutdown.sh

Step 2: Configure Tomcat Server

Read this to Configure Tomcat Server

Step 3: Start the Tomcat Server

To start the Tomcat server, open a new “Terminal” (Go ⇒ Utilities ⇒ Terminal) and issue:

$ cd /Applications/tomcat/bin
$ ./catalina.sh run

Check for the Tomcat server’s TCP port number from the console messages. The default is 8080.

To verify if the Tomcat server is started, start a browser (Safari or Chrome) and issue URL http://localhost:9999, suppose that Tomcat is running on the TCP port number of 9999.

Step 4: Shutdown the Tomcat Server

To shutdown the Tomcat server, you can simply press control-c (NOT command-c) on the tomcat console, or issue command:

$ cd /Applications/tomcat/bin
$ ./shutdown.sh



Looking for windows installation steps

Jay Prakash Kumar

If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Facebook or Twitter. Jay Prakash is a founder of Professional Hacker, Technical Writer, Software Developer, Security Analyst and Technology Enthusiast with a keen eye on the Cyber-world and other technology-related developments.

Leave a Reply

Your email address will not be published. Required fields are marked *