Installing Tomcat on Mac can be done in three steps. Following the steps below you can have tomcat running on your Mac in no time.
Step 1: Download and Install Tomcat Binaries
Download the most recent stable build of Tomcat from an Apache project mirror site. Unzip the binaries into a simple location (I did it in /Users/username/Documents). By default, the unpacked folder name will be something like "apache-tomcat-x-x-xx". I recommend changing it to "tomcat" for ease of use.
Step 2: Configure the env variables
For our purpose we need to set up JAVA_HOME and CATALINA_HOME variables. Setting up these variables will ensure we don't have to use the complete path name.
To set the variables, open a new Terminal window and use the following command to open the system profile for editing.
vi ~/.profile
Once you've opened the profile, add the following lines to set the JAVA_HOME and CATALINA_HOME variables:
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Path/To/Tomcat/Home
Step 3: Time to start Tomcat
Start Tomcat by navigating to the "bin" folder and executing "startup.sh" from the command line. After running the script, you can test if Tomcat has been successfully installed by visiting http://localhost:8080 on your machine. If the installation was successful, your browser should display the Tomcat Welcome Page.
If you receive a permissions error, use the following command to allow access to all of the Tomcat shell scripts:
chmod 755 /Path/To/Tomcat/Bin/*.sh
Try to access the link again.
Step 1: Download and Install Tomcat Binaries
Download the most recent stable build of Tomcat from an Apache project mirror site. Unzip the binaries into a simple location (I did it in /Users/username/Documents). By default, the unpacked folder name will be something like "apache-tomcat-x-x-xx". I recommend changing it to "tomcat" for ease of use.
Step 2: Configure the env variables
For our purpose we need to set up JAVA_HOME and CATALINA_HOME variables. Setting up these variables will ensure we don't have to use the complete path name.
To set the variables, open a new Terminal window and use the following command to open the system profile for editing.
vi ~/.profile
Once you've opened the profile, add the following lines to set the JAVA_HOME and CATALINA_HOME variables:
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/Path/To/Tomcat/Home
Step 3: Time to start Tomcat
Start Tomcat by navigating to the "bin" folder and executing "startup.sh" from the command line. After running the script, you can test if Tomcat has been successfully installed by visiting http://localhost:8080 on your machine. If the installation was successful, your browser should display the Tomcat Welcome Page.
If you receive a permissions error, use the following command to allow access to all of the Tomcat shell scripts:
chmod 755 /Path/To/Tomcat/Bin/*.sh
Try to access the link again.
Comments
Post a Comment