Difference between revisions of "Tomcat linux apt-get setup"

(Created page with "Category:Linux Category:Development This page describes how to setup Tomcat using your O.S repository's package. ♦ Note that the version in the repository is often...")
 
 
Line 19: Line 19:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install tomcat7 tomcat7-admin tomcat7-common tomcat7-docs tomcat7-examples
+
# Developer workstation
 +
apt-get install tomcat8 tomcat8-admin tomcat8-common tomcat8-docs tomcat8-examples
 +
# Server
 +
apt-get install tomcat8 tomcat8-admin
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
 
On '''Debian''', Tomcat is NOT registered as a service.  
 
On '''Debian''', Tomcat is NOT registered as a service.  
To overcome this, you can add a symlink for tomcat7:
+
To overcome this, you can add a symlink for tomcat8:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
ln -s /etc/init.d/tomcat7 /usr/bin/tomcat7
+
ln -s /etc/init.d/tomcat8 /usr/bin/tomcat8
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 38: Line 41:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd /etc/init.d
 
cd /etc/init.d
update-rc.d tomcat7 defaults
+
update-rc.d tomcat8 defaults
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 46: Line 49:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd /etc/init.d
 
cd /etc/init.d
update-rc.d tomcat7 remove
+
update-rc.d tomcat8 remove
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 15:17, 13 October 2016


This page describes how to setup Tomcat using your O.S repository's package.

♦ Note that the version in the repository is often an old one. For instance, Tomcat8 might not be available yet in the repository.


Requirement

You must already have a Java Runtime.


Installation

Depending on your distribution, you might have a more recent version than Tomcat7. Please check it using apt-cache search tomcat.

# Developer workstation
apt-get install tomcat8 tomcat8-admin tomcat8-common tomcat8-docs tomcat8-examples
# Server
apt-get install tomcat8 tomcat8-admin


On Debian, Tomcat is NOT registered as a service. To overcome this, you can add a symlink for tomcat8:

ln -s /etc/init.d/tomcat8 /usr/bin/tomcat8


Start/Stop Tomcat on boot

To add Tomcat on boot just do:

cd /etc/init.d
update-rc.d tomcat8 defaults


To remove Tomcat from boot just do:

cd /etc/init.d
update-rc.d tomcat8 remove