Online Book Reader

Home Category

Squid_ The Definitive Guide - Duane Wessels [175]

By Root 1974 0
UAPRSF=011000 wnd=57920 cksum=EB38 urg=0

DATA: GET / HTTP/1.0.

Host: www.ircache.net.

Accept: text/html, text/plain, application/pdf, application/

postscript, text/sgml, */*;q=0.01.

Accept-Encoding: gzip, compress.

Accept-Language: en.

Negotiate: trans.

User-Agent: Lynx/2.8.1rel.2 libwww-FM/2.14.

.

Note that tcpshow prints a period where the data contains a newline character.

Once you've captured a request, save it to a file. Then you can replay it through Squid with netcat or socket:

% socket squidhost 3128 < request | less

If the response looks normal, the problem might be with the user-agent. Otherwise, you can change various things to isolate the problem. For example, if you see some funny-looking HTTP headers, delete them from the request and try it again. You may also find it useful to try the request directly with the origin server, instead of going through Squid. To do that, remove the http://host.name/ from the request and send it to the origin server:

% cat request

GET / HTTP/1.1

User-Agent: Mozilla/5.0 (compatible; Konqueror/3)

Pragma: no-cache

Cache-control: no-cache

Accept: text/*, image/jpeg, image/png, image/*, */*

Accept-Encoding: x-gzip, gzip, identity

Accept-Charset: iso-8859-1, utf-8;q=0.5, *;q=0.5

Accept-Language: en

Host: squidbook.org

% socket squidbook.org 80 < request | less

When working with HTTP in this manner, you might find it useful to refer to RFC 2616 and O'Reilly's HTTP: The Definitive Guide.

Reporting a Bug

If your Squid version is more than a few months old, you should probably update it before reporting any bugs. Chances are that others noticed the same bug, and it may already be fixed.

If you discover a legitimate bug in Squid, please enter it into the Squid bug tracking database: http://www.squid-cache.org/bugs/. This is currently a "bugzilla" database, which requires you to create an account. You will receive updates as the bug is processed by Squid developers.

If you are new at reporting bugs, please take the time to read "How to Report Bugs Effectively," by Simon Tatham (http://www.chiark.greenend.org.uk/~sgtatham/bugs.html).

When reporting a bug, be sure to include the following information:

Squid version number. If the bug happens with more than one version, include the other versions as well.

Your operating system name and version.

Whether the bug happens every time or occasionally.

A good description of exactly what happens. Phrases such as "it doesn't work," and "the request fails" are essentially useless to bug fixers. Be very specific.

A stack trace in the case of an assertion, bus error, or segmentation violation.

Remember that Squid developers are generally unpaid volunteers, so be patient. Critical bugs have more priority over minor annoyances.

Exercises

Use tcpdump or ethereal to capture some real HTTP requests. Save them to a file and replay the requests through Squid. Feel free to modify or delete some of the HTTP headers.

Try to make Squid run out of file descriptors.

Run tail -f cache.log and start Squid with debug_options set to ALL,3. If that is too overwhelming, try ALL,2.

Force Squid to generate a core file by sending each of the following signals: SIGBUS, SIGSEGV, and SIGABRT. Find the core file and use gdb or another debugger to get a stack trace.

Appendix A. Config File Reference

This appendix contains descriptions and examples for every squid.conf directive. I present them here in the same order they appear in the default squid.conf. That means certain related directives are grouped together, and some recently added directives are at the end. You may want to use the book's index to locate a particular directive by name.

In the following sections, the descriptive text is followed by a table that contains the directive's syntax, a default value, an example, and related directives.

Name

http_port

Synopsis

This is the port, or ports, Squid uses to listen for HTTP requests from cache clients. If your system has more than one network interface, you can use the optional hostname prefix to make

Return Main Page Previous Page Next Page

®Online Book Reader