(Note: The version of this module for IHS 1.3 is described here.)
Enable this module only when gathering information for a suspected IHS or application problem related to the data which is sent between the web server and the client.
IBM HTTP Server 6.1 and earlier users: Copy mod_net_trace.so for your platform to the modules directory in the web server installation location (e.g., to /opt/IBMIHS/modules).
IBM HTTP Server 7.0 and later: On supported platforms, this module is provided with
the product in the modules/debug/
subdirectory.
IBM HTTP Server 6.1 and earlier: Use the following LoadModule directive and use the NetTraceFile and NetTrace directives to tailor mod_net_trace to your environment.
LoadModule net_trace_module modules/mod_net_trace.so
Add the following to httpd.conf, replacing 111.222.333.444 with the IP address of the client that will recreate the problem.
<IfModule mod_net_trace.c> NetTraceFile /tmp/nettrace NetTrace client 111.222.333.444 dest file event senddata=100000 event recvdata=100000 event misccalls (entire NetTrace directive on one line) </IfModule>
If more than 100,000 bytes of sent or received data needs to be collected, adjust the senddata and recvdata parameters as necessary.
IBM HTTP Server 7.0 and later: See conf/httpd.conf.default for the LoadModule and
NetTrace directives referencing this module from the modules/debug/
subdirectory.
Comment out the LoadModule directive for mod_net_trace.
The default filename is logs/trace
. You can use this
this directive with a full path or a path relative to the server root
to specify where you want traced data to be stored.
This only affects data traced due to rules that specified dest
file
.
This allows you to match on specific client IP addresses. The
value for this keyword can be *
to match all clients or
ip-address to match a particular client or
ip-address/num-prefix-bits to match particular subnets. It
only works with numeric IP addresses (IPv4 or IPv6).
You shouldn't code client
more than once.
To trace requests where IHS acts as a proxy, you can use the IP address of
the origin server as an argument to client
This specifies the destination of the collected data for this
rule. You can specify more than one destination. Here are the values
for dest
:
Data will be written to the file specified by the
NetTraceFile
directive.
This is the default.
Data will be stored in memory.
The memory is released at the end of the connection, but if the server crashes while processing a request on the connection the data will be available in the core dump for debugging.
Data will be written to the server error log. The priority is
notice, so the trace records will be written regardless
of the value of the LogLevel
directive.
If specified, the server port for the connection must match the value of this operand.
If specified, the client port for the connection must match the value of this operand.
This is only useful in some limited test scenarios.
This specifies the events which will be traced. By default, send
and receive-related API crossings will be traced. Here are the
possible values for event
:
senddata[=bytelimit]
Capture data sent by IHS. The default bytelimit (limit on how much sent data will be captured on a connection) is 1024. Note: file contents sent via apr_sendfile() will not be traced.
recvdata[=bytelimit]
Capture data received by IHS. The default bytelimit (limit on how much received data will be captured on a connection) is 1024.
misccalls
Trace miscellaneous socket calls (e.g., apr_socket_close(), apr_socket_timeout_set(), etc.).
Miscellaneous options
usec
Record microsecond timestamp for some important trace points
If specified, the URL for the request must match this value. This is not determined until after the request has been read, so the HTTP request header will be traced even if the URL is different.
NetTrace client 9.0.0.0/8 dest file dest memory event \ senddata event recvdata=4096 serverport 8080 NetTrace client 127.0.0.1 dest errlog event recvdata=4096 NetTraceFile /tmp/netr
For requests received from client 127.0.0.1 (loopback), the first 4096 bytes of data received (but none of the data sent) will be written to the Apache/IHS error log.
For requests received from the 9.0.0.0/8 subnet with server port 8080, the first 1024 bytes of data sent and the first 4096 bytes of data received will be written to the file /tmp/netr and will be kept in memory for analysis in case a core dump is subsequently generated during the processing of the connection.
The mod_net_trace hex output is useful for some problem determination tasks, but unruly for others such as searching for long strings. mod_net_trace output can be formatted into flat files with headers/request/response data using the ServerDoc tool available in the ihsdiag download.
See ../deflate_diag.html#parse for an example of using the ParseNetTrace formatter.