Pages

Thursday, December 8, 2011

Install Tomcat on Mac OS X

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.

# Add the wget alias for curl to the end of the bash_profile file
#----------------------------------------------------------------------------#
echo 'alias wget="curl -O"' >> ~/.bash_profile

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.
#----------------------------------------------------------------------------#
# 1. ) Navigate to your "projects" directory
# The path for this guide is "/projects/", but the reader's path may be different.
#----------------------------------------------------------------------------#
cd /projects
#----------------------------------------------------------------------------#
# 2. ) Create a new directory named "tomcats" and navigate into "tomcats"
#----------------------------------------------------------------------------#
mkdir tomcats
cd tomcats
#----------------------------------------------------------------------------#
# 3. ) Download Apache Tomcat
# Note: Visit http://tomcat.apache.org to get the URL of the needed version of Tomcat
#----------------------------------------------------------------------------#
wget http://apache.cs.utah.edu/tomcat/tomcat-7/v7.0.10/bin/apache-tomcat-7.0.10.tar.gz
#----------------------------------------------------------------------------#
# 4. ) Unpack Tomcat and delete apache-tomcat-7.0.10.tar.gz
#----------------------------------------------------------------------------#
tar -xzvf apache-tomcat-7.0.10.tar.gz
rm apache-tomcat-7.0.10.tar.gz
#----------------------------------------------------------------------------#
# 5. ) Rename "apache-tomcat-7.0.10" to "tomcat"
#----------------------------------------------------------------------------#
mv apache-tomcat-7.0.10 tomcat
#----------------------------------------------------------------------------#
# 6. ) Edit "tomcat/bin/startup.sh" to add JAVA_HOME
#----------------------------------------------------------------------------#
nano tomcat/bin/startup.sh
# Add the following line after the one that starts with EXECUATBLE:
# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
# Save changes, press Ctrl+o ; return ; Ctrl+x
# Note: Application developers can browse "/System/Library/Frameworks/JavaVM.framework/Versions"
# and substitute the appropriate version of Java
#----------------------------------------------------------------------------#
# 7. ) Start Tomcat
#----------------------------------------------------------------------------#
sh tomcat/bin/startup.sh
#----------------------------------------------------------------------------#
# Open a web browser and navigate to http://localhost:8080
# Tomcat can be shut down with sh tomcat/bin/shutdown.sh
#----------------------------------------------------------------------------#

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.
#----------------------------------------------------------------------------#
# 1. ) edit "tomcat/conf/tomcat-users.xml"
#----------------------------------------------------------------------------#
nano tomcat/conf/tomcat-users.xml
# Save changes when complete, press Ctrl+o ; return ; Ctrl+x
#----------------------------------------------------------------------------#
<tomcat-users>
<!-- comments and default content in this area -->
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui,admin-gui"/>
</tomcat-users>
#----------------------------------------------------------------------------#
# 2. ) Restart Tomcat to apply changes in configuration
#----------------------------------------------------------------------------#
sh tomcat/bin/shutdown.sh
sh tomcat/bin/startup.sh
#----------------------------------------------------------------------------#

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
from: http://webtechman.com/blog/2011/03/09/how-to-install-apache-tomcat-web-app-server-in-10-minutes/

No comments:

Post a Comment