Apache Tomcat is a free, open-source, lightweight application server used for Java-based web applications. Developers use it to implement Java Servlet and JavaServer Pages technologies (including Java Expression Language and Java WebSocket).
Read this guide to learn how to install and configure Apache Tomcat on Ubuntu 18.04.
Note: These steps apply to other Ubuntu-based distributions, including Ubuntu 16.04, Linux Mint, and Elementary OS.
Welcome to the Apache Tomcat ® 9.x software download page. This page provides download links for obtaining the latest version of Tomcat 9.0.x software, as well as links to the archives of older releases. Sudo mv / Downloads / apache-tomcat-9.0.1 / usr / local In the future, if ever you wish to upgrade to a newer version, a symbolic link will come in handy.
Before you can download and install Tomcat, make sure you have the required Java installation for Ubuntu (OpenJDK).
Open the terminal (Ctrl+Alt+T) and use the following command check the Java version:
The output will show the Java version running on your system. Currently, the latest release is OpenJDK 11.0.3:
If you do not have OpenJDK or have a version older than Java 8, install the newest release by typing the following:
For security reasons, do not run Tomcat under the root user. Create a new group and system user to run the Apache Tomcat service from the
/opt/tomcat directory.
1. Download the latest binary Tomcat release navigate to the official Apache Tomcat Download page.
2. On it, find the Binary Distributions > Core list and the tar.gz link in it. Copy the link of the file.
3. Go back to the terminal and change to the
/tmp directory with the command:
4. Now, use the
curl command with the tar.gz link you copied in step 2 to download the package:
1. To extract the tar.gz Tomcat file, create a new
/opt/tomcat/ directory with the command:
2. Then, extract the file in the new directory with the following command:
The new Tomcat user you created does not have executable privileges, but it needs to access the installation directory. You need to setup execute privileges over the directory.
1. Move to the directory where the Tomcat installation is located:
2. Grant group ownership over the installation directory to the
tomcat group with the command:
3. Also, give it read access to the
conf directory and its contents by typing:
4. Followed by changing directory permissions to grant execute access with:
5. Finally, give the tomcat user ownership of the
webapps , work , temp , and logs directories using the command:
Since you are going to to use Tomcat as a service, you need to create a systemd service file.
1. To configure the file, you first need to find the “
JAVA_HOME ” path. This is the exact location of the Java installation package.
To do so, prompt the system to give you information about the Java packages installed on the system. In the terminal, type:
As the output shows, there are two available versions of Java. Accordingly, it also shows two paths displaying their location.
Choose the version you want to use and copy its location. With that, you can move on to create the service file.
2. Create and open a new file in the /etc/system/system under the name tomcat.service:
3. Once the file opens, copy and paste the content below, changing the JAVA_HOME value to the information you found in the previous step.
4. Save and Exit the file (Ctrl+X, followed by y[es] and Enter).
5. For the changes to take place, reload the system daemon with the command:
6. Now, you can finally start the Tomcat service:
Visual studio 2016 download mac. 7. Verify the Apache Tomcat service is running with the command:
The message you want to receive is that the service is active (running).
Autodesk free student download mac. If you are using a firewall to protect your server (as you should), you will not be able to access the Tomcat interface. Tomcat uses Port 8080, which is outside your local network.
1. Open Port 8080 to allow traffic through it with the command:
Download Apache Tomcat 9 Mac Download
2. If the port is open, you should be able to see the Apache Tomcat splash page. Type the following in the browser window:
http://server_ip:8080
or
http://localhost:8080
Your web browser should open the web page as in the image below:
Once you verified the service is running properly, you need to create a user who can use the web management interface.
To do this, open and edit the users file.
1. Open the users file with the command:
The file should appear like the one in the image below:
2. Scroll down and find the section specifying Tomcat users. Modify it by adding the following:
Make sure to replace the
Your_Password value with a strong password of your preference.3. Save and Exit the file.
Finally, you need to configure remote access. This is required. By default, Tomcat is only accessible from the local machine.
1. First, open the manager file:
2. Next, decide whether to grant access from a) anywhere or b) from a specific IP address.
1) To make it publicly accessible, add the following lines to the file: Open office mac download english.
2) To allow access from a specific IP address, add the IP to the previous command, as follows:
3. Repeat the same process for the host-manager file.
Start by opening the file with the command:
4. Followed by granting access from a) anywhere or b) from a specific IP address (as in the previous step).
With the help of this guide, you have installed and setup Tomcat on Ubuntu 18.04! You now have a working Tomcat installation on your Apache server and can start deploying your Java web applications.
Next you should also read
Yarn is a tool for managing, updating, and sharing your Java code. It works through node.js, and it helps to…
Java is one of the most popular programming languages used for developing anything from lightweight mobile to…
Apache Tomcat is an open source Java implementation package developed by the Apache Software Foundation. In…
Apache Tomcat 8.5 Download
VirtualBox is a powerful tool for running a virtual operating system on your computer. In this tutorial learn…
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |