To upgrade an existing project may require no code changes at all - just load it into Sapphire/Web 3.0, change a few options, perform a few manual steps, and that's it.
If your projects contain C or C++ code that you have written you should read the section of this file titled "Changing existing CGI code to work with Application Servers"
SaPlugin.so
. This shared object can be found in the /bin
directory of your Sapphire/Web installation. config
directory where you installed your Netscape server.
Init fn="load-modules" shlib="/usr/Sapphire/bin/SaPlugin.so" funcs="sapphire- form,sapphire-init"
Init fn="sapphire-init" file="/usr/Sapphire/config/apserver.txt"
shlib
and file
depend on your operating system and platform. shlib
must be the full path to the SaPlugin.so
file that was delivered with Sapphire/Web in the /bin
directory ($SAPPHIRE/bin
).
file
must be the full path to the Sapphire Application Server configuration file described below.
obj.conf
add these lines somewhere between the <Object name="default">
and </Object>
tags:
Service fn="sapphire-form" method="(GET|POST)" type="magnus-internal/sapphire"
mime.types
add this:
type=magnus-internal/sapphire exts=sphAfter changing these options you must stop and start your Netscape server so it can start processing Sapphire Application server requests. When you go to the Netscape administration pages be sure to apply the changes you have just made by hand. If you do not apply these changes when you run Netscape Administration you will lose your manual edits.
default.sph
. It is recommended that you put this in the document root of your web server but you can place it anywhere that your web server can get at it. This file contains nothing, it is just there so the HTTP server will process your requests and not give you a "file not found" error. The .sph
extension tells the web server to process this as a Sapphire/Web application server request.http://<server>/default.sph
<server>
with the name of the machine that is running the Netscape HTTP server. Your browser should display something like the following:
default.sph
in the correct place.
/test
" to it.
http://<server>/default.sph/test
default.sph
file
There is a file named SaCGI.cgi
in the bin directory of your Sapphire distribution. This is a CGI program that allows any web server talk to an Application Server. You must copy this file to a directory on your web server that can execute CGI programs. Once this file is copied to a CGI directory you must make sure that the project option Test.Generic Extension URL
points to this value. A typical value for this option is
http://server/cgi-bin/SaCGI.cgiYou can verify that it works by using your HTML browser and pointing it to:
http://server/cgi-bin/SaCGI.cgiYou should see a message like the following in your browser:
No Path InfoIf you do not see the above message make sure
SaCGI.cgi
has been copied to a directory that has execute access and you are typing in a valid URL in your browser.
The GWSE looks for the configuration file in one of two places. The first place it looks is $SAPPHIRE/config/apserver.txt
. Since some HTTP servers do not pass all environment variables to CGI programs $SAPPHIRE may not be defined.
To get around this problem the GWSE will look in the working directory of the CGI for this file. Since the CGI specification does not state what the working directory is supposed to be for a CGI program, different HTTP server vendors set this directory differently. Some vendors use document root and other vendors use the directory in which the CGI is located.
GWSE will tell you what directory is the working directory when you successfully run it as a CGI and neither apserver.txt
is in the working directory nor $SAPPHIRE/config/apserver.txt
can be found.