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