267e3bb03d82b4f6cde98015ef29d6b30a8ba8ad
[privoxy.git] / doc / webserver / user-manual / configuration.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3
4 <html>
5 <head>
6   <title>Privoxy Configuration</title>
7   <meta name="GENERATOR" content=
8   "Modular DocBook HTML Stylesheet Version 1.79">
9   <link rel="HOME" title="Privoxy 3.0.25 User Manual" href="index.html">
10   <link rel="PREVIOUS" title="Starting Privoxy" href="startup.html">
11   <link rel="NEXT" title="The Main Configuration File" href="config.html">
12   <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
13   <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
14   <link rel="STYLESHEET" type="text/css" href="p_doc.css">
15 </head>
16
17 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink=
18 "#840084" alink="#0000FF">
19   <div class="NAVHEADER">
20     <table summary="Header navigation table" width="100%" border="0"
21     cellpadding="0" cellspacing="0">
22       <tr>
23         <th colspan="3" align="center">Privoxy 3.0.25 User Manual</th>
24       </tr>
25
26       <tr>
27         <td width="10%" align="left" valign="bottom"><a href="startup.html"
28         accesskey="P">Prev</a></td>
29
30         <td width="80%" align="center" valign="bottom"></td>
31
32         <td width="10%" align="right" valign="bottom"><a href="config.html"
33         accesskey="N">Next</a></td>
34       </tr>
35     </table>
36     <hr align="left" width="100%">
37   </div>
38
39   <div class="SECT1">
40     <h1 class="SECT1"><a name="CONFIGURATION" id="CONFIGURATION">6. Privoxy
41     Configuration</a></h1>
42
43     <p>All <span class="APPLICATION">Privoxy</span> configuration is stored
44     in text files. These files can be edited with a text editor. Many
45     important aspects of <span class="APPLICATION">Privoxy</span> can also be
46     controlled easily with a web browser.</p>
47
48     <div class="SECT2">
49       <h2 class="SECT2"><a name="CONTROL-WITH-WEBBROWSER" id=
50       "CONTROL-WITH-WEBBROWSER">6.1. Controlling Privoxy with Your Web
51       Browser</a></h2>
52
53       <p><span class="APPLICATION">Privoxy</span>'s user interface can be
54       reached through the special URL <a href="http://config.privoxy.org/"
55       target="_top">http://config.privoxy.org/</a> (shortcut: <a href=
56       "http://p.p/" target="_top">http://p.p/</a>), which is a built-in page
57       and works without Internet access. You will see the following
58       section:</p>
59
60       <table border="0" bgcolor="#E0E0E0" width="100%">
61         <tr>
62           <td>
63             <pre class="SCREEN">
64
65 </pre>
66
67             <h2 class="BRIDGEHEAD"><a name="AEN821" id=
68             "AEN821"></a>&nbsp;&nbsp;&nbsp;&nbsp;Privoxy Menu</h2>
69
70             <table border="0">
71               <tbody>
72                 <tr>
73                   <td>
74                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://config.privoxy.org/show-status"
75                   target="_top">View &amp; change the current
76                   configuration</a></td>
77                 </tr>
78
79                 <tr>
80                   <td>
81                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://config.privoxy.org/show-version"
82                   target="_top">View the source code version numbers</a></td>
83                 </tr>
84
85                 <tr>
86                   <td>
87                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://config.privoxy.org/show-request"
88                   target="_top">View the request headers.</a></td>
89                 </tr>
90
91                 <tr>
92                   <td>
93                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://config.privoxy.org/show-url-info"
94                   target="_top">Look up which actions apply to a URL and
95                   why</a></td>
96                 </tr>
97
98                 <tr>
99                   <td>
100                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://config.privoxy.org/toggle"
101                   target="_top">Toggle Privoxy on or off</a></td>
102                 </tr>
103
104                 <tr>
105                   <td>
106                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#9642;&nbsp;&nbsp;<a href="http://www.privoxy.org/3.0.25/user-manual/"
107                   target="_top">Documentation</a></td>
108                 </tr>
109               </tbody>
110             </table>
111           </td>
112         </tr>
113       </table>
114
115       <p>This should be self-explanatory. Note the first item leads to an
116       editor for the <a href="actions-file.html">actions files</a>, which is
117       where the ad, banner, cookie, and URL blocking magic is configured as
118       well as other advanced features of <span class=
119       "APPLICATION">Privoxy</span>. This is an easy way to adjust various
120       aspects of <span class="APPLICATION">Privoxy</span> configuration. The
121       actions file, and other configuration files, are explained in detail
122       below.</p>
123
124       <p><span class="QUOTE">"Toggle Privoxy On or Off"</span> is handy for
125       sites that might have problems with your current actions and filters.
126       You can in fact use it as a test to see whether it is <span class=
127       "APPLICATION">Privoxy</span> causing the problem or not. <span class=
128       "APPLICATION">Privoxy</span> continues to run as a proxy in this case,
129       but all manipulation is disabled, i.e. <span class=
130       "APPLICATION">Privoxy</span> acts like a normal forwarding proxy.</p>
131
132       <p>Note that several of the features described above are disabled by
133       default in <span class="APPLICATION">Privoxy</span> 3.0.7 beta and
134       later. Check the <a href="config.html" target="_top">configuration
135       file</a> to learn why and in which cases it's safe to enable them
136       again.</p>
137     </div>
138
139     <div class="SECT2">
140       <h2 class="SECT2"><a name="CONFOVERVIEW" id="CONFOVERVIEW">6.2.
141       Configuration Files Overview</a></h2>
142
143       <p>For Unix, *BSD and Linux, all configuration files are located in
144       <tt class="FILENAME">/etc/privoxy/</tt> by default. For MS Windows,
145       OS/2, and AmigaOS these are all in the same directory as the
146       <span class="APPLICATION">Privoxy</span> executable. The name and
147       number of configuration files has changed from previous versions, and
148       is subject to change as development progresses.</p>
149
150       <p>The installed defaults provide a reasonable starting point, though
151       some settings may be aggressive by some standards. For the time being,
152       the principle configuration files are:</p>
153
154       <ul>
155         <li>
156           <p>The <a href="config.html">main configuration file</a> is named
157           <tt class="FILENAME">config</tt> on Linux, Unix, BSD, OS/2, and
158           AmigaOS and <tt class="FILENAME">config.txt</tt> on Windows. This
159           is a required file.</p>
160         </li>
161
162         <li>
163           <p><tt class="FILENAME">match-all.action</tt> is used to define
164           which <span class="QUOTE">"actions"</span> relating to
165           banner-blocking, images, pop-ups, content modification, cookie
166           handling etc should be applied by default. It should be the first
167           actions file loaded.</p>
168
169           <p><tt class="FILENAME">default.action</tt> defines many exceptions
170           (both positive and negative) from the default set of actions that's
171           configured in <tt class="FILENAME">match-all.action</tt>. It should
172           be the second actions file loaded and shouldn't be edited by the
173           user.</p>
174
175           <p>Multiple actions files may be defined in <tt class=
176           "FILENAME">config</tt>. These are processed in the order they are
177           defined. Local customizations and locally preferred exceptions to
178           the default policies as defined in <tt class=
179           "FILENAME">match-all.action</tt> (which you will most probably want
180           to define sooner or later) are best applied in <tt class=
181           "FILENAME">user.action</tt>, where you can preserve them across
182           upgrades. The file isn't installed by all installers, but you can
183           easily create it yourself with a text editor.</p>
184
185           <p>There is also a web based editor that can be accessed from
186           <a href="http://config.privoxy.org/show-status" target=
187           "_top">http://config.privoxy.org/show-status</a> (Shortcut:
188           <a href="http://p.p/show-status" target=
189           "_top">http://p.p/show-status</a>) for the various actions
190           files.</p>
191         </li>
192
193         <li>
194           <p><span class="QUOTE">"Filter files"</span> (the <a href=
195           "filter-file.html">filter file</a>) can be used to re-write the raw
196           page content, including viewable text as well as embedded HTML and
197           JavaScript, and whatever else lurks on any given web page. The
198           filtering jobs are only pre-defined here; whether to apply them or
199           not is up to the actions files. <tt class=
200           "FILENAME">default.filter</tt> includes various filters made
201           available for use by the developers. Some are much more intrusive
202           than others, and all should be used with caution. You may define
203           additional filter files in <tt class="FILENAME">config</tt> as you
204           can with actions files. We suggest <tt class=
205           "FILENAME">user.filter</tt> for any locally defined filters or
206           customizations.</p>
207         </li>
208       </ul>
209
210       <p>The syntax of the configuration and filter files may change between
211       different Privoxy versions, unfortunately some enhancements cost
212       backwards compatibility.</p>
213
214       <p>All files use the <span class="QUOTE">"<tt class=
215       "LITERAL">#</tt>"</span> character to denote a comment (the rest of the
216       line will be ignored) and understand line continuation through placing
217       a backslash ("<tt class="LITERAL">\</tt>") as the very last character
218       in a line. If the <tt class="LITERAL">#</tt> is preceded by a
219       backslash, it looses its special function. Placing a <tt class=
220       "LITERAL">#</tt> in front of an otherwise valid configuration line to
221       prevent it from being interpreted is called "commenting out" that line.
222       Blank lines are ignored.</p>
223
224       <p>The actions files and filter files can use Perl style <a href=
225       "appendix.html#REGEX">regular expressions</a> for maximum
226       flexibility.</p>
227
228       <p>After making any changes, there is no need to restart <span class=
229       "APPLICATION">Privoxy</span> in order for the changes to take effect.
230       <span class="APPLICATION">Privoxy</span> detects such changes
231       automatically. Note, however, that it may take one or two additional
232       requests for the change to take effect. When changing the listening
233       address of <span class="APPLICATION">Privoxy</span>, these <span class=
234       "QUOTE">"wake up"</span> requests must obviously be sent to the
235       <span class="emphasis"><i class="EMPHASIS">old</i></span> listening
236       address.</p>
237
238       <p>While under development, the configuration content is subject to
239       change. The below documentation may not be accurate by the time you
240       read this. Also, what constitutes a <span class=
241       "QUOTE">"default"</span> setting, may change, so please check all your
242       configuration files on important issues.</p>
243     </div>
244   </div>
245
246   <div class="NAVFOOTER">
247     <hr align="left" width="100%">
248
249     <table summary="Footer navigation table" width="100%" border="0"
250     cellpadding="0" cellspacing="0">
251       <tr>
252         <td width="33%" align="left" valign="top"><a href="startup.html"
253         accesskey="P">Prev</a></td>
254
255         <td width="34%" align="center" valign="top"><a href="index.html"
256         accesskey="H">Home</a></td>
257
258         <td width="33%" align="right" valign="top"><a href="config.html"
259         accesskey="N">Next</a></td>
260       </tr>
261
262       <tr>
263         <td width="33%" align="left" valign="top">Starting Privoxy</td>
264
265         <td width="34%" align="center" valign="top">&nbsp;</td>
266
267         <td width="33%" align="right" valign="top">The Main Configuration
268         File</td>
269       </tr>
270     </table>
271   </div>
272 </body>
273 </html>