Skip to Content
Tomcat: The Definitive Guide, 2nd Edition
book

Tomcat: The Definitive Guide, 2nd Edition

by Jason Brittain, Ian F. Darwin
October 2007
Intermediate to advanced
496 pages
16h 50m
English
O'Reilly Media, Inc.
Content preview from Tomcat: The Definitive Guide, 2nd Edition

Apache Integration with Tomcat

Now that you have Apache set up and running on your system, you're ready to tackle Tomcat integration. Choose the option you like, and walk through that section, or try each option out and see which you like best.

Sharing the Load Using Separate Port Numbers

Each server that is waiting for incoming connections from clients is said to be listening on a particular TCP port number on the machine it is running. These port numbers are like telephone extension numbers within a building. Web servers normally listen on port 80, which is the officially assigned default port number for World Wide Web (WWW) services. Browsers know this so that when you navigate to a URL like http://tomcatbook.darwinsys.com/, the browser will connect to Ian's server on the default port 80. On the other hand, if you put a port number in the URL, such as http://foo.bar.xyz:1234/index.html, the browser will connect to the (hypothetical) server machine on port 1234.

Just as you can't contact two different people concurrently on the same telephone extension, you can't have two web servers listening on the same port number. So, if you want to run two server programs on the same machine, one of them has to "leave town," or move to a different port number—they both can't run on port 80. How you specify that is, of course, server implementation-dependent. In the Apache httpd server, you use a Listen directive in the httpd.conf file. In Tomcat, you specify the port attribute on the HTTP

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Learning Apache Tomcat

Learning Apache Tomcat

Martin Kalin
Apache Tomcat 7

Apache Tomcat 7

James Goodwill, Aleksa Vukotic
Java Servlet Programming, 2nd Edition

Java Servlet Programming, 2nd Edition

Jason Hunter, William Crawford

Publisher Resources

ISBN: 9780596101060Errata