Sunday, March 14, 2010

Mac: 4 easy steps to Install Tomcat on Mac OSX Snow Leapord

4 easy steps to Install Tomcat on Snow Leopard.

STEP 1: -- Download Tomcat 6, Binary Distribution, under Core (zip or tar.gz) from
-- Unzip the downloaded package.

STEP 2: -- Change directories to Library
      cd /Library
-- Create the Tomcat directory
    mkdir Tomcat

-- Copy the unzipped downloaded package: apache-tomcat-6.0.x
-- Paste it in this newly created Directory : /Library/Tomcat. 

-- Edit the shell local startup script. Create if it does not exist.
nano ~/.profile
-- Add the following 2 lines to the .profile file: (BASH)
-- Remember in apache-tomcat-6.0.x, the 'x' refers to what ever version # you have downloaded
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Library/Tomcat/apache-tomcat-6.0.x

-- Open a new Terminal window. Execute the following
-- cd /Library/Tomcat/apache-tomcat-6.0.x/conf
-- Edit the tomcat-users.xml file
nano tomcat-users.xml
-- Add the following, where admin is the administrator name you assign and password is the password
<user username="admin" password="password" roles="standard,manager,admin"/>

-- The tomcat-users.xml file should look something like this:

<roll rollname="tomcat"/>
<roll rollname="role1"/>
<user username="tomcat" password="tomcat" roles="tomcat" />
<user username="role1" password="tomcat" roles="role1" />
<user username="both" password="tomcat" roles="tomcat,role1" />
<user username="admin" password="password" roles="standard,manager,admin"/>

-- Save the tomcat-users.xml file and quit the editor

And This is it....
Now, to start tomcat
-- Execute the Tomcat startup script located under /Library/Tomcat/apache-tomcat-6.0.x/bin
-- ./
-- Test it by opening the page : http://localhost:8080/

Now, to stop tomcat
-- Execute the Tomcat startup script located under /Library/Tomcat/apache-tomcat-6.0.x/bin
-- ./

No comments:

Post a Comment