Page 1 of 1

Installing Tomcat

Posted: Fri Sep 12, 2014 6:47 am
by RDK
Folks....Had to leave my Pi for a couple weeks for other projects. When I left it I had Samba working after some W/R privilege issues on the shares which I fixed using the Samba's SWAT web interface. However after installing SWAT, I discovered I also had to install a webserver. I thus installed Apache2. SWAT then worked.

Now, I'm thinking about actually using my Pi as a local webserver and I also want to use some dynamic pages. Thus, I now want to install Tomcat. My question is do I have to uninstall Apache2 before I can install Tomcat? Does Tomcat come with it's own version of Apache? What is the correct way to proceed?

Thanks...RDK

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 6:59 am
by DougieLawson
Tomcat will work with your existing copy of Apache2

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 7:05 am
by RDK
OK, so I just install Tomcat directly over my current Apache2 install? No conflicts?? Thanks...RDK

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 7:11 am
by DougieLawson
RDK wrote:OK, so I just install Tomcat directly over my current Apache2 install? No conflicts?? Thanks...RDK
Yes.

Then add a redirect so that requests for tomcat URLs are routed to tomcat.

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 8:20 am
by zacburke
Yes, you wont have any conflicts with Tomcat and Apache.

Tomcat _normally_ will listen on port 8080 for any requests, and as mentioned in the previous post you can use Apache to pass off any requests on the normal port 80 to this port for your dynamic pages.

This can be done using mod_proxy or , you can use mod_jk a module specifically designed to pass requests off to tomcat.

Note, you don't have to use Apache if you don't want to. You can just reference your dynamic page like this:
http://hostname:8080/stuff/myDynamicPage.jsp, in fact this might just be easier to do while you are writing and developing your dynamic pages, and then worry about the apache mod config at the end of the project.

Good luck.
-Zac.

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 12:04 pm
by RDK
Thanks guys, your information will keep me occupied for a while.

On a related but different note, I'm getting a second Raspberry Pi B+. Can I install Tomcat on it without installing Apache2? I guess my basic question is, does Tomcat also install its own webserver?

Thanks...RDK

Re: Installing Tomcat

Posted: Fri Sep 12, 2014 12:53 pm
by zacburke
Hi,

yes, you can install Tomcat without Apache web server.

You can even have it that your Tomcat instance itself runs on port 80.

Tomcat is primarily designed for dynamic pages (jsp's etc) but can also serve out static content as well.

--Zac.