#
# Makefile for the Squid Object Cache server
#
-# $Id: Makefile.am,v 1.3 2003/01/23 00:34:53 robertc Exp $
+# $Id: Makefile.am,v 1.4 2005/04/30 15:30:57 serassio Exp $
#
# Uncomment and customize the following to suit your needs:
#
+DEFAULT_CONFIG_FILE = $(sysconfdir)/squid.conf
+DEFAULT_CACHEMGR_CONFIG = $(sysconfdir)/cachemgr.conf
+DEFAULT_MIME_TABLE = $(sysconfdir)/mime.conf
+DEFAULT_ERROR_DIR = $(datadir)/errors/@ERR_DEFAULT_LANGUAGE@
+
+SUBSTITUTE=sed "\
+ s%@DEFAULT_CONFIG_FILE@%$(DEFAULT_CONFIG_FILE)%g;\
+ s%@DEFAULT_CACHEMGR_CONFIG@%$(DEFAULT_CACHEMGR_CONFIG)%g;\
+ s%@DEFAULT_ERROR_DIR@%$(DEFAULT_ERROR_DIR)%g;\
+ s%@DEFAULT_MIME_TABLE@%$(DEFAULT_MIME_TABLE)%g;\
+ "
+
+squid.8: squid.8.in Makefile
+ $(SUBSTITUTE) < $< > $@
+
+cachemgr.cgi.8: cachemgr.cgi.8.in Makefile
+ $(SUBSTITUTE) < $< > $@
+
man_MANS = \
- squid.8
+ squid.8 \
+ cachemgr.cgi.8
EXTRA_DIST = \
- squid.8 \
+ squid.8.in \
+ cachemgr.cgi.8.in \
debug-sections.txt
+
+CLEANFILES = \
+ squid.8 \
+ cachemgr.cgi.8
--- /dev/null
+.TH cachemgr.cgi 8 "squid version 3.0"
+.\" Copyright and licensing information
+.\" goes here.
+.SH NAME
+cachemgr.cgi \- squid HTTP proxy manager interface
+.SH SYNOPSIS
+.B http://your.server/cgi-bin/cachemgr.cgi
+.SH DESCRIPTION
+The cache manager (cachemgr.cgi) is a CGI utility for displaying statistics
+about the Squid HTTP proxy process as it runs. The cache manager is a
+convenient way to manage the cache and view statistics without logging
+into the server.
+.SH FILES
+.I ./cachemgr.conf
+.br
+.I @DEFAULT_CACHEMGR_CONFIG@
+.RS
+The access configuration file defining which Squid servers may
+be managed via this cachemgr.cgi program. Each line specifies a
+.BR server : port
+followed by an optional description
+.P
+The server name may contain shell wildcard characters such as *, [] etc.
+A quick selection dropdown menu is automatically constructed from the simple
+server names.
+.P
+Specifying :port is optional. If not specified then
+the default proxy port is assumed. :* or :any matches
+any port on the target server.
+.RE
+.SH SECURITY
+cachemgr.cgi calls the requested server on the requested port using HTTP
+and returns a formatted version of the response. To avoid abuse it is
+recommended to configure your web server to restrict access to the
+cachemgr.cgi program.
+.P
+Configuration examples for many common web servers can be found in the
+Squid FAQ.
+.SH SEE ALSO
+.BR squid "(8)"
+.br
+.BR "The Squid FAQ" ", Chapter 9 The Cache Manager"
+.\" Could add the following sections:
+.\" .SH ENVIRONMENT
+.\" .SH DIAGNOSTICS
+.\" .SH BUGS
+.\" .SH AUTHOR
+.\" .SH SEE ALSO
+
.SH SYNOPSIS
.B squid
[
-.B \-dhvzCDFNRVYX
+.B \-dhsvzCDFNRVYX
] [
-.B \-s
-|
.BI \-l " facility"
] [
.BI \-f " config-file"
on how to configure
.B squid
see the file
-.BI /etc/squid/squid.conf,
-the FAQ included with the distribution
-and the documentation at the
+.BI @DEFAULT_CONFIG_FILE@,
+the Squid FAQ and the documentation at the
.B squid
home page http://www.squid-cache.org
.PP
Write debugging to stderr also.
.IP "-f file"
Use the given config-file instead of
-.IR /etc/squid/squid.conf .
+.IR @DEFAULT_CONFIG_FILE@ .
If the file name starts with a ! or | then it is assumed to be an external
command or command line. Can for example be used to pre-process the
configuration before it is being read by Squid. To facilitate this Squid
.IP "-k reconfigure | rotate | shutdown | interrupt | kill | debug | check | parse"
Parse configuration file, then send signal to running copy
(except -k parse) and exit.
-.IP "-s | -l facility"
+.IP -s
Enable logging to syslog.
+.IP "-l facility"
+Use specified syslog facility. implies -s
.IP "-u port"
Specify ICP port number (default: 3130), disable with 0.
.IP -v
.IP -Y
Only return UDP_HIT or UDP_MISS_NOFETCH during fast reload.
.SH FILES
-.I /etc/squid/squid.conf
+.I @DEFAULT_CONFIG_FILE@
.RS
The main configuration file. You must initially make
changes to this file for
.B squid
to work. For example, the default configuration does not
allow access from any browser.
+.RE
+
+.I @DEFAULT_CONFIG_FILE@.default
+.RS
+Reference copy of the configuration file. Always kept up to date with
+the version of Squid you are using. Use this to look up configuration
+syntax after upgrading.
+.RE
+
+.I @DEFAULT_MIME_TABLE@ (mime_table)
+.RS
+MIME type mappings for FTP gatewaying
+.RE
+
+.I @DEFAULT_ERROR_DIR@ (error_directory)
+.RS
+Error page templates
+.RE
+
+.SH SEE ALSO
+.BR cachemgr.cgi "(8), "
+.BR pam_auth "(8), "
+.BR squid_ldap_auth "(8), "
+.BR squid_ldap_group "(8), "
+.BR squid_unix_group "(8), "
+.br
+.B The Squid FAQ
+
+
.\" Could add the following sections:
.\" .SH ENVIRONMENT
/*
- * $Id: cachemgr.cc,v 1.109 2005/04/23 20:40:51 serassio Exp $
+ * $Id: cachemgr.cc,v 1.110 2005/04/30 15:30:57 serassio Exp $
*
* DEBUG: section 0 CGI Cache Manager
* AUTHOR: Duane Wessels
#include "snprintf.h"
#ifndef DEFAULT_CACHEMGR_CONFIG
-#define DEFAULT_CACHEMGR_CONFIG "/etc/squid/cahemgr.conf"
+#define DEFAULT_CACHEMGR_CONFIG "/etc/squid/cachemgr.conf"
#endif
typedef struct
if ((token = strtok(NULL, ":")) != NULL) {
int i;
- if (sscanf(token, "%d", &i) != 1)
+ if (strcmp(token, "*") == 0)
+
+ ; /* Wildcard port specification */
+ else if (strcasecmp(token, "any") == 0)
+
+ ; /* Wildcard port specification */
+ else if (sscanf(token, "%d", &i) != 1)
continue;
- if (i != port)
+ else if (i != port)
continue;
} else if (port != CACHE_HTTP_PORT)
continue;
# hostname:port description
#
# Specifying :port is optional. If not specified then
-# the default proxy port is assumed.
+# the default proxy port is assumed. :* or :any matches
+# any port on the target server.
#
# hostname is matched using shell filename matching, allowing
# * and other shell wildcards.