Web Svr 6.1 SP4 App Svr 8.1 integration service-passthrough Working example
807567May 9 2005 — edited Dec 10 2007This is a verbatim example from a working installation.
Pathnames etc will differ from this example.
This is an example of the integration of SUN Java System Web Server 6.1 SP 4 and
SUN Java System Application Server 8.1 2005Q1.
The scope of this integration is successfully accessing a working application
hosted on the application server by making HTTP requests to the web server.
Download and install the "Reverse Proxy Plug-in"
The "Sun Java System Web Server 6.1 Add-Ons" download from sun.com
includes the libpassthrough.so shared object.
libpassthrough.so includes the required passthrough Server Application Function(s) (SAF).
The output of the strings command on libpassthrough.so followed by a
grep for passthrough will list the available Server Application Function(s).
strings libpassthrough.so | grep -i passthrough
magnus.conf file edits.
/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/https-menfi.houston.rr.com/config/magnus.conf
Add this line.
Init fn="load-modules" shlib="/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/plugins/passthrough/libpassthrough.so"
obj.conf edits.
NameTrans fn="assign-name" from="/pwc(|/*)" name="passthrough"
Position of the NameTrans directive is significant.
The NameTrans directives are sequentially searched until a match is found.
One and only one NameTrans directive is utilized for the
NameTrans stage of each HTTP request.
My configuration had this directive as the first NameTrans directive of the obj.conf file.
<Object name="passthrough">
Service fn="service-passthrough" servers="http://192.168.1.199:8080"
</Object>
Once a NameTrans match is found the corresponding Object
within the obj.conf file is utilized.
In this example the name attribute of the NameTrans directive corresponds
to the name attribute of the Object.
The Service directive invokes the service-passthrough Server Application Function (SAF)
of the libpassthrough.so.
The servers argument is passed to the service-passthrough function.
HTTP requests made directly to the application server where the application is hosted
are sussessful. Note the 8080 port in the URL.
http://localhost:8080/pwc/PWCUnprotected
HTTP requests made to the WebServer are successful as well.
The requests are "passed through" between the Web Server
and the Application Server.
http://localhost:80/pwc/PWCUnprotected
http://localhost/pwc/PWCUnprotected
LOG FILES
success note 200 HTTP status code
failure note XXX in URL and 404 HTTP status code
Web Server
/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/https-menfi.houston.rr.com/logs/access
127.0.0.1 - - [08/May/2005:23:53:51 -0500] "GET /pwc/PWCUnprotected HTTP/1.1" 200 185
127.0.0.1 - 09/May/2005:00:02:34 -0500 GET /pwc/PWCUnprotectedXXX HTTP/1.1 404 1003
Application Server
/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/https-menfi.houston.rr.com/logs/access/server_access_log
192.168.1.199 - 08/May/2005:23:53:51 -0500 GET /pwc/PWCUnprotected HTTP/1.1 200 185
127.0.0.1 - 09/May/2005:00:02:34 -0500 GET /pwc/PWCUnprotectedXXX HTTP/1.1 404 1003
The log files illustrate the NameTrans wild card behavior
NameTrans fn="assign-name" from="/pwc(|/*)" name="passthrough"
All requests of the pwc context are passed on to the application server from the
web server as expected.
A nominal start of the server from the Web Server Manager yields the following output.
magnus.conf, obj.conf edit/configuration errors may be seen here.
Status:
[https-menfi.houston.rr.com]: Sun ONE Web Server 6.1SP4 B12/16/2004 11:42
[https-menfi.houston.rr.com]: info: PASS1000: Sun ONE Web Server 6.1SP4 Reverse Proxy Plugin B10/14/2004 13:18
[https-menfi.houston.rr.com]: info: CORE5076: Using [Java HotSpot(TM) Server VM, Version 1.5.0_01] from [Sun Microsystems Inc.]
[https-menfi.houston.rr.com]: info: WEB0100: Loading web module in virtual server [https-menfi.houston.rr.com] at [simple]
[https-menfi.houston.rr.com]: info: WEB0100: Loading web module in virtual server [https-menfi.houston.rr.com] at [search]
[https-menfi.houston.rr.com]: info: HTTP3072: [LS ls1] http://menfi.houston.rr.com:80 ready to accept requests
[https-menfi.houston.rr.com]: startup: server started successfully
Success!
The server https-menfi.houston.rr.com has started up.
The Release Notes for Sun Java System Web Server 6.1 Add-Ons Reverse Proxy Plugin
http://docs.sun.com/source/819-0902-05/rpp61.html
are well complemented by -
Sun Java System Web Server 6.1 SP4 Administrator's Configuration File Reference
http://docs.sun.com/app/docs/doc/817-6248
Sun Java System Web Server 6.1 SP4 NSAPI Programmer's Guide
http://docs.sun.com/app/docs/doc/817-6252
Files from the working installation.
magnus.conf
********
#
# The NetsiteRoot, ServerName, and ServerID directives are DEPRECATED.
# They will not be supported in future releases of the Web Server.
NetsiteRoot /export/home/accesmanagerinstalldir/opt/SUNWwbsvr
ServerName menfi.houston.rr.com
ServerID https-menfi.houston.rr.com
#
RqThrottle 128
DNS off
Security off
PidLog /export/home/accesmanagerinstalldir/opt/SUNWwbsvr/https-menfi.houston.rr.com/logs/pid
User webservd
StackSize 131072
TempDir /tmp/https-menfi.houston.rr.com-25a6f9e8
Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
Init fn="load-modules" shlib="/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"
Init fn="load-modules" shlib="/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/plugins/passthrough/libpassthrough.so"
obj.conf
********
<Object name="default">
AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
NameTrans fn="assign-name" from="/pwc(|/*)" name="passthrough"
NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn=pfx2dir from=/mc-icons dir="/export/home/accesmanagerinstalldir/opt/SUNWwbsvr/ns-icons" name="es-internal"
NameTrans fn=document-root root="$docroot"
PathCheck fn=unix-uri-clean
PathCheck fn="check-acl" acl="default"
PathCheck fn=find-pathinfo
PathCheck fn=find-index index-names="index.html,home.html,index.jsp"
ObjectType fn=type-by-extension
ObjectType fn=force-type type=text/plain
Service method=(GET|HEAD) type=magnus-internal/imagemap fn=imagemap
Service method=(GET|HEAD) type=magnus-internal/directory fn=index-common
Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file
Service method=TRACE fn=service-trace
Error fn="error-j2ee"
AddLog fn=flex-log name="access"
</Object>
<Object name="passthrough">
Service fn="service-passthrough" servers="http://192.168.1.199:8080"
</Object>
<Object name="j2ee">
Service fn="service-j2ee" method="*"
</Object>
<Object name="cgi">
ObjectType fn=force-type type=magnus-internal/cgi
Service fn=send-cgi user="$user" group="$group" chroot="$chroot" dir="$dir" nice="$nice"
</Object>
<Object name="es-internal">
PathCheck fn="check-acl" acl="es-internal"
</Object>
<Object name="send-compressed">
PathCheck fn="find-compressed"
</Object>
<Object name="compress-on-demand">
Output fn="insert-filter" filter="http-compression"
</Object>