Tomcat installation
From Oxxus Wiki
All packages come pre configured and ready to run after quick installation on our VPS servers regardless of your OS choice.
The following versions of Tomcat servers are being offered:
- Tomcat 4.1.37
- Tomcat 5.5.26
- Tomcat 6.0.16
- Tomcat 7.0.12
We are regularly upgrading and introducing new versions.
Contents |
Installing packages
Watch a video demo on Tomcat6 installation
To start, connect to your VPS via SSH. Ensure that you are logged in as root (server administrator) before issuing any of the following commands.
Depending on the package manager in your on the OS you picked for the VPS it will be either yum (Fedora/CentOS) or apt-get (Ubuntu/Debian), you will need to execute one of the following commands. Which command you use will depend on the version of Tomcat you want to install.
Your Tomcat will be installed in /var/tomcatX where X is the version number. Here you will find all the configuration files and webapps directory where you can deploy your application.
By default our Tomcat packages come pre configured and ready to use. After starting the service, you will be able to start deploying and executing your applications.
Fedora and CentOS
$ yum install eroute-tomcat4 $ yum install eroute-tomcat5 $ yum install eroute-tomcat6 $ yum install eroute-tomcat7
Here's an example of the output of executing the command on one of our test VPS servers:
[root@test ~]# yum install eroute-tomcat6 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: mirrors.igsobe.com * base: yum.singlehop.com * extras: mirror.atlanticmetro.net * rpmforge: fr2.rpmfind.net * updates: mirror.steadfast.net addons | 951 B 00:00 base | 1.1 kB 00:00 eroute | 951 B 00:00 extras | 2.1 kB 00:00 rpmforge | 1.1 kB 00:00 updates | 1.9 kB 00:00 updates/primary_db | 190 kB 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package eroute-tomcat6.i386 0:6.0.20-1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: eroute-tomcat6 i386 6.0.20-1 eroute 6.8 M Transaction Summary ================================================================================ Install 1 Package(s) Upgrade 0 Package(s) Total download size: 6.8 M Is this ok [y/N]:
To confirm the download and installation, enter 'y' and pressing Enter. This step can be skipped by specifying -y option in the first command.
$ yum -y install eroute-tomcat6
After confirming the download the installation continues:
Is this ok [y/N]: y Downloading Packages: eroute-tomcat6-6.0.20-1.i386.rpm | 6.8 MB 00:03 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : eroute-tomcat6 1/1 service tomcat6 does not support chkconfig type: service tomcat6 start - to lounch Tomcat 6 Installed: eroute-tomcat6.i386 0:6.0.20-1 Complete!
Tomcat 6 is now installed and ready to use. Our installer gives you instructions on how to proceed further and start Tomcat service.
In case of Tomcat 6, the installation directory is /var/tomcat6/, it contains all the necessary configuration files and webapps directory where you can deploy your applications.
[root@test ~]# cd /var/tomcat6/ [root@test tomcat6]# ls bin conf lib logs temp webapps work
Ubuntu and Debian
$ apt-get install eroute-tomcat4 $ apt-get install eroute-tomcat5 $ apt-get install eroute-tomcat6 $ apt-get install eroute-tomcat7
Starting and stopping Tomcat
Following commands are used to start/stop/restart Tomcat service on your VPS. Exact command will depend on the Tomcat version installed.
$ service tomcat4 stop $ service tomcat4 start $ service tomcat4 restart
Here is an example of starting Tomcat 6 which installed in previous step:
[root@test tomcat6]# service tomcat6 start Starting tomcat server... [root@test tomcat6]#
Tomcat 6 is now started and any errors or problems during start-up will be written to /var/tomcat6/logs/catalina.out.
Changing Tomcat version
At any point you can remove the existing Tomcat version and replace it with another or even reinstall the same version.
First stop and remove the existing Tomcat installation.
$ service tomcat4 stop $ yum remove eroute-tomcat4
In case you are using Debian or Ubuntu the last line should use apt-get.
Here is the output from the removal procedure:
[root@test ~]# yum remove eroute-tomcat6 Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package eroute-tomcat6.i386 0:6.0.20-1 set to be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Removing: eroute-tomcat6 i386 6.0.20-1 installed 9.7 M Transaction Summary ================================================================================ Remove 1 Package(s) Reinstall 0 Package(s) Downgrade 0 Package(s) Is this ok [y/N]:
As with installation, to confirm the removal, enter y and pressing Enter.
Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction service tomcat6 does not support chkconfig Stopping tomcat server... Erasing : eroute-tomcat6 1/1 Removed: eroute-tomcat6.i386 0:6.0.20-1 Complete!
After this you can proceed with installation as before.
Notes
In our default setup, Apache web server is needed as it acts as a proxy to Tomcat and routes all HTTP traffic that comes to the server. Make sure to start the Apache service as well.