Setting up logs on HTTP Server (powered by Apache)

 

In the IBM HTTP Server for i5/OS, you can set up logs to record events and other information for your HTTP Server with the IBM Web Administration for i5/OS interface.

Information for this topic supports the latest PTF levels for HTTP Server for iSeries . IBM recommends that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See IBM Service for more information.

Your HTTP Server (powered by Apache) can generate a record of events commonly referred to as a Log. Logs can contain error messages, information on what is being accessed on your HTTP Server (powered by Apache), who is accessing your HTTP Server (powered by Apache), script logs, and FRCA logs.

The following topics discuss general log settings required for all logs, Access logs, Error logs, Script logs, FRCA logs, where to find the HTTP Server job log, and how to run a trace.

 

Parent topic:

Log and log file tasks

 

General log settings

Before creating a specific log type, the general settings for all logs must be applied to your HTTP Server (powered by Apache) configuration. To configure the general settings for all logs, do the following:

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select your HTTP Server (powered by Apache) from the Server list.

  4. Select the context you want to work with from the Server area list.

  5. Expand Server Properties.

  6. Click Logging.

  7. Click the General Settings tab in the form.

    The General Settings allow you to specify log entry time (local or Greenwich Mean Time), the log cycle, and maximum log file size.

  8. Click Apply.

After you complete the general settings for all logs, you can specify what type of logs you want to create.

 

Access Logs

Access logs contain a record of requests to the HTTP Server (powered by Apache). The access log itself can be configured to record specific information that you will want to review later. To configure an access log, do the following:

  1. See General log settings.

  2. Click the Manage tab.

  3. Click the HTTP Servers subtab.

  4. Select your HTTP Server (powered by Apache) from the Server list.

  5. Select the context you want to work with from the Server area list.

  6. Expand Server Properties.

  7. Click Logging.

  8. Click the Custom Log tab in the form.

    You can specify various types of information that can be logged in the Access log by specifying a customized log format. For more information how to specify a customized log format see Log Format.

  9. Click Apply.

 

Error Logs

Error Logs contain records of errors that are encountered by visitors to the server. You can specify what types of errors that are logged. To configure error logs, do the following:

  1. See General log settings.

  2. Click the Manage tab.

  3. Click the HTTP Servers subtab.

  4. Select your HTTP Server (powered by Apache) from the Server list.

  5. Select the context you want to work with from the Server area list.

  6. Expand Server Properties.

  7. Click Logging.

  8. Click the Error Logs tab in the form.

    You must first enable error logging to edit what errors will be logged. Once enabled, do the following:

  9. Enter the path and name of the error log.

  10. Enter an expiration date.

  11. The value defines how long the error log will be maintained before information is rolled over.

  12. Enter a maximum cumulative size.

    The value defines how large your error log can be before old log entries are deleted.

  13. Select logging level.

    From the Logging level list, select the level of information you want entered in the error log.

  14. Click Apply.

 

Script Logs

Script Logs contain errors generated by CGI programs running on the server. Generally you should only enable these logs when you are debugging programs on the server. To configure script logs, do the following:

Set up a script log only if you are running CGI programs.

  1. See General log settings.

  2. Click the Manage tab.

  3. Click the HTTP Servers subtab.

  4. Select your HTTP Server (powered by Apache) from the Server list.

  5. Select the context you want to work with from the Server area list.

  6. Expand Server Properties.

  7. Click Logging.

  8. Click the Script Logs tab in the form.

    You must first enable script logging to edit what script errors will be logged. Once enabled, do the following:

  9. Enter the path and name of the script error log.

  10. Enter a maximum log file size.

    The value defines the size of the script error log.

  11. Enter a maximum log entry size.

    The value defines the size of the script error log entry.

  12. Click Apply.

 

FRCA Logs

Fast Response Cache Accelerator ( FRCA) is an extension to the HTTP Server (powered by Apache) that enables caching and serving of data in Licensed Internal Code.

  1. See General log settings.

  2. Click the Manage tab.

  3. Click the HTTP Servers subtab.

  4. Select your HTTP Server (powered by Apache) from the Server list.

  5. Select the context you want to work with from the Server area list.

  6. Expand Server Properties.

  7. Click Logging.

  8. Click the FRCA Logs tab in the form.

    FRCA must be enabled before information is written to the FRCA log. Once enabled, do the following:

  9. Click Add under the FRCA logs table.

  10. Enter the path and name of the FRCA log.

  11. Enter the log format.

    For more information how to specify a customized log format see Log formats for HTTP Server (powered by Apache).

  12. Enter the environment variable conditions.

  13. Enter an expiration date.

    The value defines how long the FRCA log will be maintained before information is rolled over.

  14. Enter the maximum cumulative size of the FRCA log file.

    The value defines how large your FRCA log can be before old log entries are deleted.

  15. Click Continue.

  16. Click Apply.

For information on ASF Tomcat logs, see About Tomcat.

 

HTTP server job logs

The HTTP Server job logs contain messages or exceptions. The HTTP Server (powered by Apache) job log is maintained in the QHTTPSVR subsystem, listed with a job name matching the name of your HTTP Server instance.

 

Run a trace

The HTTP Server (powered by Apache) trace allows you to view various levels of trace information related to a specific server. You will need to have a 5250 session on the iSeries™ your HTTP Server is currently running on.

  1. Start a 5250 session.

  2. Start the server with a parameter of the STRTCPSVR command. Use the following:

    • -ve (error) for a trace that contains records for all error return codes or exception conditions.

    • -vi (information) for a trace that contains -ve level trace records as well as trace records for entry and exit points from application level API's and API parameters.

    • -vv (verbose) for a trace that contains -vi level trace records as well as trace records for debugging control flow or data corruption.

    For example STRTCPSVR *HTTP HTTPSVR(JKLSERVER '-vv').

  3. There are three ways to get output from the trace:

    • ENDTCPSVR - When the server is ended the trace data is placed into a spool file. There is a spool file for each job that is running on the server. If a server ends abnormally, trace data is placed into spool files even if tracing is not active at the time of the error.

    • DMPUSRTRC - This command dumps the trace data for a specific job to the display or to a physical file member in the QTEMP library. For example:

      1. Use the WRKACTJOB command to find the server job number. For example WRKACTJOB SBS(QHTTPSVR).

      2. Dump the user trace to a file in QTEMP. For example DMPUSRTRC JOB(nnnnnn/QTMHHTTP/MYSERVER), where nnnnnn is the job number and MYSERVER is the server.

      3. Use the DSPPFM command to view the contents of the trace. For example DSPPFM QTEMP/QAP0ZDMP MBR(QP0Znnnnnn).

    • TRCTCPAPP - You can use the TRCTCPAPP command to initiate a trace after the server is started and to end a trace. To use the TRCTCPAPP command, the server must have been started with the STRTCPSVR command.

      If you started the trace with the STRTCPSVR and one of the trace startup parameters (-ve, -vi, or -vv), then do the following to end the trace:

      1. Enter the TRCTCPAPP SET (*ON) command to synchronize it with the STRTCPSVR command. For example: TRCTCPAPP APP(HTTP) SET(*ON) HTTPSVR(JKLSERVER) TRCLVL(*VERBOSE).

      2. Enter the TRCTCPAPP SET (*OFF) command. For example: TRCTCPAPP APP(*HTTP) SET (*OFF) TITLE('My title').