Chapter 9 Web Server Redirector Plug-In
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:
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:
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.
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
You create and configure a redirector configuration file, which is used to set the redirector directives to:
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
http://jaghost1:8080
.
http://web_server:8020/testapp/test.jsp
,
the redirector forwards the request to http://jaghost1:8080/testapp/test.jsp
.
http://neptune:8080
.
http://web_server:8020/estore1/sign_in.jsp
,
the redirector forwards the request to http:/neptune:8080/estore1/sign_in.jsp
.
<LocationMatch /* >
SetHandler eas-handler
</LocationMatch>
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:8080is the same as:
Connector.WebApp /*=http://rainforest:8080
Connector.WebApp /*=http://neptune:8080In 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.
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 informYou must also add this line to the http.conf file:
LogLevel info
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:
Platform | Files copied from JAGUAR_HOME/lib |
---|---|
NT |
|
Solaris |
|
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
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
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. |
![]() |