Using Tango ServerChanging Tango Server DefaultsAs discussed in Chapter 1, the program that queries the database and returns information to Web browsers is Tango Server, which is the main component of Tango. It is responsible for executing application files, communicating with databases directly or through ODBC, and compiling the HTML to be returned to the Web server. For information on how to install Tango Server, see the Getting Started Guide that comes with Tango. Also included in the Tango package is a CGI program, a small program that uses the Common Gateway Interface (t3.cgi under UNIX, t3cgi.exe under Windows) and routes requests between Tango Server and the interface to the database that you have configured. This CGI routing of information can also be done with a Web server plug-in for Netscape Server or Microsoft Internet Information Server. This chapter also describes the defaults for the plug-in or CGI program. Some settings for Tango Server are kept in a configuration file (t3server.ini under Windows). This chapter describes how to change the settings in this file using the config.taf application file and discusses the defaults that are set when Tango is installed.
![]() Timed URL Processing With Tango ServerThe timed URL execution (cron) component of Tango Server lets you execute specified URLs at stipulated time intervals. Only HTTP-type URLs are supported. The URLs may point to the local Web and Tango server or a remote one. (The result HTML of an executed URL is discarded.) Both the specification file and the execution mechanism are modeled after the UNIX cron(1) daemon. The specifications are stored in a separate file (conventionally called crontab), which is read when Tango Server starts up. You must restart Tango Server if the file is modified. The timed query module of Tango Server becomes active once per minute, and executes, one by one, all the URLs that satisfy the specification conditions between the previous and present activation. |
|
For more information, see "crontabFile" in the Meta Tags and Configuration Variables manual. |
The full path to the crontab file must be specified in the system configuration variable crontabFile. The following section discusses the format of the crontab file. ![]() Format of the crontab FileA crontab file consists of lines of six fields each. The fields are separated by spaces or tabs. The first five fields are numeric patterns and specify the following (in this order):
Each of these patterns may be either an asterisk (meaning all legal values) or a list of elements separated by commas. An element is either a number or two numbers separated by a dash (meaning an inclusive range). The specification of days may be made by two fields (day of the month and day of the week), or both. The sixth field of a line in a crontab file is a URL executed by Tango Server at the specified time(s). It must be in HTTP-type URL form, which is: http://host:port/path?search-arguments Host may be specified as fully qualified hostname or Internet address, and may not be omitted. Port may be omitted, in which case the default HTTP port (80) is assumed. Path and search arguments may be omitted in which case a request for the main page is sent. Lines starting with hash sign (#) are treated as comments. The following is an example of a crontab file. #
![]() Startup and Shutdown URL ProcessingStartup and shutdown URLs get executed by Tango Server on initialization and shutdown. This mechanism is provided for the purpose of initialization and finalization of the Tango Server environment. These URLs can point to application files, which can, for example, set up some installation-specific system variables on startup and gather and mail statistical data on shutdown. These URLs can point to CGI scripts that start or stop database engines, or to change run levels on some of the intranet computers. They can also be remote requests to obtain some vital information from other Internet sites. The Results HTML of startup and shutdown URLs are discarded. SpecificationsStartup and shutdown URLs are specified in system configuration variables (startupURL, shutdownURL, and startstopTimeout ). Tango Server must be restarted for new values to take effect. |
For more information, see "shutdownUrl", "startupUrl", and "startStopTimeout" in theMeta Tags and Configuration Variables manual. |
startupUrl specifies the URL which is executed on Tango Server startup. shutdownUrl specifies the URL which is executed when Tango Server receives a shutdown request. startstopTimeout specifies, in seconds, the time which Tango Server is allowed to wait for startup or shutdown URL to complete. By default, the waiting period is 60 seconds. |
For a description of the URL format, see here. |
Startup and shutdown URLs must be compliant with HTTP type URL specifications, which is, in simplified form: http://host:port/path?search-arguments ExamplesApplication file, executed by Tango itself http://www.myhost.ca/cgi-bin/MyTango.cgi/sys.taf?action=start
Intranet URL to start the database http://dbhost.myorg.ca/cgi-bin/startdb.sh http://www.remote-tango-server.com/sys.taf?
![]() Execution MechanismA shutdown signal is sent to Tango Server by typing tangod -k on the UNIX command line, pressing Stop in service manager under Windows NT, or typing Ctrl-C when Tango Server is running as a non-detached application on UNIX, Windows NT or Windows 95. The life cycle of Tango Server consists of the following stages:
Guaranteed Execution and Guaranteed ShutdownThere could be circumstances when a malformed application file could prevent Tango Server from shutting down in a timely fashion. When Tango Server is running under UNIX as a detached process (daemon) or on a terminal, or as a console application on Windows NT or Windows 95, a second shutdown signal causes the application to immediately abort, not depending on its state. When run as NT service, the internal mechanisms are employed to guarantee a timely shutdown because a second shutdown signal cannot be delivered. If a shutdown signal arrives before Tango Server has finished initialization, (that is, before it has moved to Running state), the request is honored only after the initialization stage is complete, and, after that, processed according to the described mechanism. Thus, startup and shutdown URLs are always guaranteed to be fully executed without overlaps. It is also guaranteed that no user request is accepted before the initialization is completed, or after the first shutdown signal is received by Tango Server. LimitationsThe startup and shutdown timeout works properly only after the request has been successfully sent. There is still a possibility of a large delay during DNS lookup or TCP/IP handshake. ![]() Configuring Tango ServerThe Tango Server preferences file,t3server.ini under UNIX and Windows (Tango 3 Server Preferences under Mac OS), contains configuration settings for many Tango Server options. t3server.ini is located in within the Tango3 folder in the Windows or Winnt folder on the hard drive that contains the system software. Configuration options are set by default. You generally do not need to edit the preferences file directly. You configure Tango Server by setting system configuration variables using the config.taf application file that comes with Tango. This file is located in the \Tango3\Config\ directory in your Web server root folder. To use it, execute the file in your browser, for example, http://www.yourserver.com/Tango3/Config/config.taf When you execute the config.taf application file, you are asked for a password. The default password after installation is
the first five characters of your box number. You can change the
password by editing the value of the configuration variable, CONFIGPASSWD,
in the configuration file. This change takes place when you restart
Tango Server.
|
For detailed information on configuring Tango Server, see Chapter 7 in the User's Guide, and the Meta Tags and Configuration Variables manual. You can also get configuration information by clicking the Tango Server button on the on-line HTML help button bar. |
When the config.taf file loads into your Web browser, click a category on the left to see the options that can be set for that category. The listed options correspond to Tango system configuration variables.
To save any changes that you have made, click Save. To reset the values to what they were previously, click Reset. You can click on Server Status to get a list of current statistics about the running copy of Tango Server. The following describes the screens in the config.taf file which affect system configuration variables. Some configuration variables are found on more than one screen, because they fit into more than one category of system configuration variable. ArraysThe options in this screen set the way that array variables are formatted when returned in HTML. aPrefix (default value <TABLE>)
|
These options set the prefixes and suffixes for when Tango returns values for arrays with the <@VAR> meta tag (when arrays are converted to text; for example, in Results HTML). |
|
For more information, see "Arrays". See also MTCV, <@ARRAY>, cDelim, and rDelim. |
These options set the delimiters for array values when setting the value of arrays with the <@ARRAY> tag. You can select a value from the drop-down menu or enter a custom value. The default values are "," and ";", respectively. (These delimiters can be changed for a particular instance of an array assignment using the attributes of the <@ARRAY> tag.) Data SourcesThe options in this screen set the defaults for connecting to data sources in Tango Server. |
See also "dataSourceLife" in the Meta Tags and Configuration Variablesmanual. |
This option indicates how long the Tango Server keeps open an unused connection to a data source. You can select a value from the drop-down menu or enter a custom value. The default value is 30 minutes. |
See also "itemBufferSize" in the Meta Tags and Configuration Variables manual. |
This option sets the maximum column length in bytes that Tango supports. You can select a value from the drop-down menu or enter a custom value. The default value is 64K. |
See also "DBDecimalChar" in the Meta Tags and Configuration Variables manual. |
This option tells Tango Server what decimal character ODBC data sources require in numbers. This value may be determined by the ODBC driver, the database vendor's client software, or the DBMS server. The default value is a period ".". |
See also "stripCHARs" in the Meta Tags and Configuration Variables manual. |
This option sets whether CHAR (fixed-length text field) data from data sources is automatically stripped of trailing spaces. The default value of this variable is enabled (true). |
See also "transactionBlocking" in the Meta Tags and Configuration Variables manual. |
This option sets whether other processes are blocked during database transactions. The default value is true (checked).
Date and TimeThe options in this screen set the defaults for the way that dates and times are formatted in Tango. |
See also "dateFormat, timeFormat, timestampFormat" in the Meta Tags and Configuration Variables manual. |
These options allow you to specify the formats for displaying and entering date, time, and timestamp values. The formats determine the default display formats of retrieved database values as well as those returned by meta tags. You can select a value from the drop-down menu. Debugging and LoggingThe options in this screen set the defaults for debugging and logging Tango application files. |
See also "debugMode" in the Meta Tags and Configuration Variables manual. |
If this option is set to the default, it allows the debug mode to be set within an application file. You can also force debugging on or off for all application files. |
See also "loggingLevel" in the Meta Tags and Configuration Variables manual. |
By default, logging is turned off, but can be adjusted for different options of logging. This option sets the folder used for logging. The log folder should be unique for every Tango Server running on the same machine. The default value is {default path}log.{name of server}. ExecutionThe options in this screen set the defaults for executing Tango application files. |
See also "queryTimeout" in the Meta Tags and Configuration Variables manual. |
This option causes application file executions that exceed the specified number of seconds to time out and return the HTML page specified in timeoutHTML. You can select a value from the drop-down menu or enter a custom value. The default value is five minutes. |
See also "maxActions" in the Meta Tags and Configuration Variables manual. |
If the option is set to a positive number (the default is zero), the number of Tango actions executed so far by a query is checked against the value of this variable. If the number of actions exceeds the value, the query aborts and returns an error. You can select a value from the drop-down menu or enter a custom value. |
See also "returnDepth" in the Meta Tags and Configuration Variables manual. |
This option sets the maximum number of branch levels that you can have in a Tango application file. The default value is 20. This applies to Branch actions which have the Return option set. It specifies the number of returns that can be outstanding at any time. If this limit is exceeded during an application file execution, an error occurs. You can select a value from the drop-down menu or enter a custom value. Feature SwitchesThe options in this screen are special system configuration variables that enable or disable Tango features. Possible values for all these switches are enabled or disabled (on and off). All these switches are enabled by default. |
This option tells Tango whether or not to execute JavaScript in Tango Server (that is, JavaScript that is delineated with the <@SCRIPT> tag or using the Script action).
|
|
This option tells Tango whether or not to allow Tango to read external files using the File action or the <@INCLUDE> meta tag. |
|
This option tells Tango whether or not to allow Tango to write to external files using the File action. |
|
This option tells Tango whether or not to allow Tango to delete external files using the File action. |
|
This option tells Tango whether or not to allow External actions in Tango. |
|
See also "<@DOCS>" in the Meta Tags and Configuration Variables manual. |
This option tells Tango whether or not to allow the use of the <@DOCS> meta tag, which returns the contents of an application file. A switch is provided because examining the contents of any application file could potentially be a security issue. |
For more information, see "Sending Electronic Mail From Tango". |
This option tells Tango whether or not to allows e-mail messages to be generated within Tango using the Mail action. |
This option controls whether the user can use meta tags (such as <@POSTARG>) in the user and password fields when connecting to a data source using an application file. If this switch is disabled, the user name and password must be hard coded. This provides a certain amount of security for databases accessed through Tango. File PathsThe options in this screen set the default paths to certain files used by Tango Server. |
|
See also "defaultErrorFile" in the Meta Tags and Configuration Variables manual. |
If this file exists, Tango uses the contents of this file as the error message returned to a user whenever an error condition occurs within an application file (unless you have specified Error HTML within the application file itself). You can edit the file with a text or HTML editor. The default value of this configuration variable is {default path}error.htx. |
See also "timeoutHTML" in the Meta Tags and Configuration Variables manual. |
This is the HTML document to return to the user if an application file execution times out. You can edit the timeout.html document with a text or HTML editor if you want to change the HTML that is returned to the user. The default value of this configuration variable is {default path}timeout.html |
See also "headerFile" in the Meta Tags and Configuration Variables manual. |
Tango uses the contents of this file as the HTTP header which is returned every time a request is sent to the Web browser. This is either an HTTP header targeted to the Web server under normal operation, or an HTTP header tailored for the client browser in the case of non-parsed headers being used. The default value of this configuration variable is {default path}header.htx. This variable is also specified in the Debugging and Logging screen. See "logDir" . |
See also "varCachePath" in the Meta Tags and Configuration Variables manual. |
This option specifies a folder to which
Tango writes all variables when it is shutdown, and re-reads those
variables from when Tango is started. The default value of this
configuration variable is {default path}variables.{name of
server}.
|
See also "variableTimeout" in the Meta Tags and Configuration Variables manual. |
|
For more information, see "Timed URL Processing With Tango Server". |
The cron, or Timed URL processing mechanism allows you to execute specified URLs at specified times. Only HTTP-type URLs are supported. The URLs may point to the local HTTP and Tango server or a remote one. The result HTML of the executed URL is discarded. |
The specifications are stored the file specified by this configuration file setting, conventionally called crontab, which is read on Tango Server startup. The cron service becomes active once per minute, and executes, one by one, all the URLs that satisfy the specification conditions between the previous and present activation. HTTPThe option in this screen sets the format of the default HTTP header. This variable is also found in the File Paths screen. See "headerFile" . |
|
See also "userAgent" in the Meta Tags and Configuration Variables manual. |
This option changes the value of the user-agent value in HTTP requests. The options in this screen set the e-mail defaults for Tango Server. |
See also "mailServer" in the Meta Tags and Configuration Variables manual. |
This option in the configuration file sets the e-mail server to use with the Mail action of Tango Server. The default value is localhost. |
See also "mailPort" in the Meta Tags and Configuration Variables manual. |
This option in the configuration file sets the port for the e-mail server used with the Mail action. The default value is 25. |
See also "mailDefaultFrom" in the Meta Tags and Configuration Variables manual. |
This option in the configuration file sets the default "From" e-mail address for any e-mail generated with Tango Server. The default value is set when Tango is installed under Mac OS. MemoryThe options in this screen set the caching defaults for Tango Server. |
See also "cache" in the Meta Tags and Configuration Variables manual. |
This option enables or disables caching of application files and <@INCLUDE> files. The default value is enabled (true). |
See also "cacheSize" in the Meta Tags and Configuration Variables manual. |
This option in the configuration file sets the cache size for files in bytes. You can select from the drop-down menu or enter a custom value. The default value is 2,000,000 bytes. MiscellaneousThe options in this screen set certain options that are not specified elsewhere. |
See also "encodeResults" in the Meta Tags and Configuration Variables manual. |
This option tells Tango whether or not to encode the output sent to the Web browser by Tango by changing all high-bit characters to their encoded forms. For example, "é" is encoded in HTML as é. If you would like to send binary data, or are using a character set other than ISO Latin-1, you can disable this option. The default value is enabled (true). |
See also "threadPoolSize" in the Meta Tags and Configuration Variables manual. |
This option determines the number of worker threads that the Tango Server allocates to process requests. The default value of this variable is 20. Number FormatsThe options in this screen set various defaults for how numbers are used within Tango. Some of these options are |
See also "decimalChar" in the Meta Tags and Configuration Variables manual. |
This option sets the decimal point character. You can select a value from the drop-down menu or enter a custom value. The default value is ".". |
See also "thousandsChar" in the Meta Tags and Configuration Variables manual. |
This option sets the separator character for numerals greater than one thousand. You can select a value from the drop-down menu or enter a custom value. The default value is ",". |
See also "currencyChar" in the Meta Tags and Configuration Variables manual. |
This option sets the character used when numbers are specified as currency. You can select a value from the drop-down menu or enter a custom value. The default value is "$". |
See also "staticNumericChars" in the Meta Tags and Configuration Variables manual. |
This option sets whether to not allow changes to the numeric format configuration variables during execution of an application file. The default value is true (checked), which gives better server performance. Server Start and StopThe options in this screen set the defaults for the startup and shutdown URL mechanism, which initializes and finalizes the Tango Server environment. |
For more information, see "Startup and Shutdown URL Processing". |
startupUrl specifies the URL which is executed on Tango Server startup. shutdownUrl specifies the URL which is executed upon Tango Server shutdown request. startstopTimeout specifies, in seconds, the time which Tango Server is allowed to wait for Startup/Shutdown URL to complete. By default, the waiting period is one minute. Select another value from the drop-down menu or enter a custom value. TCP/IPThe options in this screen set the defaults for TCP/IP networking on Windows and Unix systems. |
See also "validHosts" in the Meta Tags and Configuration Variables manual. |
This configuration file option sets a list of hosts for which Tango Server accepts Tango CGI connections. The names of the hosts go here, separated by a colon (":"). Setting a list of valid hosts prevents an arbitrary user on your network or the Internet from using your Tango Server. The default value is localhost. |
See also "listenerPort" in the Meta Tags and Configuration Variables manual. |
This is the port number used by Tango Server to listen for requests from the Tango CGI. This number can be any valid port number that is not currently in use on your system. (Various UNIX operating systems and applications reserve ports.) The default value is 18000. VariablesThe options in this screen set the defaults for variables and variable keying in Tango. |
See also "userKey, altuserKey" in the Meta Tags and Configuration Variables manual. |
This option tells Tango Server what piece of information to use to identify a user when assigning to and evaluating user variables. The value of the configuration variable userKey is the default key for user variables. If its contents evaluate to empty, altUserKey is used instead. The default value of userKey is <@USERREFERENCE>, indicating that user variables are keyed on the Tango user reference ID assigned to each user. The default value of altUserKey, <@CGIPARAM CLIENT_IP>, distinguishes users by IP address. |
See also "domainScopeKey" in the Meta Tags and Configuration Variables manual. |
This option sets the key for the domain variable scope. The default value, <@CIPHER action=hash str=<@CGIPARAM server_name>>, sets an encrypted key for the domain based on the name of the server. |
See also "variableTimeout" in the Meta Tags and Configuration Variables manual. |
This option sets the number of minutes before user variables expire. You can select a value from the drop-down menu or enter a custom value. The default value is 30 minutes. |
See also "defaultScope" in the Meta Tags and Configuration Variables manual. |
This option indicates the scope that is used when an assignment is made to a non-existent variable and no scope has been specified. The default value is user. CustomThis screen allows you to access all of the Tango Server system configuration variables by name and with their values specified fully, that is, not by drop-down menu shortcuts. For more details about the possible values that these configuration variables can have, see Chapter 2, "Configuration Variables," in the Meta Tags and Configuration Variables manual. In addition to all the variables that are listed previously, the following variables can be set: This option ensures the product is licensed and that the server only runs if a valid license number is entered. |
See also "logToResults" in the Meta Tags and Configuration Variables manual. |
If this option is set to true, log information (level set by the configuration variable loggingLevel with different scopes) is returned at the bottom of each hit, rather than being written to the log file specified in the configuration variable logDir. The default value is false. |
See also "persistentRestart" in the Meta Tags and Configuration Variables manual. |
This option controls how the server handles an automatic restart. An automatic restart is initiated when maxHeapSize is exceeded and when Tango detects a problem with servicing requests. When set to true, the server first attempts to completely shut down the running server before restarting a new one. All variables in use at the time of the shutdown are preserved. This is the default value. When set to false, a new server is started immediately, even before the old one is stopped. This setting ensures high server availability, but variables from the old server instance are not available in the new one. |
See also "postArgFilter" in the Meta Tags and Configuration Variables manual. |
This option sets the character(s) stripped out of all data into Tango through postargs. |
See also "FMDatabaseDir" in the Meta Tags and Configuration Variables manual. |
Macintosh only: This option is a path telling Tango where to look for local FileMaker Pro databases. When Tango tries to connect to a local data source and finds that the database is not open, it looks in this folder and opens the database (if present). |
See also "maxSessions" in the Meta Tags and Configuration Variables manual. |
Macintosh only: This option determines the maximum number of sessions Tango Server opens for DAM data sources on the Macintosh. It accepts any positive integer as a value. A value of 0 (the default) indicates no maximum. UNIX only: This option in the configuration file sets whether user-owned documents work. In secure environments, you may only want administrative Tango application files to be executed. Possible values are true and false. The default value is false. An example of a user-owned document is: http//www.isp.com/cgi_bin/Tango.cgi/~user/some_taf
|
See also "maxHeapSize" in the Meta Tags and Configuration Variables manual. |
UNIX only: Tango Server restarts itself in a clean state if its heap size exceeds this specified limit. The default value is 2000000 bytes. ![]() Editing the Tango Server Configuration File DirectlyThe Tango Server configuration file (Tango 3 Server Preferences) contains the defaults for many Tango Server options. These options are set by default. You generally do not need to edit this file directly. All of the configuration file settings can be set using Tango system configuration variables. The format of configuration file options and configuration variables is almost identical, except that configuration file options are always specified in uppercase, whereas configuration variables are generally specified in mixed case. On Windows, this file is called t3server.ini, and is by default located in C:\Windows\Tango3, or C:\WinNT\Tango3\. (On UNIX, the file is by default located in /var/opt/EDI/. On Mac OS, the file is called Tango 3 Server Preferences and is located in the Preferences folder, inside the System Folder on the startup hard disk. ). If necessary, you can edit this file directly with a text editor. Tango Server does not read this file until it starts up.
Always quit Tango Server before editing the configuration file directly. The text file contains lines with the following structure and default values: [Tango Definitions]
These lines are at the top of the configuration file and tell Tango Server that the current file sets the defaults for one or more Tango Servers on the same machine. Under the [Tango Definitions] heading is a list of the different Tango Servers (if there are more than one) followed by an equals sign and an optional comment. The [Tango3 Server] block which follows sets the defaults for that copy of Tango Server. Additional configuration line entries for different copies of Tango Server would be in the same file, preceded by a different name in square brackets, which matches the entry in the definitions section (for example, [Tango3 Server2]). The only configuration variable that you may need to edit directly is configPassword. |
See also "configPasswd" in the Meta Tags and Configuration Variables manual. |
The configuration variable, configPassword with user scope and configPassword with system scope must match in order for the user to modify system configuration variables, for example, in the config.taf application file. ![]() Tango CGI or Plug-in Configuration FileThe t3client.ini file, which resides in C:\WINNT\Tango3\ , C:\Windows\Tango3\, or/var/opt/EDI/, controls the configuration of the Tango CGI program or Tango Web server plug-in; that is, t3cgi.exe (Windows NT), t3.cgi (UNIX), t3ns.dll (Netscape Server plug-in) or t3iis.dll (Microsoft Internet Information Server plug-in). It is used to define what Tango Server process the program can talk to. The structure of this file is similar to the Tango Server configuration file. [Tango CGI Definitions]
[t3cgi.exe]
[additional CGI name]
These lines are at the top of the configuration file and tell the Tango that the current file sets the defaults for one or more Tango CGI programs on the same machine. Under the [Tango CGI Definitions] heading is a list of the different Tango CGI programs (if there are more than one) followed by an equals sign and an optional comment. The [t3cgi.exe] block which follows sets the defaults for that CGI. Additional configuration line entries for different CGI programs would be in the same file, preceded by a different name in square brackets, which matches the entry in the definitions section (for example, [t3cgialt.exe]). If you are using the plug-ins and not the CGI program, use t3ns.dll or t3iis.dll here. If you are running Tango Server under UNIX, use t3.cgi here. The following describes the configuration file line entries. This line in the configuration file specifies the name of the host that Tango CGI connects to. This is the machine name or IP address where the Tango Server process is running. |
For more information, see "listenerPort" . |
This is the port number to which Tango CGI will try to connect. This should correspond to the value in cgiListenerPort in the Tango Server configuration file. This can be a list of ports, delineated with the colon (":") character, which would specify multiple Tango Servers. Tango CGI randomly selects one of the ports to connect to. If the connection fails, it continues to try until the remaining ports until all have been exhausted. This can be used to scale a site that does not require variable sharing among multiple servers. |
Copyright © 1998, Pervasive Software Inc. All rights reserved.