The above configuration implies that add the admin-gui and manager-gui roles to a user named “ admin” with a password of “ tecmint123”. $ sudo nano /opt/tomcat/conf/tomcat-users.xmlĪdd the following configuration within the tags, with the correct username and password as shown. In order to access the manager-gui and admin-gui web apps that comes with Tomcat, we must enable login to our Tomcat server by editing the tomcat-users.xml file as shown. Verify Tomcat Status Step 4: Enable Login for Tomcat Manager and Host Manager $ sudo systemctl daemon-reloadįinally, you can start and verify the status of the Tomcat service by running the following commands. Next, reload the systemd to apply the new changes, so that it knows about our rvice file. etc/systemd/system/rvice ĭescription=Apache Tomcat Web Application ContainerĮnvironment=JAVA_HOME= /usr/lib/jvm/java-1.11.0-openjdk-amd64Įnvironment=CATALINA_PID=/opt/tomcat/temp/tomcat.pidĮnvironment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'Įnvironment='JAVA_OPTS=true =file:/dev/./urandom' Paste the following contents into your rvice file. Once we know our JAVA_HOME, we can create the systemd service file called rvice in the /etc/systemd/system directory by running. $ sudo update-java-alternatives -lįrom the above output, our JAVA_HOME is: /usr/lib/jvm/java-1.11.0-openjdk-amd64 To create a service file, you should know where Java is installed, as this referred to as JAVA_HOME using the following command. We will create a new systemd service file to manage and run Tomcat as a service under systemd. Set Permissions to Tomcat User Step 3: Create a Tomcat systemd Service File $ sudo chown -R tomcat webapps/ work/ temp/ logs/ Next, assign the permissions to tomcat user to have access to the Tomcat installation /opt/tomcat directory. $ sudo tar xzvf apache-tomcat-9*tar.gz -C /opt/tomcat -strip-components=1 Once we set up tomcat user, now download the latest version of Tomcat 9 (i.e 9.0.30) from the Tomcat 9 Downloads page or use the following curl command-line tool to download the tarball and extract the archive to /opt/tomcat directory. $ sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat We will create a new tomcat group and user to run the Tomcat service under /opt/tomcat directory (Tomcat installation). $ java -versionĬheck Java Version in Debian 10 Step 2: Install Tomcat in Debian 10įor security purposes, Tomcat should be installed and executed by unprivileged user (i.e. Once the Java installation is complete, check the version of Java installed on the system using the following command. Then install the Java Development Kit package using the apt command. First, update the system software package index using the apt command as shown.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |