User avatar
RDK
Posts: 254
Joined: Wed Aug 13, 2014 10:19 am
Location: Wyoming and France

Installing Tomcat

Fri Sep 12, 2014 6:47 am

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

User avatar
DougieLawson
Posts: 35824
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Installing Tomcat

Fri Sep 12, 2014 6:59 am

Tomcat will work with your existing copy of Apache2
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
RDK
Posts: 254
Joined: Wed Aug 13, 2014 10:19 am
Location: Wyoming and France

Re: Installing Tomcat

Fri Sep 12, 2014 7:05 am

OK, so I just install Tomcat directly over my current Apache2 install? No conflicts?? Thanks...RDK

User avatar
DougieLawson
Posts: 35824
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Installing Tomcat

Fri Sep 12, 2014 7:11 am

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.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

zacburke
Posts: 8
Joined: Tue Sep 09, 2014 9:13 am
Location: Dublin, Ireland
Contact: Website

Re: Installing Tomcat

Fri Sep 12, 2014 8:20 am

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.

User avatar
RDK
Posts: 254
Joined: Wed Aug 13, 2014 10:19 am
Location: Wyoming and France

Re: Installing Tomcat

Fri Sep 12, 2014 12:04 pm

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

zacburke
Posts: 8
Joined: Tue Sep 09, 2014 9:13 am
Location: Dublin, Ireland
Contact: Website

Re: Installing Tomcat

Fri Sep 12, 2014 12:53 pm

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.

Return to “Beginners”