Methods of Configuring WebSiphon |
There are three different methods of configuring WebSiphon's runtime settings:
- Using the ACGI application
- WebSiphon's core environment preferences and add-on library preferences are configured using their respective commands available under the Edit menu. Some library settings such as those which manage secured and automated server authentications in CommerceLib, FileMakerLib, and VeronaLib must be configured using the WebSiphon ACGI application over other methods.
- Using the web-based admin
- Connect to /pi_admin.ws to manage WebSiphon's core environment preferences, as well as preferences for select add-on libraries (given special exceptions outlined above; see note in ACGI section).
- Manually, using a text editor
- Located in the "WebSiphon Data" folder, the "WebSiphon Prefs" file is a text file which may be edited manually using any standard text editor. It is important the file format integrity is maintained, and edits shouldn't be applied while the WebSiphon process is active. It is also not a good idea to edit this file unless you know what you are doing.
In the sections below details are presented on each of the different configuration options supported across all components the WebSiphon Environment.
WebSiphon ACGI Preferences |
Most of WebSiphon's preferences may be configured using the WebSiphon.acgi application. Some library settings such as those which manage secured and automated server authentications in CommerceLib, FileMakerLib, and VeronaLib must be configured using the WebSiphon ACGI application over other methods.
Core Environment Preferences
Choose the "Preferences..." item from the Edit menu to adjust WebSiphon's core environment settings. A dialog similar to the one shown below will be presented:
![]()
figure: WS2 ACGI preferences.The following runtime settings are configurable using the controls made available in this dialog:
- Action Files: Index File
- The value of this setting should be the name of the default index file which WebSiphon should use with requests that do not include a fully-qualified URL. This value is used if a URL request is received which points to a directory rather than an explicit file.
For example, a request for the resource /websiphon/ would return the results of /websiphon/default.html given the default value for this setting.
The default value for this setting is "default.html".
- Action Files: No Access File
- The value of this setting should be the path from the web server's root directory to the standard site No Access file. This file is served when a request is received which specifies a protected resource for which the user has not entered proper access credentials.
The default value for this setting is ":noaccess.html".
- Action Files: Error File
- The value for this setting should be the path from the web server's root directory to the standard site Error file. This file is served when a request is received for a file that does not exist at the location specified in the URL.
The default value for this setting is ":error.html".
- Log Settings: Log Templates
- If enabled, this option will log all requests to the primary console log window. If "Save Log to Disk" setting is enabled, will also be written to disk.
This setting is enabled by default.
- Log Settings: Log Compiles
- If enabled, this option will log all requests which require a compile to the primary console log window. If "Save Log to Disk" setting is enabled, will also be written to disk.
This setting is enabled by default.
- Log Settings: Save Log to Disk
- If enabled, all events logged to WebSiphon's primary console log window are saved to the "WebSiphon.log" file. The format of each line in the file is DATETIME\tLOG_EVENT_STRING\r. Log strings include startup messages, requested scripts, errors and other environment runtime events. The built-in function appendLog() also directs output to this file
This setting is enabled by default.
- Misc. Settings: Enable Statistics
- If enabled, this option will include runtime statistics as part of the main output of a called script. These statistics are helpful in evaluating the memory footprint consumed by a script, or light benchmarking and optimization analysis.
For example, with this option enabled a request for the resource /fancy/chart.ws$__TEMPLATE_STATS__ would execute the template located at "/fancy/chart.ws" and include statistics about the runtime within the returned results.
The returned statistics include the script instance memory consumption (in bytes), the compiled object size (in bytes), the size of the stack, the hit count since the object was compiled and cached, and the time (in ticks, 60ths of a second) it took to execute.
This setting is disabled by default.
- Misc. Settings: Serve Only from Templates
- If enabled, WebSiphon will only serve requests which resolve to a script located in the "Templates" folder, located within the "WebSiphon Data" folder. A helpful option for a shared environment!
This setting is disabled by default.
- Misc. Settings: Chevrons are Script
- If enabled, the SiphonScript parser will recognize special extended character set chevron characters as opening and closing script tokens. The chevron symbols are found using the key combinations option-backslash, "<<", and shift-option-backslash, ">>".
If you plan to use WebSiphon in a language environment such as the double-byte Kanji character set, the extended chevron character should not be used. Because of this, if you are authoring scripts which will be used on servers outside of your control, you should equally consider not using the chevron characters as tokens.
This setting is enabled by default.
- Misc. Settings: Disable Sending AppleEvents
- If enabled, this option will prevent WebSiphon from sending any Apple Events using the sendAppleEvent() built-in function.
This setting is disabled (Apple Events active) by default.
- Misc. Settings: Maximum HTTP Upload Size
- If enabled, ignores HTTP file upload data beyond the value provided (in Kbytes). As WebSiphon does not control communication between the web server and user agent while multipart file data is in transit, once this value is reached the connection will remain until the remote client is finished even though the upload is ultimately being ignored.
This setting is enabled, and set to 1024Kb by dy default.
- Active Sleep Time
- This value is the time (in ticks, 60ths of a second) that the WebSiphon application will yield to other processes on the server when a script is executing. The lower this value, the less time WebSiphon will share; conversely as this value increases, script execution speed will decrease.
The default value for this setting is 10 ticks.
- Expires Delay
- This value is the number of seconds browsers should wait before removing pages returned by WebSiphon from their internal caches.
The default value for this setting is 0 seconds (never cache).
Built-in Library Preferences |
Many of WebSiphon's built-in libraries have their own independent runtime settings, specific to the functions offered within. To configure an built-in library, choose the applicable library from the "Built-in Prefs" sub-menu found under the Edit menu in the WebSiphon.acgi application.Each section below provides screen shots and descriptions of each library's preference settings.
- CommerceLib
- One feature offered by this library is the ability to authorize a credit card using MacAuthorize. By configuring the settings in this preferences dialog, it will even work securely with a copy of MacAuthorize running on a remote machine on your network which is very helpful in reducing load on your web server itself.
![]()
figure: CommerceLib preferences.
- MacAuthorize Server
- This first setting is used to configure where the MacAuthorize Server you wish to use is located. Before configuring this setting, launch the MacAuthorize Server application either on your web server if you plan on running it locally, or on the remote server. Then, press the "Select..." button and find the MacAuthorize Server you wish to use. When finished, the server you chose will appear in the dialog.
- Auto Login
- Use these fields to set the username and password needed to connect to MacAuthorize running on a remote machine. In addition, program linking must be activated on the remote machine or an error will occur when trying to connect.
- FileLib
![]()
figure: FileLib preferences.
- Enable File Security
- When enabled, this option will prevent access to any file outside the current template's directory when using any of the built-in file functions. This option is helpful on servers with multiple users or virtual sites, where security is a concern among the different directories on the server.
This setting is disabled by default.
- FileMakerLib
- One feature offered by this library is the ability to work with databases served using FileMaker Pro. By configuring the settings in this preferences dialog, it will even work securely with a copy of FileMaker Pro running on a remote machine on your network which is very helpful in reducing load on your web server itself.
![]()
figure: FileMakerLib preferences.
- Server
- This first setting is used to configure where the FileMaker Pro application you wish to use is located. Before configuring this setting, launch the FileMaker Pro application either on your web server if you plan on running it locally, or on the remote server. Then, press the "Select..." button and find the FileMaker Pro application you wish to use. When finished, the server you chose will appear in the dialog.
- Auto Login
- Use these fields to set the username and password needed to connect to FileMaker Pro running on a remote machine. In addition, program linking must be activated on the remote machine or an error will occur when trying to connect.
- NetworkLib
- The settings available for the NetworkLib are specifically targeted at sending e-mail on a server with multiple users or virtual sites, where system security is a concern.
![]()
figure: NetworkLib preferences.
- Always Send Mail Using Host
- When enabled and provided with an SMTP mail server in the host field, this option will override the mail server passed to the sendEmail() function used in any script.
This detting is disabled by default.
- ProcessLib
- The settings available for the ProcessLib are specifically targeted at servers with multiple users or virtual sites, where system security is a concern.
![]()
figure: ProcessLib preferences.
- Disable Launching Applications
- When enabled, this option will prevent WebSiphon from launching any applications using the launchProcess() function.
This setting is disabled by default.
- Disable Quitting Applications
- When enabled, this option will prevent WebSiphon from quitting any applications using the quitProcess() function.
This setting is disabled by default.
- Disable Bringing Applications to the Front
- When enabled, this option will prevent WebSiphon from bringing an application to the front using the setFrontProcess() function.
This setting is disabled by default.
- VeronaLib
- Verona is the flat-file database server included with WebSiphon. Verona can be used either as a built-in server (running within WebSiphon) or as an external application. Using the built-in Verona engine is the fastest option since it removes any latency due to inter-application communication. Configure the settings in this preferences dialog to select how you would like to use Verona.
![]()
figure: VeronaLib preferences.
- Server
- The first setting is used to configure whether you wish to use the Verona engine built-in to the VeronaLib library, or the Verona application either on your server or a remote machine on the network. If you require the capabilities offered by the Verona application, such as updating databases via AppleScript or using remote databases, check the "Use Verona Application" box.
By default, WebSiphon will use the built-in Verona engine. The server field will say "Verona (local)" to indicate it is using the built-in Verona engine. Only change these settings if you need to use the external Verona application.
If using the appliction, the second setting is used to configure where the Verona server you wish to use is located. Before configuring this setting, launch the Verona application either on your web server if you plan on running it locally, or on the remote server. Then, press the "Select..." button and find the Verona application you wish to use. When finished, the server you chose will appear in the dialog.
- Auto Login
- Use these fields to set the username and password needed to connect to Verona running on a remote machine. In addition, program linking must be activated on the remote machine or an error will occur when trying to connect.
Web-based Administration |
To configure WebSiphon using a web browser, connect to /pi_admin.ws to access the web-based administration script.
As you can see, the web-based admin is much the same as the WebSiphon ACGI preferences shown above.
![]()
figure: Web-based administration.WebSiphon's core environment preferences as well as the preferences for select built-in libraries can be configured using the web-based administration script. The web-based admin is available with both the ACGI and plug-in versions of WebSiphon.
By default, WebSiphon places no security restrictions on accesses to the plug-in admin script. Define a security realm to protect the /pi_admin.ws script from casual use as described in Secure Data Files within the Installation section of the User Guide.
Some library settings such as those which manage secured and automated server authentications in CommerceLib, FileMakerLib, and VeronaLib must be configured using the WebSiphon ACGI application over other methods.
To configure these isolated settings when using the WebSiphon Plug-in, use the WebSiphon ACGI application: move the WebSiphon.acgi application to the same directory as your WebSiphon Plug-in and WebSiphon Data folder; then launch the WebSiphon.acgi application and configure as described in the text above. Remember to quit the WebSiphon.acgi application when you have completed configuration and prior to restarting the web server process.
If you are having trouble accessing the web-based admin script:
- Make certain the suffix mapping ".ws" is defined and will trigger the WebSiphon action
- Double-check that the "pi_admin.ws" script is properly located in the "Templates" folder
Note: the functions siphonSetPref() and siphonGetPref() which are used in the web-based admin script will only execute from within the confines of the Templates folder. Also note that the images for the web-based admin script are embedded inside the file's resource fork.