Install
Installing Tomcat on MacOS¶
Prerequisite¶
-
Tomcat 10 requires Java version 8 or later and since OS X 10.7 Java is not (pre-)installed anymore.
1
java --version
-
Once java is installed add the JAVA_HOME variable to your shell’s startup profile
1
export JAVA_HOME=<Path to Java Home Dir>
Install Tomcat¶
- Download latest .tar.gz Core binary from Tomcat Download Page
-
Unarchive ~/Downloads/apache-tomcat-10.0.23.tar.gz
1 2
cd ~/Downloads/ tar -xzf ~/Downloads/apache-tomcat-10.0.23.tar.gz
-
Open the Terminal app to move the unarchived distribution to /usr/local like so:
1 2
sudo mkdir -p /usr/local sudo mv ~/Downloads/apache-tomcat-10.0.23 /usr/local
-
To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version):
1 2
sudo rm -f /Library/Tomcat sudo ln -s /usr/local/apache-tomcat-10.0.23 /Library/Tomcat
-
Change ownership of the /usr/local/apache-tomcat-10.0.23 folder hierarchy:
1
sudo chown -R <your_username> /usr/local/apache-tomcat-10.0.23
-
Make all scripts in Tomcat’s ./bin folder executable:
1
sudo chmod +x /usr/local/apache-tomcat-10.0.23/bin/*.sh
Running Tomcat¶
-
Starting Tomcat by executing the provided scripts, like so:
1
/Library/Tomcat/bin/startup.sh
-
Stopping Tomcat by executing the provided scripts, like so:
1
/Library/Tomcat/bin/shutdown.sh