The WEB SET OPTION command modifies the current value of various options concerning the functioning of the 4D Web server.
In the selector parameter, pass one of the constants from the Web Server theme and pass the new value of the option in value:
Constant
Type
Value
Comment
Web Character set
Longint
17
Scope: 4D local, 4D Server Kept between two sessions: Yes Description: Character set that the 4D Web Server (with 4D in local mode and 4D Server) should use to communicate with browsers connecting to the database. The default value actually depends on the language of the operating system. This parameter is set in the Database settings. Possible values: The possible values depend on the operating mode of the database relating to the character set.
UnicodeMode: When the application is operating in Unicode mode, the values to pass for this parameter are character set identifiers (MIBEnum longint or Name string, identifiers defined by IANA, see the following address: http://www.iana.org/assignments/character-sets). Here is the list of identifiers corresponding to the character sets supported by the 4D Web server: 4=ISO-8859-1 12=ISO-8859-9 13=ISO-8859-10 17=Shift-JIS 2024=Windows-31J 2026=Big5 38=euc-kr 106=UTF-8 2250=Windows-1250 2251=Windows-1251 2253=Windows-1253 2255=Windows-1255 2256=Windows-1256
ASCII compatibility mode: Western European 1: Japanese 2: Chinese 3: Korean 4: User-defined 5: Reserved 6: Central European 7: Cyrillic 8: Arabic 9: Greek 10: Hebrew 11: Turkish 12: Baltic
Web HTTP Compression Level
Longint
50
Scope: Local Web server Kept between two sessions: No Description: Compression level for all compressed HTTP exchanges for the 4D HTTP server (client requests or server replies, Web and Web Service). This selector lets you optimize exchanges by either privileging speed of execution (less compression) or the amount of compression (less speed). The choice of a value depends on the size and type of data exchanged. Pass 1 to 9 in the value parameter where 1 is the fastest compression and 9 the highest. You can also pass -1 to get a compromise between speed and rate of compression. By default, the compression level is 1 (faster compression). Possible values: 1 to 9 (1 = faster, 9 = more compressed) or -1 = best compromise.
Web HTTP Compression Threshold
Longint
51
Scope: Local HTTP server Kept between two sessions: No Description: In the framework of optimized HTTP exchanges, size threshold for requests below which exchanges should not be compressed. This setting is useful in order to avoid losing machine time by compressing small exchanges. Possible values: Any Longint type value. Pass the size expressed in bytes in vaue. By default, the compression threshold is set to 1024 bytes
Web HTTPS Port ID
Longint
39
Scope: 4D local, 4D Server Kept between two sessions: Yes Description: TCP port number used by the Web server of 4D in local mode and of 4D Server for secure connections via SSL (HTTPS protocol). The HTTPS port number is set on the “Web/Configuration” page of the Database settings dialog box. By default, the value is 443 (standard value). You can use the constants of the TCP Port Numbers theme for the value parameter. Possible values: 0 to 65535
Web Inactive process timeout
Longint
78
Scope: Local Web server Kept between two sessions: No, but remains valid even if the HTTP server is restarted Description: Modifies the life duration of the inactive processes associated with sessions. At the end of the timeout, the process is killed on the server, the On Web Session Suspend database method is called then the session context is destroyed. Possible values: Longint (minutes) Default value: 480 minutes (pass 0 to restore the default value)
Web Inactive session timeout
Longint
72
Scope: Local Web server Kept between two sessions: No, but remains valid even if the HTTP server is restarted Description: Modifies the life duration of inactive sessions (duration set in cookie). At the end of this period, the session cookie expires and is no longer sent by the HTTP client. Possible values: Longint (minutes) Default value: 480 minutes (pass 0 to restore the default value)
Web IP Address to listen
Longint
16
Scope: 4D local, 4D Server Kept between two sessions: Yes Description: IP address on which the 4D Web server will receive HTTP requests with 4D in local mode and 4D Server. By default, no specific address is defined (value = 0). This parameter can be set in the Database settings. The Web IP Address to listen selector is useful for 4D Web Servers compiled and merged with 4D Desktop (in which there is no access to the Design mode). You pass a hexadecimal IP address in the value parameter. In other words, to designate a IP address such as "a.b.c.d", you should write:
Scope: Local Web server Kept between two sessions: No, but remains valid even if the HTTP server is restarted Description: Enables or disables the session management mode (described in the Web Sessions Management section) Possible values: 1 (enable mode) or 0 (disable mode) Default value: 1 for databases created in v13, 0 for converted databases. Note that this mode also enables the mechanism for reusing temporary contexts in remote mode. For more information about this mechanism, refer to the description of this option in the Web Server Settings section.
Web Log Recording
Longint
29
Scope: 4D local, 4D Server Kept between two sessions: Yes Description: Starts or stops the recording of Web requests received by the Web server of 4D in local mode or 4D Server. By default, the value is 0 (requests not recorded). The log of Web requests is stored as a text file named "logweb.txt" that is automatically placed in the Logs folder of the database, next to the structure file. The format of this file is determined by the value that you pass. For more information about Web log file formats, please refer to the Information about the Web Site section. This file can also be activated on the "Web/Log" page of the Database settings. Possible values: 0 = Do not record (default), 1 = Record in CLF format, 2 = Record in DLF format, 3 = Record in ELF format, 4 = Record in WLF format.
Warning: Formats 3 and 4 are custom formats whose contents must be set beforehand in the Database settings. If you use one of these formats without any of its fields having been selected on this page, the log file will not be generated.
Web Max Concurrent Processes
Longint
18
Scope: 4D local, 4D Server Kept between two sessions: Yes Description: Strictly upper limit of concurrent Web processes of any type supported by the 4D Web Server with 4D in local mode and 4D Server. When this number (minus one) is reached, 4D will not create any other processes and returns the HTTP status 503 - Service Unavailable to all new requests. This parameter can prevent the 4D Web Server from saturation, which can occur when an exceedingly large number of concurrent requests are sent, or when too many context creations are requested. This parameter can also be set in the Database settings. In theory, the maximum number of Web processes is the result of the following formula: Available memory/Web process stack size. Another solution is to view the information on Web processes displayed in the Runtime Explorer: the current number of Web processes and the maximum number reached since the Web server boot are indicated. Possible values: Any value between 10 and 32 000. The default value is 100.
Web Max sessions
Longint
71
Scope: Local Web server Kept between two sessions: No, but remains valid even if the HTTP server is restarted Description: Limits the number of simultaneous sessions. When you reach the limit set, the oldest session is closed (and On Web Session Suspend database method is called) if the Web server needs to create a new one. Possible values: Longint. The number of simultaneous sessions cannot exceed the total number of Web processes (Web Max Concurrent Processes option, 100 by default) Default value: 100 (pass 0 to restore the default value)
Web Maximum requests size
Longint
27
Scope: 4D local, 4D Server Kept between two sessions: Yes Description:Maximum size (in bytes) of incoming HTTP requests (POST) that the Web server is authorized to process. By default, the value is 2 000 000, i.e. a little less than 2 MB. Passing the maximum value (2 147 483 648) means that, in practice, no limit is set. This limit is used to avoid Web server saturation due to incoming requests that are too large. When a request reaches this limit, the 4D Web server refuses it. Possible values: 500 000 to 2 147 483 648.
Web Session cookie name
Longint
73
Scope: Local Web server Kept between two sessions: No, but remains valid even if the HTTP server is restarted Description: Sets the name of the cookie used for saving the session ID. Possible values: Text Default value: "4DSID" (pass an empty string to restore the default value)
Note (v13.2): Additional codes are available for the selector parameter. They will be provided as constants in upcoming versions of 4D but they can be used beginning with version 13.2:
selector = 15: Sets or gets the number of the TCP port used by the 4D Web server with 4D in local mode and 4D Server (longint). By default, the value is 80. The TCP port number is set on the "Web/Configuration" page of the Database Settings dialog box. You can use one of the constants in the TCP Port Numbers theme for the value parameter. This selector is useful within the framework of 4D Web servers that are compiled and merged using 4D Desktop (no access to the Design environment). For more information about the TCP port number, refer to Web Server Settings.
selector = 81: Sets or gets the value of the "domain" field of the session cookie (Text).
selector = 82: Sets or gets the value of the "path" field of the session cookie (Text). The selectors 81 and 82 are useful for controlling the scope of the session cookies: - If you set, for example, the value "/*.4d.fr" for selector 81, the client will only send a cookie when the request is addressed to the domain ".4d.fr", which excludes servers hosting external static data. - If you set, for example, the value "/4DACTION" for selector 82, the client will only send a cookie for dynamic requests beginning with 4DACTION, and not for pictures, static pages, etc.