Next, run the commands below to create a server account for Tomcat Then create an account with password for the user and save by copying and pasting the lines below into the file, just before the Now that the package is extracted, run the commands to open Tomcat configuration file for its default user sudo nano /opt/tomcat /conf/tomcat-users.xml
Sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh' How to configure Tomcat service Next, give the tomcat user control of the entire directory and make all the scripts in the bin location executable. Sudo tar xzvf apache-tomcat-10*tar.gz -C /opt/tomcat -strip-components=1 To do that, run the commands below: sudo mkdir /opt/tomcat Then extract the downloaded folder into /opt/tomcat. Wget 10.0.12/bin/apache-tomcat- 10.0.12.tar.gzĪfter downloading, create a Tomcat home folder at /opt/tomcat. If you find a newer release at the link below, then download it instead. You can get the latest from the link below. How to download Tomcat fileĪt this stage, we’ve install OpenJDK, created Tomcat account and we’re ready to download and configure Tomcat.Īt the time of this writing the latest version of the 10 series was 10.0.12. To do that, run the commands below sudo useradd -s /bin/false -g tomcat -d /opt/ tomcat tomcat Next, create a new tomcat user called tomcat and make the user a member of the tomcat group above. Well also want to make /opt/tomcat the home folder for the tomcat user. Linux systems usually create groups based on the account name. To do that, create a new user and group that will run the Tomcat service.įirst, create a new tomcat group called tomcat. To properly run Tomcat, you’ll want to run Tomcat as it own user without root privileges. Java should be installed and ready to use How to create Tomcat user and group OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing) OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)