The Web Container provides administrators with the capability to restrict access to Web applications to a specific port or list of ports. Refer to this section if you need to restrict access to certain Web applications.
Use the com.ibm.pvc.webcontainer.vhost.configfile system property to specify a configuration file that assigns a port(s) to Web applications. For example, if Web application A is mapped to port 80, then it can only be accessed from port 80; accessing Web application A from any other port will result in a 404 error.
The configuration file contains a series of application-port mappings. An application can be mapped to a port or a list of ports. An example configuration file would look like this:
- foo is accessible only from localhost on port 80
- foo2 is accessible from any external machine but only on port 80
- foo3 is accessible from any external machine on any port
- foo4 is accessible only from localhost on ports 80, 8777 and 9999
- foo5 is accessible only from localhost on ports 80,8777 and 8999
- foo6 is accessible only from localhost on port 80
- foo7 is accessible from any external machine on any port IF the hostname of the machine the web application is hosted on is xyz.com
- foo8 is accessible from any external machine on port 8777 IF the hostname of the machine the web application is hosted on xyz.com
- foo9 is accessible from any external machine on ports 80 and 8777 IF the hostname of the machine the web application is hosted on is xyz.com
The following set of rules apply for the Virtual Host configuration file:
Channel Framework Configuration File
- To protect a servlet, non-J2EE Web application (like WebServices dispatcher servlet), you will need to specify the servlet name similar to what you would do for a J2EE Web application that has a context root (for example, to secure the Web services servlet ws specify /ws= [9000, 9050] if you want to restrict Web services access to ports 9000 and 9050).
– This file should be used to configure channels, channel chains and channel factories. Refer to Using the Channel Framework configuration file
for more information on the steps involved in configuring the channel framework using system properties and also an example configuration file.
Parent topic: Configuring the Web Container: XPD622