

Group=tomcat Environment="JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64"Įnvironment="JAVA_OPTS=file:///dev/urandom"Įnvironment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"Įnvironment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" ExecStart=/opt/tomcat/bin/startup.shĮxecStop=/opt/tomcat/bin/shutdown.sh So, to configure systemd unit file, create the beneath file with following contents, $ sudo vi /etc/systemd/system/rvice It is recommended to have systemd unit file for tomcat so that during reboots tomcat service comes up automatically. Step 6) Configure Systemd Unit File for Tomcatīy default, tomcat comes with shell scripts which allows the geeks to start and stop tomcat services. $ sudo vi /opt/tomcat/webapps/host-manager/META-INF/context.xml

Example is shown below, $ sudo vi /opt/tomcat/webapps/manager/META-INF/context.xml Note : Don’t forget to set secret password in the above file.īy default, Admin GUI and Manager GUI are accessible from localhost, in case you want to access tomcat applications from outside then edit the context.xml file for manager & host-manager and comment out the remote access section. To configure Tomcat users, edit the file ‘ /opt/tomcat/conf/tomcat-users.xml’ and add following lines just before section. $ sudo chmod u+x /opt/tomcat/bin -R Step 4) Configure Tomcat User via tomcat-users.xml file Once the tar file is extracted, set the correct permissions on files and directories by running following commands, $ sudo chown tomcat:tomcat /opt/tomcat/ -R Tomcat 10 packages are not available in Debian 10 package repositories, so we will download its compressed tar file from its official portal via below wget command, $ wget Įxtract the downloaded compress tar file using beneath tar command $ sudo tar xpvf apache-tomcat-10.0.4.tar.gz -C /opt/tomcat -strip-components=1 Run the following useradd command, $ sudo useradd -m -U -d /opt/tomcat -s /bin/false tomcat Step 3) Download and Install Tomcat 10 So, create following tomcat user with home directory as ‘ /opt/tomcat’ and shell as ‘ /bin/false’ It is recommended to have tomcat user for tomcat services. Once Java is installed, verify its version by executing below: $ java -version
