Installing and Configuring Apache Tomcat
The following topics are covered in this article:
macOS
macOS
1. Open a browser and go to:
2. Install using Homebrew:
brew install tomcat
3. Configuration files are installed in:
/opt/homebrew/etc/tomcat.
4. Use the following commands based on your requirements:
Start Tomcat
cd /path/to/tomcat/bin ./startup.sh
Stop Tomcat
ps -ef | grep tomcat kill -9 <PID>
Windows
1. Install Tomcat using Chocolatey:
choco install tomcat --version 11.0.11 -y
If the version is unavailable, download manually from: https://tomcat.apache.org/download-11.cgi.
2. Download Binary Distribution > Core > Windows Zip.
3. Extract to a chosen directory. For example: C:\apache-tomcat-11.0.11.
4. Set the Tomcat environment variable:
set CATALINA_HOME=C:\apache-tomcat-11.0.11
5. Verify installation:
cd %CATALINA_HOME%\bin version.bat.
6. Start the Tomcat server:
startup.bat
7. Access the web interface:
http://localhost:8080
8. Stop Tomcat:
shutdown.bat
Configuring HTTPS for Tomcat (Windows or macOS)
Perform the following steps to enable HTTPS on localhost.
Step 1: Generate Keystore
1. Run the following command: keytool -genkey -alias tomcat -keyalg RSA -keystore keystore.jks -keysize 2048
2. Follow the prompts to set password and certificate details.
Step 2: Update server.xml
1. Edit:
<TOMCAT_HOME>/conf/server.xml
2. Add the Connector entry:
<Connector port="8443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
SSLEnabled="true"
scheme="https"
secure="true"
defaultSSLHostConfigName="localhost">
<SSLHostConfig
<Certificate certificateKeystoreFile="conf/keystore.jks"
certificateKeystorePassword="your_keystore_password"
type="RSA" />
</SSLHostConfig
</Connector>
3. Replace the following:
certificateKeystorePassword with your keystore password.
certificateKeystoreFile path if the file is elsewhere.
Step 3: Deploying the Migration Tool
1. Place the MigrationTool.war file in: <TOMCAT_HOME/webapps/
Example: C:\apache-tomcat-11.0.11\webapps\
2. Restart the Tomcat service.
Step 4: Accessing the Application
Tomcat console: https://localhost:8443
If your browser shows a certificate warning:
Click Advanced.
Continue to the site.
Was this helpful?