java-rmi.cgi.sh revision 2362
5fc50ecb8dc8ef74adfc1c1f0d4e144d7f4d8faestoddard#!/bin/sh
4ed92248676a091e0d73db61773d9059b36d0861stoddard
4ed92248676a091e0d73db61773d9059b36d0861stoddard#
4ed92248676a091e0d73db61773d9059b36d0861stoddard# Copyright (c) 1996, Oracle and/or its affiliates. All rights reserved.
4ed92248676a091e0d73db61773d9059b36d0861stoddard# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4ed92248676a091e0d73db61773d9059b36d0861stoddard#
4ed92248676a091e0d73db61773d9059b36d0861stoddard# This code is free software; you can redistribute it and/or modify it
4ed92248676a091e0d73db61773d9059b36d0861stoddard# under the terms of the GNU General Public License version 2 only, as
4ed92248676a091e0d73db61773d9059b36d0861stoddard# published by the Free Software Foundation. Oracle designates this
4ed92248676a091e0d73db61773d9059b36d0861stoddard# particular file as subject to the "Classpath" exception as provided
4ed92248676a091e0d73db61773d9059b36d0861stoddard# by Oracle in the LICENSE file that accompanied this code.
525973b478c06cd0e8c457ade5c378dcae7485d2wrowe#
4ed92248676a091e0d73db61773d9059b36d0861stoddard# This code is distributed in the hope that it will be useful, but WITHOUT
4ed92248676a091e0d73db61773d9059b36d0861stoddard# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
525973b478c06cd0e8c457ade5c378dcae7485d2wrowe# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4ed92248676a091e0d73db61773d9059b36d0861stoddard# version 2 for more details (a copy is included in the LICENSE file that
4ed92248676a091e0d73db61773d9059b36d0861stoddard# accompanied this code).
bcd36d1522403b4387451f8a17a528e632915e8dwrowe#
bcd36d1522403b4387451f8a17a528e632915e8dwrowe# You should have received a copy of the GNU General Public License version
bcd36d1522403b4387451f8a17a528e632915e8dwrowe# 2 along with this work; if not, write to the Free Software Foundation,
4ed92248676a091e0d73db61773d9059b36d0861stoddard# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
6173077ec421fe85891d4b914c87175beb0a9293wrowe# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6173077ec421fe85891d4b914c87175beb0a9293wrowe# or visit www.oracle.com if you need additional information or have any
6173077ec421fe85891d4b914c87175beb0a9293wrowe# questions.
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
6173077ec421fe85891d4b914c87175beb0a9293wrowe
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
6173077ec421fe85891d4b914c87175beb0a9293wrowe
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
6173077ec421fe85891d4b914c87175beb0a9293wrowe# This script executes the Java interpreter, defines properties
6173077ec421fe85891d4b914c87175beb0a9293wrowe# that correspond to the CGI 1.0 environment variables, and executes
6173077ec421fe85891d4b914c87175beb0a9293wrowe# the class "sun.rmi.transport.proxy.CGIHandler". It should be
6173077ec421fe85891d4b914c87175beb0a9293wrowe# installed in the directory to which the HTTP server maps the
6173077ec421fe85891d4b914c87175beb0a9293wrowe# URL path "/cgi-bin".
6173077ec421fe85891d4b914c87175beb0a9293wrowe#
4ed92248676a091e0d73db61773d9059b36d0861stoddard# (Configuration is necessary as noted below.)
9f5c11710b7b2f3b0d1b58e42d8324199a532007wrowe#
9f5c11710b7b2f3b0d1b58e42d8324199a532007wrowe# This class will support a QUERY_STRING of the form "forward=<port>"
4ed92248676a091e0d73db61773d9059b36d0861stoddard# with a REQUEST_METHOD "POST". The body of the request will be
4ed92248676a091e0d73db61773d9059b36d0861stoddard# forwarded (as another POST request) to the server listening on the
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# specified port (must be >= 1024). The response from this forwarded
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# request will be the response to the original request.
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe#
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# CONFIGURATION:
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe#
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# Fill in correct absolute path to Java interpreter below. For example,
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# the "PATH=" line might be changed to the follow if the JDK is installed
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# at the path "/home/peter/java":
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe#
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe# PATH=/home/peter/java/bin:$PATH
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe#
4ed92248676a091e0d73db61773d9059b36d0861stoddardPATH=/usr/local/java/bin:$PATH
4ed92248676a091e0d73db61773d9059b36d0861stoddardexec java \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DAUTH_TYPE="$AUTH_TYPE" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DCONTENT_LENGTH="$CONTENT_LENGTH" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DCONTENT_TYPE="$CONTENT_TYPE" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DGATEWAY_INTERFACE="$GATEWAY_INTERFACE" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DHTTP_ACCEPT="$HTTP_ACCEPT" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DPATH_INFO="$PATH_INFO" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DPATH_TRANSLATED="$PATH_TRANSLATED" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DQUERY_STRING="$QUERY_STRING" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DREMOTE_ADDR="$REMOTE_ADDR" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DREMOTE_HOST="$REMOTE_HOST" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DREMOTE_IDENT="$REMOTE_IDENT" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DREMOTE_USER="$REMOTE_USER" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DREQUEST_METHOD="$REQUEST_METHOD" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DSCRIPT_NAME="$SCRIPT_NAME" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DSERVER_NAME="$SERVER_NAME" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DSERVER_PORT="$SERVER_PORT" \
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe -DSERVER_PROTOCOL="$SERVER_PROTOCOL" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard -DSERVER_SOFTWARE="$SERVER_SOFTWARE" \
4ed92248676a091e0d73db61773d9059b36d0861stoddard sun.rmi.transport.proxy.CGIHandler
50feafa397d01128b8cf94ad1602d3d78e1a4169wrowe