Updated, mostly the new config stuff.
[privoxy.git] / doc / webserver / user-manual / configuration.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Privoxy Configuration</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="Privoxy 3.0.7 User Manual"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="Starting Privoxy"
14 HREF="startup.html"><LINK
15 REL="NEXT"
16 TITLE="The Main Configuration File"
17 HREF="config.html"><LINK
18 REL="STYLESHEET"
19 TYPE="text/css"
20 HREF="../p_doc.css">
21 <LINK REL="STYLESHEET" TYPE="text/css" HREF="p_doc.css">
22 </head
23 ><BODY
24 CLASS="SECT1"
25 BGCOLOR="#EEEEEE"
26 TEXT="#000000"
27 LINK="#0000FF"
28 VLINK="#840084"
29 ALINK="#0000FF"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="3"
41 ALIGN="center"
42 >Privoxy 3.0.7 User Manual</TH
43 ></TR
44 ><TR
45 ><TD
46 WIDTH="10%"
47 ALIGN="left"
48 VALIGN="bottom"
49 ><A
50 HREF="startup.html"
51 ACCESSKEY="P"
52 >Prev</A
53 ></TD
54 ><TD
55 WIDTH="80%"
56 ALIGN="center"
57 VALIGN="bottom"
58 ></TD
59 ><TD
60 WIDTH="10%"
61 ALIGN="right"
62 VALIGN="bottom"
63 ><A
64 HREF="config.html"
65 ACCESSKEY="N"
66 >Next</A
67 ></TD
68 ></TR
69 ></TABLE
70 ><HR
71 ALIGN="LEFT"
72 WIDTH="100%"></DIV
73 ><DIV
74 CLASS="SECT1"
75 ><H1
76 CLASS="SECT1"
77 ><A
78 NAME="CONFIGURATION"
79 >6. Privoxy Configuration</A
80 ></H1
81 ><P
82 >  All <SPAN
83 CLASS="APPLICATION"
84 >Privoxy</SPAN
85 > configuration is stored  
86   in text files. These files can be edited with a text editor.
87   Many important aspects of <SPAN
88 CLASS="APPLICATION"
89 >Privoxy</SPAN
90 > can 
91   also be controlled easily with a web browser.
92  </P
93 ><DIV
94 CLASS="SECT2"
95 ><H2
96 CLASS="SECT2"
97 ><A
98 NAME="AEN733"
99 >6.1. Controlling Privoxy with Your Web Browser</A
100 ></H2
101 ><P
102 > <SPAN
103 CLASS="APPLICATION"
104 >Privoxy</SPAN
105 >'s user interface can be reached through the special 
106  URL <A
107 HREF="http://config.privoxy.org/"
108 TARGET="_top"
109 >http://config.privoxy.org/</A
110 >
111  (shortcut: <A
112 HREF="http://p.p/"
113 TARGET="_top"
114 >http://p.p/</A
115 >), 
116  which is a built-in page and works without Internet access.
117  You will see the following section:&#13;</P
118 ><TABLE
119 BORDER="0"
120 BGCOLOR="#E0E0E0"
121 WIDTH="100%"
122 ><TR
123 ><TD
124 ><PRE
125 CLASS="SCREEN"
126 > <H2
127 CLASS="BRIDGEHEAD"
128 ><A
129 NAME="AEN741"
130 ></A
131 >    Privoxy Menu</H2
132 ><P
133 ></P
134 ><TABLE
135 BORDER="0"
136 ><TBODY
137 ><TR
138 ><TD
139 >          &#9642;  <A
140 HREF="http://config.privoxy.org/show-status"
141 TARGET="_top"
142 >View &#38; change the current configuration</A
143 >
144  </TD
145 ></TR
146 ><TR
147 ><TD
148 >          &#9642;  <A
149 HREF="http://config.privoxy.org/show-version"
150 TARGET="_top"
151 >View the source code version numbers</A
152 >
153  </TD
154 ></TR
155 ><TR
156 ><TD
157 >          &#9642;  <A
158 HREF="http://config.privoxy.org/show-request"
159 TARGET="_top"
160 >View the request headers.</A
161 >
162  </TD
163 ></TR
164 ><TR
165 ><TD
166 >          &#9642;  <A
167 HREF="http://config.privoxy.org/show-url-info"
168 TARGET="_top"
169 >Look up which actions apply to a URL and why</A
170 >
171  </TD
172 ></TR
173 ><TR
174 ><TD
175 >          &#9642;  <A
176 HREF="http://config.privoxy.org/toggle"
177 TARGET="_top"
178 >Toggle Privoxy on or off</A
179 >
180  </TD
181 ></TR
182 ><TR
183 ><TD
184 >          &#9642;  <A
185 HREF="http://www.privoxy.org/   3.0.7/user-manual/"
186 TARGET="_top"
187 >Documentation</A
188 >
189  </TD
190 ></TR
191 ></TBODY
192 ></TABLE
193 ><P
194 ></P
195 ></PRE
196 ></TD
197 ></TR
198 ></TABLE
199 ><P
200 > This should be self-explanatory. Note the first item leads to an editor for the
201  <A
202 HREF="actions-file.html"
203 >actions files</A
204 >, which is where the ad, banner,
205  cookie, and URL blocking magic is configured as well as other advanced features of
206  <SPAN
207 CLASS="APPLICATION"
208 >Privoxy</SPAN
209 >. This is an easy way to adjust various
210  aspects of <SPAN
211 CLASS="APPLICATION"
212 >Privoxy</SPAN
213 > configuration. The actions
214  file, and other configuration files, are explained in detail below. </P
215 ><P
216 > <SPAN
217 CLASS="QUOTE"
218 >"Toggle Privoxy On or Off"</SPAN
219 > is handy for sites that might 
220  have problems with your current actions and filters. You can in fact use
221  it as a test to see whether it is <SPAN
222 CLASS="APPLICATION"
223 >Privoxy</SPAN
224
225  causing the problem or not. <SPAN
226 CLASS="APPLICATION"
227 >Privoxy</SPAN
228 > continues 
229  to run as a proxy in this case, but all manipulation is disabled, i.e.
230  <SPAN
231 CLASS="APPLICATION"
232 >Privoxy</SPAN
233 > acts like a normal forwarding proxy. There
234  is even a toggle <A
235 HREF="appendix.html#BOOKMARKLETS"
236 >Bookmarklet</A
237 > offered, so
238  that you can toggle <SPAN
239 CLASS="APPLICATION"
240 >Privoxy</SPAN
241 > with one click from
242  your browser.</P
243 ></DIV
244 ><DIV
245 CLASS="SECT2"
246 ><H2
247 CLASS="SECT2"
248 ><A
249 NAME="CONFOVERVIEW"
250 >6.2. Configuration Files Overview</A
251 ></H2
252 ><P
253 > For Unix, *BSD and Linux, all configuration files are located in
254  <TT
255 CLASS="FILENAME"
256 >/etc/privoxy/</TT
257 > by default. For MS Windows, OS/2, and
258  AmigaOS these are all in the same directory as the 
259  <SPAN
260 CLASS="APPLICATION"
261 >Privoxy</SPAN
262 > executable.  The name
263  and number of configuration files has changed from previous versions, and is
264  subject to change as development progresses.</P
265 ><P
266 > The installed defaults provide a reasonable starting point, though 
267  some settings may be aggressive by some standards. For the time being, the
268  principle configuration files are:</P
269 ><P
270 > <P
271 ></P
272 ><UL
273 ><LI
274 ><P
275 >     The <A
276 HREF="config.html"
277 >main configuration file</A
278 > is named <TT
279 CLASS="FILENAME"
280 >config</TT
281 >
282      on Linux, Unix, BSD, OS/2, and AmigaOS and <TT
283 CLASS="FILENAME"
284 >config.txt</TT
285 >
286      on Windows. This is a required file.
287    </P
288 ></LI
289 ><LI
290 ><P
291 >    <TT
292 CLASS="FILENAME"
293 >default.action</TT
294 > (the main <A
295 HREF="actions-file.html"
296 >actions file</A
297 >)
298     is used to define which <SPAN
299 CLASS="QUOTE"
300 >"actions"</SPAN
301 > relating to banner-blocking, images, pop-ups,
302     content modification, cookie handling etc should be applied by default. It also defines many
303     exceptions (both positive and negative) from this default set of actions that enable 
304     <SPAN
305 CLASS="APPLICATION"
306 >Privoxy</SPAN
307 > to selectively eliminate the junk, and only the junk, on
308     as many websites as possible.
309    </P
310 ><P
311 >    Multiple actions files may be defined in <TT
312 CLASS="FILENAME"
313 >config</TT
314 >. These 
315     are processed in the order they are defined. Local customizations and locally 
316     preferred exceptions to the default policies  as defined in
317     <TT
318 CLASS="FILENAME"
319 >default.action</TT
320 > (which you will most probably want
321     to define sooner or later) are probably best applied in
322     <TT
323 CLASS="FILENAME"
324 >user.action</TT
325 >, where you can preserve them across
326     upgrades. <TT
327 CLASS="FILENAME"
328 >standard.action</TT
329 > is only for
330     <SPAN
331 CLASS="APPLICATION"
332 >Privoxy's</SPAN
333 > internal use.
334    </P
335 ><P
336 >    
337     There is also a web based editor that can be accessed from
338     <A
339 HREF="http://config.privoxy.org/show-status"
340 TARGET="_top"
341 >http://config.privoxy.org/show-status</A
342 >
343     (Shortcut: <A
344 HREF="http://p.p/show-status"
345 TARGET="_top"
346 >http://p.p/show-status</A
347 >) for the
348     various actions files. 
349    </P
350 ></LI
351 ><LI
352 ><P
353 >    <SPAN
354 CLASS="QUOTE"
355 >"Filter files"</SPAN
356 > (the <A
357 HREF="filter-file.html"
358 >filter
359     file</A
360 >) can be used to re-write the raw page content, including
361     viewable text as well as embedded HTML and JavaScript, and whatever else
362     lurks on any given web page. The filtering jobs are only pre-defined here;
363     whether to apply them or not is up to the actions files. 
364     <TT
365 CLASS="FILENAME"
366 >default.filter</TT
367 > includes various filters made 
368     available for use by the developers. Some are much more intrusive than 
369     others, and all should be used with caution. You may define additional 
370     filter files in <TT
371 CLASS="FILENAME"
372 >config</TT
373 > as you can with 
374     actions files. We suggest <TT
375 CLASS="FILENAME"
376 >user.filter</TT
377 > for any 
378     locally defined filters or customizations.
379    </P
380 ></LI
381 ></UL
382 ></P
383 ><P
384 > The syntax of the configuration and filter files may change between different
385  Privoxy versions, unfortunately some enhancements cost backwards compatibility.
386  </P
387 ><P
388 > All files use the <SPAN
389 CLASS="QUOTE"
390 >"<TT
391 CLASS="LITERAL"
392 >#</TT
393 >"</SPAN
394 > character to denote a
395  comment (the rest of the line will be ignored) and understand line continuation
396  through placing a backslash ("<TT
397 CLASS="LITERAL"
398 >\</TT
399 >") as the very last character
400  in a line. If the <TT
401 CLASS="LITERAL"
402 >#</TT
403 > is preceded by a backslash, it looses
404  its special function. Placing a <TT
405 CLASS="LITERAL"
406 >#</TT
407 > in front of an otherwise
408  valid configuration line to prevent it from being interpreted is called "commenting
409  out" that line. Blank lines are ignored.</P
410 ><P
411 > The actions files and filter files  
412  can use Perl style <A
413 HREF="appendix.html#REGEX"
414 >regular expressions</A
415 > for
416  maximum flexibility. </P
417 ><P
418 > After making any changes, there is no need to restart
419  <SPAN
420 CLASS="APPLICATION"
421 >Privoxy</SPAN
422 > in order for the changes to take
423  effect. <SPAN
424 CLASS="APPLICATION"
425 >Privoxy</SPAN
426 > detects such changes 
427  automatically. Note, however, that it may take one or two additional
428  requests for the change to take effect. When changing the listening address
429  of <SPAN
430 CLASS="APPLICATION"
431 >Privoxy</SPAN
432 >, these <SPAN
433 CLASS="QUOTE"
434 >"wake up"</SPAN
435 > requests
436  must obviously be sent to the <SPAN
437 CLASS="emphasis"
438 ><I
439 CLASS="EMPHASIS"
440 >old</I
441 ></SPAN
442 > listening address.</P
443 ><P
444 > While under development, the configuration content is subject to change. 
445  The below documentation may not be accurate by the time you read this. 
446  Also, what constitutes a <SPAN
447 CLASS="QUOTE"
448 >"default"</SPAN
449 > setting, may change, so 
450  please check all your configuration files on important issues.</P
451 ></DIV
452 ></DIV
453 ><DIV
454 CLASS="NAVFOOTER"
455 ><HR
456 ALIGN="LEFT"
457 WIDTH="100%"><TABLE
458 SUMMARY="Footer navigation table"
459 WIDTH="100%"
460 BORDER="0"
461 CELLPADDING="0"
462 CELLSPACING="0"
463 ><TR
464 ><TD
465 WIDTH="33%"
466 ALIGN="left"
467 VALIGN="top"
468 ><A
469 HREF="startup.html"
470 ACCESSKEY="P"
471 >Prev</A
472 ></TD
473 ><TD
474 WIDTH="34%"
475 ALIGN="center"
476 VALIGN="top"
477 ><A
478 HREF="index.html"
479 ACCESSKEY="H"
480 >Home</A
481 ></TD
482 ><TD
483 WIDTH="33%"
484 ALIGN="right"
485 VALIGN="top"
486 ><A
487 HREF="config.html"
488 ACCESSKEY="N"
489 >Next</A
490 ></TD
491 ></TR
492 ><TR
493 ><TD
494 WIDTH="33%"
495 ALIGN="left"
496 VALIGN="top"
497 >Starting Privoxy</TD
498 ><TD
499 WIDTH="34%"
500 ALIGN="center"
501 VALIGN="top"
502 >&nbsp;</TD
503 ><TD
504 WIDTH="33%"
505 ALIGN="right"
506 VALIGN="top"
507 >The Main Configuration File</TD
508 ></TR
509 ></TABLE
510 ></DIV
511 ></BODY
512 ></HTML
513 >