![]() ![]() To run Tomcat as a service we will create a new rvice unit file in the /etc/systemd/system/ directory with the following contents: Make the scripts inside bin directory executable by running the following chmod command: : sudo sh -c 'chmod x /opt/tomcat/latest/bin/*.sh' Create a systemd unit file # The tomcat user that we previously set up needs to have access to the tomcat directory, so we will change the directory ownership to user and group tomcat: sudo chown -R tomcat: /opt/tomcat Later if you want to upgrade your Tomcat installation you can simply unpack the newer version and change the symlink to point to the latest version. ![]() In order to have more control over versions and updates, we will create a symbolic link latest which will point to the Tomcat installation directory: sudo ln -s /opt/tomcat/apache-tomcat-8.5.37 /opt/tomcat/latest Once the download is completed, unzip the file and move it to the /opt/tomcat directory: unzip apache-tomcat-*.zip sudo mkdir -p /opt/tomcat sudo mv apache-tomcat-8.5.37 /opt/tomcat/ Before continuing with the next step you should check the download page for a new version.Ĭhange to the /tmp directory and download the zip file with the following wget command: cd /tmp wget At the time of writing, the latest version is 8.5.37. If you don’t have unzip and wget installed on your system install the packages with: sudo apt install unzip wgetĭownload the latest version of Tomcat 8.5.x from the Tomcat downloads page. We will use wget and unzip to download and extract the Tomcat archive. We will create a new system user and group with home directory /opt/tomcat which will run the Tomcat service: sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat Download Tomcat # The installation of the OpenJDK package is pretty straight forward: sudo apt install default-jdk Create Tomcat user # ![]() OpenJDK, the open source implementation of the Java Platform is the default Java development and runtime in Ubuntu 18.04. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |