Você está na página 1de 5

1/20/2014

Installing Java 7.x and Tomcat 7.x on Debian Squeeze | Wolf Paulus
About Journal Software Systems Talks Videos Contact

>

Installing Java 7.x and Tomcat 7.x on Debian Squeeze


by Wolf Paulus | Mar 15, 2013 | Software | 3 comments

About Me
My name is Wolf Paulus, a photographer, hiker, hacker, technologist based in Ramona, California. I'm currently working on Android projects, occasionally speak at developer conferences, and work on open source projects (Swixml, HessDroid, ). You can contact me by email at wolf@wolfpaulus.com Read More

Upcoming

Mobile Voice Conference 2014 at the Hyatt Fisherman's Wharf, San Francisco, CA On March 3-5, 2014, I will be speaking at the Mobile Voice Conference 2014 on "Emotional Prosody"

Journal Archive
Android (19) Embedded (24) Hardware (19) Tomcat 7 is the first Apache Tomcat release to support the Servlet 3.0, JSP 2.2, and EL 2.2 specifications. Please note that Tomcat 7 requires Java 1.6 or better so we start with installing a recent version of Oracles JRE. Java (10) Life (20) Mac OS X (13) Software (22)

Install Oracle JRE 7 on Debian Linux


To install Oracles Java Runtime with apt-get , we first need to entend the list of apt-gets sources. Once that is done, an java-installer will actually install the Java SE Runtime Environment. Here are the steps to follow:

Embedded

I n s t a l l i n gJ a v a7 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 $s ur o o t #e c h o" d e bh t t p : / / p p a . l a u n c h p a d . n e t / w e b u p d 8 t e a m / j a v a / u b u n t up r e c i s em a i n ">/ e t c / a p t / s o u r c e s . l i s t . d / w e b u p d 8 t e a m j a v a . l i s t #e c h o" d e b s r ch t t p : / / p p a . l a u n c h p a d . n e t / w e b u p d 8 t e a m / j a v a / u b u n t up r e c i s em a i n "> >/ e t c / a p t / s o u r c e s . l i s t . d / w e b u p d 8 t e a m j a v a . l i s t #a p t k e ya d vk e y s e r v e rk e y s e r v e r . u b u n t u . c o mr e c v k e y sE E A 1 4 8 8 6 #a p t g e tu p d a t e Arduino on Quark SoC X1000 #a p t g e ti n s t a l lo r a c l e j a v a 7 i n s t a l l e r #j a v av e r s i o n / Intel Galileo Galileo is a j a v av e r s i o n" 1 . 7 . 0 _ 1 7 " microcontroller board based J a v a ( T M )S ER u n t i m eE n v i r o n m e n t( b u i l d1 . 7 . 0 _ 1 7 b 0 2 ) on the Intel Quark SoC J a v aH o t S p o t ( T M )6 4 B i tS e r v e rV M( b u i l d2 3 . 7 b 0 1 ,m i x e dm o d e ) #e x i t X1000 Application Processor, $

http://wolfpaulus.com/jounal/software/tomcat_squeeze/

1/5

1/20/2014

Installing Java 7.x and Tomcat 7.x on Debian Squeeze | Wolf Paulus
a 32-bit Intel Pentium-class system on a chip (datasheet?). Its the first board based on Intel architecture designed to be hardware and software pincompatible

With Java now installed we move on, installing Tomcat. However, it may be beneficial to have an dedicated user for Tomcat, in case you BTW, Java got installed into this location: /usr/lib/jvm/java-7-oracle

C r e a t i n gan e wu s e r ,s a n sp a s s w o r d ,n od i r e c tl o g i n s 1 2 3 4 5 6 7 8 s u d oa d d u s e r\ s y s t e m\ s h e l l/ b i n / b a s h\ g e c o s' T o m c a tJ a v aS e r v l e ta n dJ S Pe n g i n e '\ g r o u p\ d i s a b l e d p a s s w o r d\ h o m e/ h o m e / t o m c a t\ t o m c a t

Installing Tomcat7
D o w n l o a d i n ga n du n a r c h i v i n gt h ea r c h i v e 1 2 3 $c d/ t m p $w g e th t t p : / / m i r r o r . c o g e n t c o . c o m / p u b / a p a c h e / t o m c a t / t o m c a t 7 / v 7 . 0 . 3 7 / b i n / a p a c h e t o m c a t 7 . 0 . 3 7 . $t a rx v z f. / a p a c h e t o m c a t 7 . 0 . 3 7 . t a r . g z

M o v i n gt h ed i s t r i b u t i o ni n t o/ u s r / s h a r e / t o m c a t 7 1 2 $s u d om k d i r/ u s r / s h a r e / t o m c a t 7 $s u d om v/ t m p / a p a c h e t o m c a t 7 . 0 . 3 7/ u s r / s h a r e / t o m c a t 7

To make it easy to replace this release with future releases, we are going to create a symbolic link that we are going to use when referring to Tomcat (after removing the old link, you might have from installing a previous version):

L i n k i n gt o m c a tt ot o m c a t 7 . x . x 1 2 $s u d or mf/ u s r / s h a r e / t o m c a t $s u d ol ns/ u s r / s h a r e / t o m c a t 7 / a p a c h e t o m c a t 7 . 0 . 3 7/ u s r / s h a r e / t o m c a t

Since we created a tomcat user, he should also own all these files in

C h a n g i n go w n e r s h i pa n dm a k es c r i p t se x e c u t a b l e 1 2 $s u d oc h o w nRt o m c a t : t o m c a t/ u s r / s h a r e / t o m c a t 7 $s u d oc h m o d+ x/ u s r / s h a r e / t o m c a t / b i n / * . s h

