Information about the Web Site

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 2003 (Modified)


4D allows you to obtain information about the functioning of your 4D Web site.

You can control the site by using particular URLs (/4DSTATS, /4DHTMLSTATS, /4DCACHECLEAR and /4DWEBTEST).

You can generate a log of all the requests.

You can obtain information regarding the Web Server in the Watch page of the Runtime Explorer window.

Web Server Management URLs


4D Web Server accepts four particular URLs: /4DSTATS, /4DHTMLSTATS, /4DCACHECLEAR and /4DWEBTEST.

/4DSTATS, /4DHTMLSTATS and /4DCACHECLEAR are only available to the Designer and Administrator of the database. If the database's 4D password system has not been activated, these URLs are available to all the users.

/4DWEBTEST is always available.

/4DSTATS

The /4DSTATS URL returns the following information in pure text form:

the number of "hits" (low-level connections),

the number of contexts created,

the number of contexts that could not be created,

the number of password errors,

the number of pages stored in the cache,

the percentage of cache used,

the list of pages and JPEG or GIF files stored in the cache of the static pages (*).

(*) For more information about the cache of static pages and pictures, please refer to section Web Server Settings.

This information can allow you to check the functioning of your server and eventually adapt the corresponding parameters.

Note: The command WEB CACHE STATISTICS allows you to also obtain information about how the cache is being used for static pages.

/4DHTMLSTATS

The /4DHTMLSTATS URL returns, also in pure text form, the same information as the /4DSTATS URL. The difference is that in the last field (contained in the cache), only the list of HTML pages — without the .GIF and .JPEG files — present in the cache is returned.

/4DCACHECLEAR

The /4DCACHECLEAR URL immediately clears the cache of the static pages and images. It allows you to therefore "force" the update of the pages that have been modified.

/4DWEBTEST

The /4DWEBTEST URL is designed to check the Web Server status. When this URL is called, 4D returns a text file only with the following HTTP fields filled:

Date: current date at the RFC 822 format

For example: "Date: Wed, 26 Jan 2000 13:12:50 GMT"

Server: 4D WebStar_D/internal version number

For example: "4D WebStar_D/7.0"

User-Agent: name and version @ IP client address

For example: "Mozilla/4.08 (Macintosh; I; PPC, Nav) @ 192.193.00.00"

Connection Log File


4D allows you to obtain a log of requests. The log is presented in the form of a text file named "logweb.txt" automatically placed at the same level as the structure file of the database. This file is in CLF (Common Log Format) format or NCSA format, recognized by most Web site analysis tools.

The "logweb.txt" file is automatically located:

with 4th Dimension and 4D Server, next to the database structure file.

with 4D Client, next to the .exe file of the application (Windows) or the software package (Mac OS).

Each line of the file represents a request, such as:

host rfc931 user [DD/MMM/YYYY:HH:MM:SS] "request" state length

Each field is separated by a space and each line ends by the CR/LF sequence (character 13, character 10).

host: IP address of the client (ex. 192.100.100.10)

rfc931: information not generated by 4D, it's always - (a minus sign)

user: user name as it is authenticated, or else it is - (a minus sign). If the user name contains spaces, they will be replaced by _ (an underscore).

DD: day, MMM: a 3-letter abbreviation for the month name (Jan, Feb,...), YYYY: year, HH: hour, MM: minutes, SS: seconds

The date and time are local to the server.

request: request sent by the client (ex. GET /index.htm HTTP/1.0)

state: response given by the server.

length: size of the data returned (except the HTTP header) or 0.

Note: For performance reasons, the operations are saved in a memory buffer in packets of 1Kb before being written to disk. The operations are also written to disk if no request has been sent every 5 seconds.

The possible values of state are as follows:

200: OK

204: No contents

302: Redirection

304: Not modified

400: Incorrect request

401: Authentication required

404: Not found

500: Internal error

Examples of lines generated by the request log:

192.100.100.10 - - [25/Jan/2003:12:54:06] "GET /index.htm" 200 6524

The Web client whose address was 192.100.100.10 was not authenticated. It asked for page index.htm, which was sent (it contains 6,524 bytes).

192.100.101.25 - - [25/Jan/2003:12:54:09] "GET /123456.htm" 404 125

The Web client whose address was 192.100.101.25 was not authenticated. It asked for page 123456.htm, which was not found (4D sent a message of 125 bytes).

192.100.101.31 - - [25/Jan/2003:12:54:10] "GET /secret.htm" 401 0

The Web client whose address was 192.100.101.31 was not authenticated. It asked for page secret.htm, the server requested Authentication.

192.100.101.31 - ZZZZ [25/Jan/2003:12:54:11] "GET /secret.htm" 401 0

The Web client whose address was 192.100.101.31 was authenticated as ZZZZ. It asked for page secret.htm, the user name was unknown.

192.100.101.31 - 4D [25/Jan/2003:12:54:12] "GET /secret.htm" 200 2543

The Web client whose address was 192.100.101.31 was authenticated as 4D. It asked for page secret.htm, which was sent (it contains 2,543 bytes).

Warning: The log file can be imported into a spreadsheet or directly into 4D. However, you must imperatively stop the Web server before importing it.

By default, the log file of requests is not generated. To request the generation of a log file of all the Web requests you must check the Save Request in File (logweb.txt) option on the Configuration page of the Web theme of the database Preferences.

Runtime Explorer Information


The Watch page ("Information" heading) in the Runtime Explorer displays three pieces of information relative to the Web Server:

Web Cache Usage: indicates the number of pages present in the Web cache as well as its use percentage. This information is only available if the Web server is active and if the cache size is greater than 0.

Web Server Elapsed Time: indicates the duration of use (in hours:minutes:seconds format) of the Web server. This information is only available if the Web server is active.

Web Hits Count: indicates the total number of HTTP requests received since the Web server boot, as well as an instantaneous number of requests per second (measure taken between two Runtime Explorer updates). This information is only available if the Web server is active.

Note: For more information about the Runtime Explorer, refer to 4D Design Reference manual.

See Also

WEB CACHE STATISTICS, Web Server Settings.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next