Chapter 15: Shared Tomcat Hosting newsletter, whose FQDNs
Chapter 15: Shared Tomcat Hosting newsletter, whose FQDNs would be p2p.wrox.comand newsletter.wrox.com. However, because the distinction between an FQDN and a domain name is not relevant in this discussion, the terms are used interchangeably. Typically there are two ways in which virtual hosting is implemented: IP-based virtual hosting and name- based virtual hosting. . IP-based virtual hosting: In this mechanism, each Web site domain needs to have a different IP address. The Web server listens to each of these network interfaces, and serves resources from the relevant domain based on the IP address. . Name-based virtual hosting: The Web site domains can share an IP address, and the Web server determines which domain the request is for based on the HTTP request headers. Each of these mechanisms has advantages and disadvantages. IP-based virtual hosting requires either multihoming hosts machines with multiple network interface cards (NICs) or setting up virtual network interfaces. This often runs into limits, and besides IP addresses are a scare resource. Name-based virtual hosting overcomes these issues, but has its own set of limitations. For instance, SSL requires unique IP addresses, so secure Web sites cannot use name-based virtual hosting. Also, some really, really old browsers don t support sending the extra HTTP request header information required to support name-based virtual hosting. Virtual Hosting in Apache This section covers how IP- and name-based virtual hosting is configured in the Apache HTTP server. A common configuration for Web deployments is to have Apache serve up requests for static resources (HTML pages, images, multimedia), and have Tomcat handle requests for JSPs and servlets. In such environments, it is important to understand how Apache is configured for virtual hosting. It should be noted that the choice of IP or name-based virtual hosting is not an either-or choice: Apache is quite capable of supporting both of these in the same configuration. Example Deployment Scenario Before you continue configuring Apache for virtual hosting, look at the example deployment scenario that will be used in the rest of the chapter. This section covers configuring Apache to serve two fictitious virtual hosts: europa.domand callisto .dom on the same Apache instance. To ensure that these domains are really fictitious, we have even chosen a fictitious TLD (top level domain) name dom. In this example, we add our own DNS entries for the virtual hosts, so using a fictitious TLD is not a problem. Naturally, these virtual hosts will be running on the same IP address for name-based virtual hosting, and on different IP addresses for IP-based virtual hosting. Each of the domains would have its own document root in / home/websites/
For high quality website hosting services please check cheap web hosting website.