SteelBlue makes use of the ANSI C++ Standard Template Libraries (STL). Therefore, in order to compile SteelBlue, we suggest you use Visual C++ 6 (for Win32), GCC 2.8 or later, egcs 1.1.2 or later, or Sun WorkShop Compilers 5.0 or greater. For compilation you will also need the C libraries and include files for your relational database.
BasePages/ - Default introductory SteelBlue scripts
doc/ - Documentation, including the book "Programming
SteelBlue" in HTML
examples/ - Example applications
schema/ - Basic minimum schemas required by SteelBlue for
various databases.
src/ - The C++ source for SteeBlue and auto-
documentation perl scripts.
CheckUtils.js - The JavaScript file used for client-side type-
checking of forms
steelblue - The steelblue executable (UNIX binary
distribution)
steelblue.exe - The steelblue executable (Win32 binary
distribution)
steelblue.conf - A sample configuration file
INSTALL.TXT - A text version of this file
The following compiler flags are available:
LINUX - Various OS (1 must be defined)
SOLARIS
DUNIX
WIN32
USE_ODBC - Various databases (at least 1
USE_MYSQL must be defined)
USE_MSQL
USE_ORACLE
USE_ORACLE8
USE_PGSQL
USE_SYBASE
SWAPVALUE - Define if your database doesn't accept
a column named "val"
NO_CRYPT - Define if you do not have access to
crypt(3)
In the VC++ project file WIN32, USE_ODBC, and NO_CRYPT are defined by default. In the UNIX Makefile you will need to uncomment the flags appropriate to your configuration.
For Win32 build the steelblue.exe executable. It will compile and place the executable in the src\Release\ directory.
base-page-dir = STEELBLUE_DIR/BasePages/
welcome-screen = welcome.sb
sb-url = /cgi-bin/steelblue
login-object = PublicLogin
use-db = ODBC # one of ODBC MYSQL MSQL ORACLE PGSQL SYBASE
# depending on your DB
db-username = # Enter username if needed
db-password = # Enter password if needed
For "base-page-dir", replace STEELBLUE_DIR with the directory into which you installed the SteelBlue distribution. For "use-db", place the database you are using. For "db-username" and "db-password", place the username and password you are using for the database user (leave blank if none is needed).
Please see http://www.steelblue.com/ProgrammingSteelBlue/configuration.html for a reference on all of the configuration options.
check-util = /CheckUtils.js
To support automatic type checking in Netscape 3, add the following line:
check-util-file = WEB_DIR/htdocs/CheckUtils.jsWhere "WEB_DIR/htdocs/CheckUtils.js" is the full path the CheckUtils.js file in your local filesystem (for example "C:/progra~1/apache~1/apache/htdocs/CheckUtils.js").
The recommended method of directory structure is something like:
WEB_DIR/SteelBlue
\
+- bin
+- html
\
+- scripts
In the bin directory will reside the SteelBlue executable, steelblue, (or steelblue.exe for Win32) and the configuration file, "steelblue.conf". SteelBlue looks in two places for the configuration file: first in the current directory, and then in C:/ for Win32 and /etc/ for UNIX.
The html directory initially contains only one directory, scripts. The scripts directory contains only one file, "CheckUtils.js".
The final installation will look like:
WEB_DIR/SteelBlue
\
+- bin
| \
| +- steelblue
| +- steelblue.conf
|
+- html
\
+- scripts
\
+- CheckUtils.js
This unfortunately will not do anything at the moment. We have to set up the supporting software.
The rational behind this structure is that a typical web application has two parts, static and dynamic pages. Static pages are serverd out of the html directory and dynamic pages from the bin directory (more or less, SteelBlue will actually grab the dynamic page from anywhere its configurated to, but to the web server, its coming from bin).
This is a SteelBlue-centric installation which is appropriate for learning SteelBlue. A second method is more Application-centric. It mimics the above installation but the top-level directory is no longer SteelBlue but the name of the application.
Here is an example conf file:
# SteelBlue configuration file # URL of CheckUtils.js check-util = /SteelBlue/html/scripts/CheckUtils.js # Filesystem location check-util-file = WEB_DIR/SteelBlue/html/scripts/CheckUtils.js #set location of sendmail mail-prog = /usr/sbin/sendmail # set the time zone # Hours from GMT (-5 is EST, -8 PST) time-zone = -5 # DB settings db-username = steelblue db-password = susageP # This must also be specified at compile time use-db = MYSQL # Default settings (can be overridden by each application) # Database name DBName = SteelBlueExamples # Configure up database tables user-table = AuthUsers ticket-table = Ticket swap-table = Swap # # Each application can have its own section. # Sections are matched to the URL of the request sent to the web # server and whatever follows the BEGIN line. # So the URL http://localhost/SteelBlue/examples/steelblue # will match the next section. # BEGIN = examples # Location of the SteelBlue scripts base-page-dir = WEB_DIR/SteelBlue/BasePages/ # Page to display upon successful login welcome-screen = welcome # URL of application (loading this URL will load the login-screen). sb-url = /SteelBlue/bin/steelblue DBName = SteelBlueExamples END # # End steelblue.conf #
Ticket username varchar(20) ticket varchar(20) screen varchar(20) timeout varchar(20) ip varchar(20) institution varchar(7) AuthUsers username varchar(20) institution varchar(20) password varchar(20) Swap username varchar(20) institution varchar(20) namespace varchar(200) tag varchar(200) val varchar(200)
Schemas for various databases are provided in the schema directory. For mysql on Unix one would perform the following steps:
# create the database mysqladmin -u root create SteelBlueExamples # create the steelblue tables mysql -u root SteelBlueExamples < sb/schema/mySQL.schema.sql
Alias WEB_DIR/SteelBlue/html/ /SteelBlue/html/ ScriptAlias WEB_DIR/SteelBlue/bin/ /SteelBlue/bin/
To get the example BasePages from the standard distributions working you would add
ScriptAlias WEB_DIR/SteelBlue/bin/ /SteelBlue/examples/This will allow URLs like
http://localhost/SteelBlue/examples/steelblueto execute steelblue and read the appropriate examples section of the configuration file. Notice that with the above configuration the URLs:
http://localhost/SteelBlue/bin/steelblue http://localhost/SteelBlue/examples/steelblue
both execute the same copy of SteelBlue.
It is through the configuration of both SteelBlue and the web server that we create different web applications. To create a distinct SteelBlue application involves first configuring the web server to respond to a URL with a unique string (in the case above we chose "examples"). Then you will create a BEGIN = examples ... END block in steelblue.conf that tells steelblue where to find the SteelBlue scripts, the database, and other options for that application.
The web server must be restarted for these changes to take effect.
WEB_DIR/SteelBlue
\
+- bin
| \
| +- steelblue
| +- steelblue.conf
|
+- html
| \
| +- scripts
| \
| +- CheckUtils.js
|
+- BasePages
\
+- welcome
Depending upon the web configuration you've choosen the following should work:
http://localhost/SteelBlue/examples/steelblue