1 diff -urN squid-2.5.STABLE1.org/contrib/config.site squid-2.5.STABLE1/contrib/config.site
2 --- squid-2.5.STABLE1.org/contrib/config.site Thu Jan 1 01:00:00 1970
3 +++ squid-2.5.STABLE1/contrib/config.site Tue Sep 24 22:28:05 1996
5 +# This is file config.site.
6 +# Set environment variable CONFIG_SITE to this file
7 +# to get site specific defaults for configure
8 +# AUTHOR: Markus Gyger
10 +# HP ANSI/ISO C compiler
13 +: ${LDFLAGS="${CFLAGS}"}
15 +# Default installation directory layout based on prefix path
17 +/opt/*) # AT&T SVR4, OSF/1 file system layout defaults
18 +# prefix='/opt/<appname>'
19 +# exec_prefix='${prefix}'
20 +# bindir='${exec_prefix}/bin'
21 +# sbindir='${exec_prefix}/sbin'
22 + libexecdir='${exec_prefix}/lbin'
23 +# datadir='${prefix}/share'
24 + sysconfdir='/etc${prefix}'
25 + sharedstatedir='/var/share${prefix}'
26 + localstatedir='/var${prefix}'
27 +# libdir='${exec_prefix}/lib'
28 + includedir='${datadir}/include'
29 +# oldincludedir='/usr/include'
30 + infodir='${datadir}/info'
31 + mandir='${datadir}/man'
34 +*) # GNU, BSD file system directory layout defaults
36 +# exec_prefix='${prefix}'
37 +# bindir='${exec_prefix}/bin'
38 +# sbindir='${exec_prefix}/sbin'
39 +# libexecdir='${exec_prefix}/libexec'
40 +# datadir='${prefix}/share'
41 +# sysconfdir='${prefix}/etc'
42 +# sharedstatedir='${prefix}/com'
43 +# localstatedir='${prefix}/var'
44 +# libdir='${exec_prefix}/lib'
45 +# includedir='${prefix}/include'
46 +# oldincludedir='/usr/include'
47 +# infodir='${prefix}/info'
48 +# mandir='${prefix}/man'
51 diff -urN squid-2.5.STABLE1.org/contrib/rredir.c squid-2.5.STABLE1/contrib/rredir.c
52 --- squid-2.5.STABLE1.org/contrib/rredir.c Thu Jan 1 01:00:00 1970
53 +++ squid-2.5.STABLE1/contrib/rredir.c Sat Sep 14 18:54:47 1996
58 + * From: richard@hekkihek.hacom.nl (Richard Huveneers)
59 + * To: squid-users@nlanr.net
60 + * Subject: Save 15% on your bandwidth...
61 + * Date: 12 Sep 1996 21:21:55 GMT
62 + * ===========================================================================
64 + * I have downloaded the multi-megabyte files from Netscape and Microsoft
65 + * that our users like to download from every mirror in the world,
66 + * defeating the usual caching.
68 + * I put these files in a separate directory and installed a basic
69 + * redirector for Squid that checks if the file (so hostname and pathname
70 + * are disregarded) is present in this directory.
72 + * After a few days of testing (the redirector looks very stable) it looks
73 + * like this is saving us approx. 15% on our cache flow. Also, our own WWW
74 + * server has become more popular than ever :)
76 + * I'm sure this code will be useful to others too, so I've attached it at
77 + * the end of this message. Improvements, extensions etc. are welcome.
79 + * I'm going on holidays now, so I won't be able to respond to e-mail
86 + * rredir - redirect to local directory
88 + * version 0.1, 7 sep 1996
89 + * - initial version (Richard Huveneers <Richard.Huveneers@hekkihek.hacom.nl>)
97 +#define ACCESS_LOCAL_DIR "/var/lib/httpd/htdocs/local/rredir"
98 +#define REDIRECT_TO_URL "http://www.hacom.nl/local/rredir"
99 +#define BUFFER_SIZE (16*1024)
104 + char buf[BUFFER_SIZE];
108 + /* make standard output line buffered */
109 + if (setvbuf(stdout, NULL, _IOLBF, 0) != 0)
112 + /* speed up the access() calls below */
113 + if (chdir(ACCESS_LOCAL_DIR) == -1)
116 + /* scan standard input */
117 + while (fgets(buf, BUFFER_SIZE, stdin) != NULL) {
118 + /* check for too long urls */
119 + if (strchr(buf, '\n') == NULL) {
124 + goto dont_redirect;
126 + /* determine end of url */
127 + if ((s = strchr(buf, ' ')) == NULL)
128 + goto dont_redirect;
131 + /* determine first character of filename */
132 + if ((s = strrchr(buf, '/')) == NULL)
133 + goto dont_redirect;
136 + /* security: do not redirect to hidden files, the current
137 + * ** directory or the parent directory */
138 + if (*s == '.' || *s == '\0')
139 + goto dont_redirect;
141 + /* map filename to lower case */
142 + for (t = s; *t != '\0'; t++)
143 + *t = (char) tolower((int) *t);
145 + /* check for a local copy of this file */
146 + if (access(s, R_OK) == 0) {
147 + (void) printf("%s/%s\n", REDIRECT_TO_URL, s);
152 + (void) printf("\n");
157 diff -urN squid-2.5.STABLE1.org/contrib/rredir.pl squid-2.5.STABLE1/contrib/rredir.pl
158 --- squid-2.5.STABLE1.org/contrib/rredir.pl Thu Jan 1 01:00:00 1970
159 +++ squid-2.5.STABLE1/contrib/rredir.pl Wed Jul 16 22:31:48 1997
161 +#!/usr/bin/perl -T -w
165 +# Author: Peter Eisenhauer <pe@pipetronix.de>
166 +# First Version: 26. May 1997
168 +# Description: Direct all request to files who are in a local dir to
174 +# customization part
176 +# Local Domainame from which no redirects should be done
177 +$localdomain = 'pipetronix.de';
178 +# Local domainame qouted for regexps
179 +$regexlocaldomain = quotemeta($localdomain);
180 +# Path under which the scripts accesses the local dir (must end with /)
181 +$access_local_dir='/opt/utils/etc/httpd/htdocs/local-rredir/';
182 +# Information for the redirected URL (redirect_path must end with /)
183 +$redirect_scheme = 'http';
184 +$redirect_host = 'ws-server.pipetronix.de';
185 +$redirect_path = 'local-rredir/';
187 +# end of customization part
189 +# flush after every print
192 +# Process lines of the form 'URL ip-address/fqdn ident method'
193 +# See release notes of Squid 1.1 for details
195 + ($url, $addr, $fqdn, $ident, $method) = m:(\S*) (\S*)/(\S*) (\S*) (\S*):;
198 + $host = lc($url->host);
200 + # do not process hosts in local domain or unqualified hostnames
201 + if ( $host =~ /$regexlocaldomain/ || $host !~ /\./ ) {
205 + # just the file, without any host or path parts
206 + # and just in case: lowercase the file name, so you should make sure
207 + # all the files in the local dir are only lowercase !!
208 + $file = lc(basename($url->path));
210 + # look if in local dir, if yes redirect
211 + if ( $file && -r $access_local_dir . $file
212 + && $file ne '.' && $file ne '..' ) {
213 + $url->scheme($redirect_scheme);
214 + $url->host($redirect_host);
215 + $url->path($redirect_path . $file);
219 + print "$url $addr/$fqdn $ident $method\n"
221 diff -urN squid-2.5.STABLE1.org/contrib/squid.options squid-2.5.STABLE1/contrib/squid.options
222 --- squid-2.5.STABLE1.org/contrib/squid.options Thu Jan 1 01:00:00 1970
223 +++ squid-2.5.STABLE1/contrib/squid.options Fri Oct 11 01:30:40 1996
227 +# Squid Internet Object Cache configuration
228 +# AUTHOR: Markus Gyger
229 +# This is file /etc/rc.config.d/squid or /var/config/squid.options
231 +# SQUID: Set to 1 to enable Squid (HP-UX 10 only)
232 +# SQUID_OPTIONS: Options passed to Squid (e.g. "-f .../squid.conf")
233 +# SQUID_RESPAWN: Set to 1 to automatically restart squid after failure
238 diff -urN squid-2.5.STABLE1.org/contrib/squid.rc squid-2.5.STABLE1/contrib/squid.rc
239 --- squid-2.5.STABLE1.org/contrib/squid.rc Thu Jan 1 01:00:00 1970
240 +++ squid-2.5.STABLE1/contrib/squid.rc Fri Oct 11 01:30:40 1996
244 +# Squid Internet Object Cache startup
245 +# AUTHOR: Markus Gyger
246 +# This is squid's startup file /sbin/init.d/squid or /etc/init.d/squid
249 +PATH=/opt/squid/bin:/usr/sbin:/usr/bin:/sbin:/bin
256 + if [ -f /sbin/chkconfig ]
257 + then if /sbin/chkconfig squid
258 + then if [ -f /var/config/squid.options ]
259 + then . /var/config/squid.options
266 + elif [ -f /usr/sbin/rcmgr ]
267 + then SQUID=`/usr/sbin/rcmgr get SQUID 0`
268 + SQUID_OPTIONS=`/usr/sbin/rcmgr get SQUID_OPTIONS "-s"`
269 + SQUID_RESPAWN=`/usr/sbin/rcmgr get SQUID_RESPAWN 1`
272 + elif [ -f /etc/rc.config ]
273 + then . /etc/rc.config
281 + [ 1 = "${SQUID-}" ]
289 + while [ $fails -le 5 ]
290 + do start=`date +%d%H%M%S`
292 + then logger -t "$1" -p local4.notice \
293 + "respawn[$$]: Exiting due to shutdown"
296 + stop=`date +%d%H%M%S`
297 + time=`expr $stop - $start`
298 + [ "$time" -gt 10 ] && fails=0
299 + fails=`expr $fails + 1`
302 + logger -t "$1" -p local4.alert \
303 + "respawn[$$]: Exiting due to repeated, frequent failures"
310 + echo "Start Squid Internet Object Cache"
314 + echo "Stopping Squid Internet Object Cache"
318 + config || exit 2 # Squid not enabled
320 + if whence=`type squid 2>&1`
322 + if [ 0 = "${SQUID_RESPAWN-}" ]
323 + then squid ${SQUID_OPTIONS-} &
324 + else respawn squid ${SQUID_OPTIONS-} &
327 + else echo "ERROR: $whence" >&2
333 + config || exit 2 # Squid not enabled
335 + squid ${SQUID_OPTIONS-} -k shutdown || exit 1
338 +reconf*|rotate|int*|debug|check|kill)
341 + squid ${SQUID_OPTIONS-} -k "$1"
345 + echo "usage: $0 {start|stop|reconfigure|rotate|interrupt|debug|check|kill}" >&2
346 + echo " start start squid" >&2
347 + echo " stop clean shutdown" >&2
348 + echo " reconfigure reread configuration files" >&2
349 + echo " rotate rotate log files" >&2
350 + echo " interrupt quick clean shutdown " >&2
351 + echo " debug toggle debug logging" >&2
352 + echo " check check for running squid" >&2
353 + echo " kill terminate squid by brute force" >&2
359 +[ $? -eq 0 ] # only 0 and 1 exit values allowed
361 diff -urN squid-2.5.STABLE1.org/contrib/url-normalizer.pl squid-2.5.STABLE1/contrib/url-normalizer.pl
362 --- squid-2.5.STABLE1.org/contrib/url-normalizer.pl Thu Jan 1 01:00:00 1970
363 +++ squid-2.5.STABLE1/contrib/url-normalizer.pl Fri Dec 6 18:54:31 1996
365 +#!/usr/local/bin/perl -Tw
367 +# From: Markus Gyger <mgyger@itr.ch>
369 +# I'd like to see a redirector which "normalizes" URLs to have
370 +# a higher chance to get a hit. I didn't see such a redirector,
371 +# so I thought I would send my little attempt. However, I have
372 +# no real idea how much CPU time it needs using the LWP modules,
373 +# but it seems to work.
379 +$| = 1; # force a flush after every print on STDOUT
381 +my ($url, $addr, $fqdn, $ident, $method);
384 + ($url, $addr, $fqdn, $ident, $method) = m:(\S*) (\S*)/(\S*) (\S*) (\S*):;
387 + $url = url $url; # also removes default port number
388 + $url->host(lc $url->host); # map host name to lower case
389 + my $epath = $url->epath;
390 + $epath =~ s/%7e/~/ig; # unescape ~
391 + $epath =~ s/(%[\da-f]{2})/\U$1/ig; # capitalize escape digits
392 + if ($url->scheme =~ /^(http|ftp)$/) {
393 + $epath =~ s:/\./:/:g; # safe?
394 + $epath =~ s://:/:g; # safe?
396 + $url->epath($epath);
403 + print "$url $addr/$fqdn $ident $method\n"
408 + unless (URI::URL::implementor('cache_object')) {
409 + package cache_object;
410 + @cache_object::ISA = (URI::URL::implementor());
411 + URI::URL::implementor('cache_object', 'cache_object');
413 + sub default_port { 3128 }
416 diff -urN squid-2.5.STABLE1.org/contrib/user-agents.pl squid-2.5.STABLE1/contrib/user-agents.pl
417 --- squid-2.5.STABLE1.org/contrib/user-agents.pl Thu Jan 1 01:00:00 1970
418 +++ squid-2.5.STABLE1/contrib/user-agents.pl Fri Dec 6 18:28:56 1996
425 +require "getopts.pl";
428 +open (ACCESS, "/opt/Squid/logs/useragent.0");
431 + ($host, $timestamp, $agent) =
432 + /^(\S+) \[(.+)\] \"(.+)\"\s/;
433 + if ($agent ne '-') {
435 + $agent =~ tr/\// /;
436 + $agent =~ tr/\(/ /;
439 + next unless $seen{$agent}++;
441 + @inline=split(/ /, $agent);
442 + next unless $seen{$inline[0]}++;
448 +if (!$opt_L) {$opt_L=0}
450 +print "Summary of User-Agent Strings\n(greater than $opt_L percent)\n\n";
452 +foreach $browser (keys(%seen)) {
453 + $total=$total+$seen{$browser};
456 +foreach $browser (sort keys(%seen)) {
457 + $percent=$seen{$browser}/$total*100;
458 + if ($percent >= $opt_L) { write; }
461 +print "\n\nTotal entries in log = $total\n";
464 +@>>>>>>> :@##.####% : @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
465 +$seen{$browser}, $percent, $browser