Monitoring Web Services


Mac OS X Server provides a variety of statistics for monitoring the Apache Web service. Using the Server Admin tool, you can monitor each Web site individually or the Web server as a whole. The information provided by the monitoring tools is invaluable for troubleshooting connection problems and determining if resources are being properly used.

To graph Web statistics:

1.

Launch the Server Admin tool located in /Applications/Server, and authenticate as the administrator (Figure 9.88).

Figure 9.88. Launch the Server Admin tool, and authenticate.


2.

Select the Web service for your server in the Computers & Services list (Figure 9.89).

Figure 9.89. The Web service is selected in the Computers & Services list.


3.

Click the Graphs tab .

The Graphs frame defaults to requests per second (Figure 9.90).

Figure 9.90. This is an example of a Web server throughput performance graph.


4.

Use the slider below the graph to manipulate the graph's sample timeframe.

5.

Click the pop-up menu to select any of the other graphs (Figure 9.91):

  • Throughput per second

  • Requests per second using the performance cache

  • Throughput per second using the performance cache

Figure 9.91. The pop-up menu lets you view different Web server performance graphs.


The graphs that include the performance cache show two series; the lower series is the cache results (Figure 9.92).

Figure 9.92. Graphs that include the performance cache show two series; the lower series is the cache results.


Tips

  • If you've recently enabled your Web server, you may have to wait some time for the graphs to react. You can always move things along by using a Web server benchmark utility. See the sidebar "Apache Benchmark Test" for more information.

  • Click the Refresh button to force the Server Admin tool to refresh the performance graphs immediately.

  • If you like to keep tabs on your Web server usage, you can leave the Server Admin tool running and on the graphs view. Server Admin will automatically update based on the refresh settings.


Apache Benchmark Test

You can always test your Web server by using a Web browser on another computer, or you can be a real geek and use the powerful ApacheBench command-line utility (Figure 9.93). It's always best to read the manual page of a command-line utility understand how it works; but to get you started, here are a few examples:

  • To display ApacheBench usage information, enter the command ab h.

  • To send 1,000 sequential test requests to a server, enter ab n 1000 http://sitename/.

  • To send 1,000 concurrent test requests to a server, enter ab n 1000 c 1000 http://sitename/.

Figure 9.93. This is typical output from the ApacheBench command-line Web server benchmarking utility.



Using log files

Although performance graphs in the Server Admin tool are nice to look at, the real business of Web site monitoring is in the log files. The Apache Web server is renowned for the extensive detailed information available in its log files. You can even modify the log-file formatting to meet your specific needs.

To configure the Access and Error log files:

1.

Launch the Server Admin tool located in /Applications/Server, and authenticate as the administrator (Figure 9.94).

Figure 9.94. Launch the Server Admin tool, and authenticate.


2.

Select the Web service for your server in the Computers & Services list (Figure 9.95).

Figure 9.95. The Web service is selected in the Computers & Services list.


3.

Click the Settings button and then the Sites tab .

4.

In the Sites list, double-click the Web site you wish to configure (Figure 9.96).

Figure 9.96. Select the Web site you wish to edit from the Web Sites list.


5.

If it isn't already selected, click the Logging tab to see this Web site's log settings.

The Logging frame shows settings for both the Access and Error logs. For every site, there is an Error log that can't be disabled and an Access log that is enabled by default (Figure 9.97).

Figure 9.97. The Logging pane lets you configure the Access and Error log settings for each Web site.


6.

Select the Archive option, and enter the number of days between archives in the appropriate fields (Figure 9.98).

Neither the Access nor Error log is archived by default, and log files can become large on busy servers.

Figure 9.98. Archiving of the Access and Error logs has been enabled for this Web site.


7.

To specify a custom location for the log files, do either of the following:

  • Type a new path in the Location field.

  • Click the ellipsis button to use the browse dialog (Figure 9.99).

    Figure 9.99. Select the appropriate file on your server using the browse dialog.


8.

To modify the Access log format string, do either of the following:

  • Enter a custom string in the "Format string" field.

  • Click the Format pop-up menu to specify a predefined format string (Figure 9.100).

    Figure 9.100. You can select a predefined Access log format string from this pop-up menu.


9.

To modify the Error log, click the Level pop-up menu and pick a log level (Figure 9.101).

Figure 9.101. You can select an Error log level from this pop-up menu.


Levels range from Emergency, which provides the least logging; to Debug, which provides the most logging.

10.

When you've finished making changes, click the Save button .

11.

To view the logs, click the Logs tab .

Notice that each Web site has its own Access and Error log. Select the log file you wish to view in the top list, and it appears in the pane below (Figure 9.102).

Figure 9.102. The Logs frame displays the Access and Error log for every Web site on your server.


Tips

  • The Server Admin tool should automatically restart the Web service when you click the Save button .

  • It's important to remember that log settings are configured separately for each Web site you have.

  • See the sidebar "Apache Log Analysis Tools" for more information about interpreting Apache access logs.

  • Click the Refresh button to force the Server Admin tool to refresh the logs immediately.

  • If you like to keep tabs on your server usage, you can leave the Server Admin tool running and on the logs view. Server Admin will automatically update based on the refresh settings.


Apache Log Analysis Tools

Apache access logs can be complicated to understand. You can read more about the log formats at http://httpd.apache.org/docs/logs.htm. Or, you can try one of the many Apache log analysis tools available:

AWStats A free, Web-based, open-source log analysis tool: http://awstats.sourceforge.net/

Webalizer Another free, Web-based log analysis tool: http://www.mrunix.net/Webalizer/

Urchin A very popular commercial log analysis suite (Figure 9.103): http://www.urchin.com/

Figure 9.103. This is typical output of the Urchin Web log analysis tool.





    Mac OS X 10. 3 Server Panther. Visual QuickPro Guide
    Mac OS X Server 10.3 Panther: Visual QuickPro Guide
    ISBN: 0321242521
    EAN: 2147483647
    Year: 2004
    Pages: 105

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net