<?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>servlet Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/servlet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 28 Oct 2020 19:43:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to install Apache Tomcat on Ubuntu 20.04 / Debian 10?</title>
		<link>https://www.osradar.com/install-apache-tomcat-ubuntu-debian/</link>
					<comments>https://www.osradar.com/install-apache-tomcat-ubuntu-debian/#comments</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 29 Oct 2020 02:39:00 +0000</pubDate>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache Tomcat]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=12786</guid>

					<description><![CDATA[<p>Even though Python is the most popular programming language actually, there is still confidence in Java. So you probably needed to make applications with this veteran language. Especially in the web environment that there are so many good languages and tools, Java still resists. So, to deploy web applications made in Java is Tomcat. With [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-apache-tomcat-ubuntu-debian/">How to install Apache Tomcat on Ubuntu 20.04 / Debian 10?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Even though Python is the most popular programming language actually, there is still confidence in Java. So you probably needed to make applications with this veteran language. Especially in the web environment that there are so many good languages and tools, Java still resists. So, to deploy web applications made in Java is Tomcat. With the main objective that you learn how to install Apache Tomcat on Ubuntu 20.04 / Debian 10 is that this post has been written. Let us get started.</p>
<h2>Apache Tomcat</h2>
<p><a href="https://www.osradar.com/tag/java/" rel="noopener">Java</a> and its multipurpose language and that make it so good and useful to learn. Well, after coding your web application, it gets to the point where you have to deploy it. To do this, it requires a server that can interpret that Java code. Remember that we are talking about web applications. And to deploy and serve it, nothing like <a href="https://tomcat.apache.org/" rel="noopener">Apache Tomcat</a>.</p>
<p>Estricatemente speaking Tomcat is not a server but transforms the caught JPS into servlets that can serve the application in question.</p>
<p>On the other hand, Apache Tomcat is open source and can be installed on any system running Java.</p>
<h2>Install Apache Tomcat on Ubuntu 20.04 / Debian 10</h2>
<h3>1) Install and configure Java on Ubuntu 20.04 / Debian 10</h3>
<p>Apache Tomcat is an application made with Java. Therefore, the first step is to install Java on <a href="https://www.osradar.com/tag/buster/" rel="noopener">Debian 10</a>.</p>
<p>Open a terminal session and run the following:</p>
<pre>:~$ sudo apt install default-jre default-jdk</pre>
<p>Then, check the java version.</p>
<pre>:~$ java --version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-post-Debian-5)
OpenJDK 64-Bit Server VM (build 11.0.3+7-post-Debian-5, mixed mode, sharing)</pre>
<p>As you can see, Java version 11 has been installed. It is one of the most recent and with very good support.</p>
<p>Now, you have to modify the<code> /etc/environment</code> file and add the Java path.</p>
<pre>:~$ sudo nano /etc/environment</pre>
<p>And add the following:</p>
<pre class="">JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"</pre>
<p>Save the changes and close the file.</p>
<p>The next step is to edit the .bashrc file and add the following:</p>
<pre>:~$ sudo nano .bashrc</pre>
<pre class="">export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64/"
export PATH=$JAVA_HOME/bin:$PATH</pre>
<figure id="attachment_12801" aria-describedby="caption-attachment-12801" style="width: 560px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12801" src="https://www.osradar.com/wp-content/uploads/2019/07/1-5.jpeg" alt="1.- Editing the bash profile" width="560" height="272" srcset="https://www.osradar.com/wp-content/uploads/2019/07/1-5.jpeg 560w, https://www.osradar.com/wp-content/uploads/2019/07/1-5-300x146.jpeg 300w" sizes="(max-width: 560px) 100vw, 560px" /><figcaption id="caption-attachment-12801" class="wp-caption-text">1.- Editing the bash profile</figcaption></figure>
<p>Again, save the changes and close the file.</p>
<p>Next, refresh the bash.</p>
<pre>:~$ source .bashrc</pre>
<p>Now, type this command to test the Java path.</p>
<pre>:~$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64/bin/java</pre>
<p>So, if you got the Java path from your computer, everything is correct.</p>
<h3>2) Install Apache Tomcat on Ubunut 20.04 / Debian 10</h3>
<p>For security reasons, it is convenient to create a new user for Tomcat. Also, add it to a group called tomcat.</p>
<pre>:~$ sudo -i
:~# groupadd tomcat
:~# useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat</pre>
<figure id="attachment_12802" aria-describedby="caption-attachment-12802" style="width: 562px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12802" src="https://www.osradar.com/wp-content/uploads/2019/07/2-4.jpeg" alt="2.- Creating a new user for apache" width="562" height="198" srcset="https://www.osradar.com/wp-content/uploads/2019/07/2-4.jpeg 562w, https://www.osradar.com/wp-content/uploads/2019/07/2-4-300x106.jpeg 300w" sizes="(max-width: 562px) 100vw, 562px" /><figcaption id="caption-attachment-12802" class="wp-caption-text">2.- Creating a new user for apache</figcaption></figure>
<p>Now we can install Apache Tomcat. To do this, go to the<code> /opt</code>/ folder and download with <code>wget</code>.</p>
<pre>:~# cd /opt/
:~# wget -c https://downloads.apache.org/tomcat/tomcat-9/v9.0.39/bin/apache-tomcat-9.0.39.tar.gz<br />--2020-10-28 19:23:24-- https://downloads.apache.org/tomcat/tomcat-9/v9.0.39/bin/apache-tomcat-9.0.39.tar.gz<br />Resolving downloads.apache.org (downloads.apache.org)... 88.99.95.219, 2a01:4f8:10a:201a::2<br />Connecting to downloads.apache.org (downloads.apache.org)|88.99.95.219|:443... connected.<br />HTTP request sent, awaiting response... 200 OK<br />Length: 11282879 (11M) [application/x-gzip]<br />Saving to: ‘apache-tomcat-9.0.39.tar.gz’<br />apache-tomcat-9.0.39.tar.gz 100%[=====================================================================================&gt;] 10.76M 157KB/s in 1m 49s<br />2020-10-28 19:25:15 (101 KB/s) - ‘apache-tomcat-9.0.39.tar.gz’ saved [11282879/11282879]</pre>
<p>Then, decompress it and rename the folder.</p>
<pre>:~# tar -xzvf apache-tomcat-9.0.39.tar.gz
:~# mv apache-tomcat-9.0.39 tomcat</pre>
<p>After that, you need to change the owner of the folder and assign the required permissions so that it can run smoothly. Remember that now, we are using the root user.</p>
<pre class="">:~# chown -R tomcat:tomcat /opt/tomcat/
:~# chmod +x /opt/tomcat/bin/*</pre>
<p>Now, on the .bashrc file add the CATALINA_HOME path.</p>
<pre>:~# nano ~/.bashrc
export CATALINA_HOME=/opt/tomcat</pre>
<p>Save the changes and close the file.</p>
<p>Then, refresh bash.</p>
<pre>:~# source ~/.bashrc</pre>
<p>After that, we can run Apache Tomcat. To do it, just type this command:</p>
<pre>:~# /opt/tomcat/bin/startup.sh</pre>
<figure id="attachment_12804" aria-describedby="caption-attachment-12804" style="width: 641px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12804" src="https://www.osradar.com/wp-content/uploads/2019/07/4-1.jpeg" alt="4.- Tomcat is running" width="641" height="194" srcset="https://www.osradar.com/wp-content/uploads/2019/07/4-1.jpeg 641w, https://www.osradar.com/wp-content/uploads/2019/07/4-1-300x91.jpeg 300w" sizes="(max-width: 641px) 100vw, 641px" /><figcaption id="caption-attachment-12804" class="wp-caption-text">4.- Tomcat is running</figcaption></figure>
<p>Next, open your web browser ad go <code>http://your-server:8080</code>. And you will see this.</p>
<figure id="attachment_24865" aria-describedby="caption-attachment-24865" style="width: 1354px" class="wp-caption alignnone"><img loading="lazy" class="wp-image-24865 size-full" src="https://www.osradar.com/wp-content/uploads/2019/07/tomcat.png" alt="5.- Apache Tomcat on Ubuntu 20.04 / Debian 10" width="1354" height="669" srcset="https://www.osradar.com/wp-content/uploads/2019/07/tomcat.png 1354w, https://www.osradar.com/wp-content/uploads/2019/07/tomcat-300x148.png 300w, https://www.osradar.com/wp-content/uploads/2019/07/tomcat-1024x506.png 1024w, https://www.osradar.com/wp-content/uploads/2019/07/tomcat-768x379.png 768w, https://www.osradar.com/wp-content/uploads/2019/07/tomcat-696x344.png 696w, https://www.osradar.com/wp-content/uploads/2019/07/tomcat-1068x528.png 1068w" sizes="(max-width: 1354px) 100vw, 1354px" /><figcaption id="caption-attachment-24865" class="wp-caption-text">5.- Apache Tomcat on Ubuntu 20.04 / Debian 10</figcaption></figure>
<p>If you want to set a password to improve security of the manager web app. So, open the <code>tomcat-users.xml</code></p>
<pre>:~# nano /opt/tomcat/conf/tomcat-users.xml</pre>
<p>In the <code>tomcat-user</code> section, you have to add the username and password.</p>
<pre class="">&lt;role rolename="manager-gui"/&gt;
&lt;user username="XXXXXX" password="XXXXXXX" roles="manager-gui,admin-gui"/&gt;</pre>
<figure id="attachment_12807" aria-describedby="caption-attachment-12807" style="width: 761px" class="wp-caption alignnone"><img loading="lazy" class="size-full wp-image-12807" src="https://www.osradar.com/wp-content/uploads/2019/07/6-1.jpeg" alt="6.- Change the username and password" width="761" height="373" srcset="https://www.osradar.com/wp-content/uploads/2019/07/6-1.jpeg 761w, https://www.osradar.com/wp-content/uploads/2019/07/6-1-300x147.jpeg 300w, https://www.osradar.com/wp-content/uploads/2019/07/6-1-324x160.jpeg 324w, https://www.osradar.com/wp-content/uploads/2019/07/6-1-533x261.jpeg 533w, https://www.osradar.com/wp-content/uploads/2019/07/6-1-696x341.jpeg 696w" sizes="(max-width: 761px) 100vw, 761px" /><figcaption id="caption-attachment-12807" class="wp-caption-text">6.- Change the username and password</figcaption></figure>
<p>Of course, replace the password for yours.</p>
<p>Then, restart Tomcat.</p>
<pre class="">:~# ./shutdown.sh
:~# ./startup.sh</pre>
<p>And go to the web browser again. Next, refresh the page. And that is it.</p>
<h2>Conclusion</h2>
<p>Apache Tomcat is the best solution to deploy and serve web applications made with Java. So if you program in Java, you should learn how to manipulate Tomcat. As you have learned in this post, it is not very complex to learn how to install it in  Ubuntu 20.04 / Debian 10.</p>
<p>Please share this post with your friends and join <a href="http://t.me/osradar" target="_blank" rel="noopener noreferrer">our Telegram channel</a>.</p>


<p></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/install-apache-tomcat-ubuntu-debian/">How to install Apache Tomcat on Ubuntu 20.04 / Debian 10?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/install-apache-tomcat-ubuntu-debian/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