If Tomcats default HTTP port (8080) is already in use, you need to edit the server.xml configuration file, e.g. edit /usr/share/tomcat/conf/server.xml and replace 8080 with 8000

Starting Tomcat
T o m c a tS t a r t u p 1 2 3 4 5 6 7 $s u d o/ b i n / s u-t o m c a tc/ u s r / s h a r e / t o m c a t / b i n / s t a r t u p . s h U s i n gC A T A L I N A _ B A S E : / u s r / s h a r e / t o m c a t U s i n gC A T A L I N A _ H O M E : / u s r / s h a r e / t o m c a t U s i n gC A T A L I N A _ T M P D I R :/ u s r / s h a r e / t o m c a t / t e m p U s i n gJ R E _ H O M E : / u s r U s i n gC L A S S P A T H : / u s r / s h a r e / t o m c a t / b i n / b o o t s t r a p . j a r : / u s r / s h a r e / t o m c a t / b i n / t o m c a t j u l i . j a r

http://wolfpaulus.com/jounal/software/tomcat_squeeze/

2/5

1/20/2014

Installing Java 7.x and Tomcat 7.x on Debian Squeeze | Wolf Paulus

Stopping Tomcat
T o m c a tS h u t d o w n 1 2 3 4 5 6 7 $ s u d o/ b i n / s u-t o m c a tc/ u s r / s h a r e / t o m c a t / b i n / s h u t d o w n . s h U s i n gC A T A L I N A _ B A S E : / u s r / s h a r e / t o m c a t U s i n gC A T A L I N A _ H O M E : / u s r / s h a r e / t o m c a t U s i n gC A T A L I N A _ T M P D I R :/ u s r / s h a r e / t o m c a t / t e m p U s i n gJ R E _ H O M E : / u s r U s i n gC L A S S P A T H : / u s r / s h a r e / t o m c a t / b i n / b o o t s t r a p . j a r : / u s r / s h a r e / t o m c a t / b i n / t o m c a t j u l i . j a r

Tomcat with Webmin


If you were to manage your debian server with WebMin, the configuration of the start/stop behavior would look like this

which created a script just like this one:

W e b m i nT o m c a tS t a r t u p / S h u t d o w n 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 # ! / b i n / s h # # #B E G I NI N I TI N F O #P r o v i d e s :T o m c a t #R e q u i r e d S t a r t :$ n e t w o r k #R e q u i r e d S t o p :$ n e t w o r k #D e f a u l t S t a r t :235 #D e s c r i p t i o n :J a v aS e r v l e ta n dJ S PE n g i n e # # #E N DI N I TI N F O c a s e" $ 1 "i n ' s t a r t ' ) / b i n / s u-t o m c a tc/ u s r / s h a r e / t o m c a t / b i n / s t a r t u p . s h ; ; ' s t o p ' ) / b i n / s u-t o m c a tc/ u s r / s h a r e / t o m c a t / b i n / s h u t d o w n . s h

http://wolfpaulus.com/jounal/software/tomcat_squeeze/

3/5

1/20/2014
1 6 1 7 1 8 1 9 2 0 2 1 . * ) ; ; e c h o" U s a g e :$ 0{s t a r t|s t o p} " ; ; e s a c e x i t0

Installing Java 7.x and Tomcat 7.x on Debian Squeeze | Wolf Paulus

3 Comments
peter on March 27, 2013 at 10:51 am
Great Manual worked like a charm Thanks! Can you add how to register tomcat as a service so that after a reboot tomcat automatically starts? thanks

Andrei M. on May 6, 2013 at 3:10 am


Do you know how i can fix my problem with eclipse ide. As your manuals on the internet a lot. But not a normal install guide ligament eclipse ide with tomtcat. Now i have message Could not publish server configuration for Tomcat v7.0 Server at localhost. Multiple Contexts have a path of /test. What do you thing about it?

Dieter K. on November 21, 2013 at 3:42 pm


Thank you for this fantastic tutorial! With your simple to follow instructions I was finally able to install Tomcat on a Raspberry Pi (using the latest Raspbian distribution, dated 2013-09-25). All attempts using the packages contained in the distribution (Tomcat6 and Tomcat7) failed, I think because the shell scripts assume the presence of an Open JDK installation, but at least the latest Raspbian distribution comes with a preinstalled Java version from Oracle which now supports the ARM architecture with hardware floating point support. As a Linux beginner Im not able yet to adapt the scripts myself and so your instructions saved me many hours of work. One hit: at this time the mirror site hosted a newer version of Tomcat (7.0.47) and so the arguments for wget had to be changed to point to the new subfolder and file version. A call with a web browser to showed me the way to the actual path and filename. Thanks again.

Submit a Comment
Your email address will not be published. Required fields are marked *

Name *

Email *

Website

http://wolfpaulus.com/jounal/software/tomcat_squeeze/

4/5

1/20/2014

Installing Java 7.x and Tomcat 7.x on Debian Squeeze | Wolf Paulus

Comment

You may use these HTML tags and attributes: < ah r e f = " "t i t l e = " " >< a b b rt i t l e = " " >< a c r o n y mt i t l e = " " >< b > < b l o c k q u o t ec i t e = " " >< c i t e >< c o d e >< d e ld a t e t i m e = " " >< e m >< i >< qc i t e = " " >< s t r i k e >< s t r o n g > Submit Comment

Copyright 2004-2013 Wolf Paulus All rights reserved.

i p q

http://wolfpaulus.com/jounal/software/tomcat_squeeze/

5/5

Você também pode gostar