NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator's Guide

Configuring NSJSP
NonStop Servlets for JavaServer Pages (NSJSP) 6.0 System Administrator’s Guide544548-004
3-22
Configuring Virtual Hosting
Configuring Virtual Hosting
The Virtual Hosting feature enables you to access web services on multiple IP
addresses or hostnames through a single iTP WebServer or NSJSP environment.
Each virtual host can have its own servlet context or a set of servlet contexts. Servlet
contexts cannot be shared across virtual hosts.
In the server.xml file, the <Host> element represents a virtual host. One or more
<Host> elements are nested inside an <Engine> element. Exactly one of the Hosts
associated with each <Engine> must have a name matching the defaultHost
attribute of that <Engine>. Any context associated with a virtual host can be defined in
the directory NSJSP_HOME/conf/NSJSP/<host-name>/.
The <Host> element attributes are described in detail in the Apache Tomcat
documentation at http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html.
Example 3-8 provides an example of the elements you need to set in the server.xml
file to configure Virtual Hosting.
Configuring Realms
NSJSP 6.0 allows the use of Realms, a database of user names and passwords that
identify valid users of a web application (or a set of web applications) with a list of the
roles associated with each valid user. Roles are similar to ‘groups’ in the Unix-like
operating systems because access to specific web application resources is granted to
all users possessing a particular role (rather than the list of associated user names). A
particular user can have any number of roles associated with that particular user name.
The following storage types can be used to access the Realm database:
Example 3-8. Configuring Virtual Hosting
<Host name="www.hp.com" appBase="webapps"
unpackWARs="true">
<Alias>hp.com</Alias>
...
</Host>
...
<Host name="nonstop.hp.com" appBase="nsk_webapps"
unpackWARs="true">
<Alias>nonstop.compaq.com</Alias>
<Alias>www.tandem.com</Alias>
...
</Host>