Installing Tomcat on Mac OSX (Snow Leopard)

Complete fresher here, and I guess there might be guys out there in the same boat. Here are the steps I needed to go through to make it work. Following some pointers on the way there:

Start by downloading what we need from http://tomcat.apache.org/.

For the latest version see the Which version , but I used 6.x and got the core zip.

After you have downloaded it , most likely to the downloads folder unpack it and rename the folder to Tomcat for simplicity

Copy the complete folder to $$your_profile$$/Library

After you have done this , and got stuck here for a bit, run the following command to enable you to execute the commands from terminal.

chmod a+x /users/$your_profile$/library/tomcat/bin/*.sh

If you don’t expect to see the following:

Peter-Versters-MacBook-Pro:~ Peter$ /users/peter/Library/Tomcat/bin/startup.sh

-bash: /users/peter/Library/Tomcat/bin/startup.sh: Permission denied

This will make the files writeable and allow you to start the service.

Then execute the following:

/users/peter/$your_profile$/Tomcat/bin/startup.sh

Provided you are still with me navigate to http://localhost:8080 to test if the services is running.

Final step to give you admin access to the site:

is to set up the users as per the following:

conf/tomcat-users.xml in your installation. That file will contain the credentials to let you use this webapp.

You will need to add manager role to the config file listed above. For example:

<role rolename="manager"/>
<user username="tomcat" password="s3cret" roles="manager"/>
Happy Tomcatting...

Comments

6 Responses to “Installing Tomcat on Mac OSX (Snow Leopard)”

  1. stefanyo on January 24th, 2010 06:37

    /users/peter/$your_profile$/Tomcat/bin/startup.sh

    SHOULD BE

    /users/$your_profile$/library/Tomcat/bin/startup.sh

    :-D

  2. Peter on January 24th, 2010 23:09

    Good spot, Thanx

  3. Tony Grey Jr on January 26th, 2010 21:47

    Finally, someone with the straightforward code to get us simpletons up and running with Tomcat on Mac. Now I need to get PostgreSQL running. :-( Thanks!

  4. Peter on January 27th, 2010 09:53

    A mere simpleton myself. Thanx

  5. Reinhard on February 11th, 2010 16:23

    at my mac book it remains with permission denied , what ist not surprising because its the
    same string (/users/reinhardschwegler/Library/Tomcat/bin/startup.sh ) as above
    what do you mean with “This will make the files writeable and allow you to start the service.” what is ‘This’ is there a line missing?

  6. Peter on February 28th, 2010 00:09

    This refers to “chmod a+x /users/$your_profile$/library/tomcat/bin/*.sh” Most guys managed to get it working following the instructions. Would be worth taking steps outlined from the top again.

Got something to say?