<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ApacheTomcat &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/apachetomcat/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Tue, 17 Dec 2019 10:54:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>ApacheTomcat &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to install Apache Tomcat on Ubuntu 18.04</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-apache-tomcat-on-ubuntu-18-04/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-apache-tomcat-on-ubuntu-18-04/#respond</comments>
		
		<dc:creator><![CDATA[Alex]]></dc:creator>
		<pubDate>Mon, 09 Dec 2019 10:32:55 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=1012</guid>

					<description><![CDATA[This software (Apache Tomcat) was developed in an open environment. It was released under the Apache License version 2. The Apache Tomcat project is designed to work together the best developers from around the world. This guide will help you how to install this software on a server with the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>This software (<strong><em><a href="http://tomcat.apache.org/">Apache Tomcat</a></em></strong>) was developed in an open environment. It was released under the Apache License version 2. The Apache Tomcat project is designed to work together the best developers from around the world. <br>This guide will help you how to install this software on a server with the Ubuntu 18.04 operating system. </p>



<h2 id="system-update-and-java-installation" >System Update and Java Installation </h2>



<p>First you need to update your system, making sure that Ubuntu version 18.04 is installed</p>



<pre class="wp-block-code"><code>sudo apt-get update </code></pre>



<p>Install Java</p>



<pre class="wp-block-code"><code>sudo apt-get install default-jdk </code></pre>



<h3 id="update-java_home-variable" >Update <em>JAVA_HOME</em> variable</h3>



<p>First, you need to find the JAVA_HOME directory</p>



<pre class="wp-block-code"><code>update-alternatives --config java </code></pre>



<p>Copy the directory, and then enter the following:</p>



<pre class="wp-block-code"><code>nano /etc/environment </code></pre>



<p>This will give you the opportunity to open a file containing environment variables</p>



<p>Add JAVA_HOME</p>



<pre class="wp-block-code"><code>JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"</code></pre>



<p>Save and close the file, then reload the environment variables for them to take effect</p>



<pre class="wp-block-code"><code>source /etc/environment</code></pre>



<p>After checking the accuracy of your work and that everything is correct, you can use the following command:</p>



<pre class="wp-block-code"><code>echo $JAVA_HOME </code></pre>



<h2 id="create-a-user-to-run-the-tomcat-web-server" >Create a user to run the Tomcat web server</h2>



<p>This user (special for this tutorial) will accept the name <strong>&#8216;tomcat&#8217;</strong>, but you can use any name for this user</p>



<pre class="wp-block-code"><code>groupadd tomcat
useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat</code></pre>



<p>Be sure to find out which version of Tomcat you will install. This is in this link, you can familiarize yourself with it</p>



<p><a href="http://tomcat.apache.org/">http://tomcat.apache.org/</a></p>



<p>Remember to choose to download with the <strong><span style="text-decoration: underline;">.gz</span></strong> extension</p>



<p>Next, create a directory for Tomcat files</p>



<pre class="wp-block-code"><code>mkdir /opt/tomcat </code></pre>



<p>Download Tomcat</p>



<pre class="wp-block-code"><code>cd 
wget your-tomcat-link </code></pre>



<p>Unzip the files to the Tomcat folder</p>



<pre class="wp-block-code"><code>tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1</code></pre>



<p>Also, you can press the<strong> &#8220;Tab&#8221;</strong> key after entering <strong><em>apache</em></strong>, since you only have one download in your folder. Make sure the folders have the correct permissions</p>



<pre class="wp-block-code"><code>cd /opt/
sudo chown -R tomcat tomcat/</code></pre>



<p>JAVA_HOME Display the path again so you can copy it</p>



<pre class="wp-block-code"><code>nano /etc/systemd/system/tomcat.service </code></pre>



<h2 id="tomcat-setup" >Tomcat setup </h2>



<p>In order to configure Tomcat you need to Copy and paste the settings below into the <strong><em>tomcat.service</em></strong> file that you just created. Edit the <strong><em>JAVA_HOME </em></strong>path to the one you copied. After that, save and close the file</p>



<pre class="wp-block-code"><code>[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target</code></pre>



<p>Reboot the SystemD daemon so that the added service settings are enabled</p>



<pre class="wp-block-code"><code>sudo systemctl daemon-reload</code></pre>



<p>Now you can start Tomcat service</p>



<pre class="wp-block-code"><code>sudo systemctl start tomcat </code></pre>



<p>If you want to check the status of your Tomcat server, need to add this сommand:</p>



<pre class="wp-block-code"><code>sudo systemctl status tomcat </code></pre>



<p>You can also see your Tomcat service page by clicking on the link:</p>



<p><a href="http://your_ip_address:8080">http://your_ip_address:8080 </a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-apache-tomcat-on-ubuntu-18-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
