Chapter 9 Web Server Redirector Plug-In


Installing the plug-in on the Apache Web server

This section describes how to install and configure the redirector plug-in on the Apache 1.3 Web server running on NT and Solaris. This process involves these steps:

  1. Edit the httpd.conf file.
  2. Edit the redirector configuration file.
  3. Copy libraries from EAServer to your Web server.
  4. Make an entry for the Web host in the /etc/hosts file (Solaris only).

Editing the httpd.conf configuration file

The httpd.conf file:

The following example describes the directives you must provide at the end of the APACHE_ROOT/conf/httpd.conf (Solaris) or APACHE_ROOT\conf\httpd.conf (NT) configuration file, where LoadModule defines and loads the libexec/libjeas_mod.so (Solaris) or modules/libjeas_mod.dll (NT) redirector module:

Table 9-5: httpd.conf file
Platform Example httpd.conf
NT
LoadModule easredirector_module modules/libjeas_mod.dll
EASConfigFile APACHE_ROOT\conn_config
<LocationMatch /examples/*|/estore/* >
SetHandler eas-handler
</LocationMatch>
Solaris
LoadModule easredirector_module libexec/libjeas_mod.so
EASConfigFile APACHE_ROOT/conf/conn_config
<LocationMatch /examples/*|/estore/* >
SetHandler eas-handler
</LocationMatch>

EASConfigFile identifies the file that contains the redirector configuration parameters. The redirector configuration file can be any name and location you choose, but must be identified by EASConfigFile. In this example, APACHE_ROOT/conf/conn_config (Solaris) or APACHE_ROOT\conn_config (NT) is the name of the redirector configuration file. You must supply the absolute path to this file. See "Editing the redirector configuration file" for a description of configuration parameters.

WARNING!

The Apache Web server must use the dynamic shared object (DSO) to load redirector modules and files. See your Apache Web server documentation for more information about building the Apache Web server with DSO support.

This is an Apache Web server directive:

<LocationMatch contextpath1 | contextpath2 | contextpath3>
SetHandler eas-handler /
</LocationMatch>

When an HTTP request arrives and the starting path matches contextpath1, contextpath2, or contextpath3, eas-handler is invoked. The contextpath corresponds to the Web Application context path. If the path is set to "/*", all requests are sent to the redirector. See "Defining context paths" for more information.

Defining context paths

Context paths inform the Web server which requests are directed to the redirector. At the end of the httpd.conf file, add the lines that define the context paths. For example, if you have two Web applications named "ws_test" and "examples", the lines that direct requests of the form http://host-name/examples/* and http://host-name/ws_test/* to the redirector are:

<LocationMatch /examples/* | /ws_test/* >
SetHandler eas-handler
</LocationMatch>

Figure 9-4 illustrates how a client request for examples/test.jsp and examples/images/welcome.gif to the Web server and port Web1:8020 is redirected to jag1:8080.

Figure 9-4: "examples" requests are redirected to EAServer

Editing the redirector configuration file

You create and configure a redirector configuration file, which is used to set the redirector directives to:

Mapping Web server requests to EAServer listeners

You must configure the redirector configuration file by adding the Connector.WebApp directive which maps your requests to the EAServer listener to which they are redirected. The syntax is:

# Syntax of the WebApp directive
Connector.WebApp contextpath1 [, contextpath2, and so on] = \
http://host:port [, http://host:port, and so on]          

For example, if "neptune" is the name of your Web server, and APACHE_ROOT/conf/conn_config (Solaris) or APACHE_ROOT\conn_config (NT) is the name and location of the redirector configuration file that you create, you would edit conn_config to set the Connector.WebApp directive:

Connector.WebApp /testapp = http://jaghost1:8080
Connector.WebApp /estore1, /estore2, /estore3 = http://neptune:8080
Connector.WebApp /* = http://foobar:8080, http://neptune:8080
Connector.WebApp examples=http://jaghost1:8080, http://jaghost1:3080, http://jaghost2:8080

Note   You must make entries in the redirector configuration file on a single line, but you can combine EAServer hosts in one entry or multiple entries. For example:

Connector.WebApp /*=http://rainforest:8080,http://neptune:8080 
is the same as:
Connector.WebApp /*=http://rainforest:8080 
Connector.WebApp /*=http://neptune:8080 
In addition, the server hosts specified for the WebApp directive (in this case "rainforest" and "neptune") must match the host names you define for your EAServer HTTP listeners. Use Jaguar Manager to view and set host names for your EAServer HTTP listeners. See the EAServer System Administration Guide for more information.

Logging

Edit the redirector configuration file to add the Connector.LogLevel directive, which determines the amount of redirector logging that is sent to the Web server log file. For a description of the logging level options, see Table 9-3.

You must also set the logging level for the Apache Web server in the httpd.conf file to either "info" or "error" for the redirector to produce any logging. The syntax is:

LogLevel [ debug | info | notice | warn | error | crit ] 
For example, to set the redirector logging level to "inform", you must add this line to the redirector configuration file:
Connetor.LogLevel inform 
You must also add this line to the http.conf file:
LogLevel info

Copying libraries from EAServer to your Web server

Using APACHE_ROOT as the location of the Apache Web server software, copy the following libraries from your JAGUAR_HOME/lib (Solaris) or JAGUAR_HOME\dll (NT) directory to the APACHE_ROOT/libexec (Solaris) or APACHE_ROOT\modules (NT) directory:

Table 9-6: Library/binary locations
Platform Files copied from JAGUAR_HOME/lib
NT
  • libjeasproxy_mod.dll
  • libjcc.dll
  • libjctssecct.dll
  • libjintl.dll
  • libjsybscl.dll
  • libjeas_mod.dll
Solaris
  • libjeasproxy_mod.so
  • libjcc.so
  • libjctssecct.so
  • libjintl_r.so
  • libjsybscl_r.so
  • libjeas_mod.so

Making an entry for the Web host in the /etc/hosts file (Solaris only)

The Web server may fail to start if you do not have a fully qualified path name to your Web server host in the /etc/hosts file. Verify that an entry for your host exists. For example:

12.34.56.78 my_host.my_domain.com 

Starting the Apache Web server

Solaris

Set the LD_LIBRARY_PATH environment variable in the shell used to start the Apache Web Server to include APACHE_ROOT/libexec.

Start the Apache Web server from the command line:

bin/httpd

NT

If you are starting the Web server as an NT service, add APACHE_ROOT\modules to the PATH variable from the Control Panel.

If you are starting the Web server from the command line, you can add APACHE_ROOT\modules to the PATH environment variable from the command line before starting the Web server.

 


Copyright © 2002 Sybase, Inc. All rights reserved.