0778f6a5b3b0c7f6a8a7909d5d9987dc988163f6
[privoxy.git] / doc / webserver / user-manual / configuration.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Privoxy Configuration</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8 "><LINK
9 REL="HOME"
10 TITLE="Privoxy 3.0.6 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.6 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 ></A
80 >6. Privoxy Configuration</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="AEN841"
99 ></A
100 >6.1. Controlling Privoxy with Your Web Browser</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="AEN849"
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.6/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 ></A
251 >6.2. Configuration Files Overview</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. </P
263 ><P
264 > The installed defaults provide a reasonable starting point, though 
265  some settings may be aggressive by some standards. For the time being, the
266  principle configuration files are:</P
267 ><P
268 > <P
269 ></P
270 ><UL
271 ><LI
272 ><P
273 >     The <A
274 HREF="config.html"
275 >main configuration file</A
276 > is named <TT
277 CLASS="FILENAME"
278 >config</TT
279 >
280      on Linux, Unix, BSD, OS/2, and AmigaOS and <TT
281 CLASS="FILENAME"
282 >config.txt</TT
283 >
284      on Windows. This is a required file.
285    </P
286 ></LI
287 ><LI
288 ><P
289 >    <TT
290 CLASS="FILENAME"
291 >default.action</TT
292 > (the main <A
293 HREF="actions-file.html"
294 >actions file</A
295 >)
296     is used to define which <SPAN
297 CLASS="QUOTE"
298 >"actions"</SPAN
299 > relating to banner-blocking, images, pop-ups,
300     content modification, cookie handling etc should be applied by default. It also defines many
301     exceptions (both positive and negative) from this default set of actions that enable 
302     <SPAN
303 CLASS="APPLICATION"
304 >Privoxy</SPAN
305 > to selectively eliminate the junk, and only the junk, on
306     as many websites as possible.
307    </P
308 ><P
309 >    Multiple actions files may be defined in <TT
310 CLASS="FILENAME"
311 >config</TT
312 >. These 
313     are processed in the order they are defined. Local customizations and locally 
314     preferred exceptions to the default policies  as defined in
315     <TT
316 CLASS="FILENAME"
317 >default.action</TT
318 > (which you will most probably want
319     to define sooner or later) are probably best applied in
320     <TT
321 CLASS="FILENAME"
322 >user.action</TT
323 >, where you can preserve them across
324     upgrades. <TT
325 CLASS="FILENAME"
326 >standard.action</TT
327 > is only for
328     <SPAN
329 CLASS="APPLICATION"
330 >Privoxy's</SPAN
331 > internal use.
332    </P
333 ><P
334 >    
335     There is also a web based editor that can be accessed from
336     <A
337 HREF="http://config.privoxy.org/show-status"
338 TARGET="_top"
339 >http://config.privoxy.org/show-status</A
340 >
341     (Shortcut: <A
342 HREF="http://p.p/show-status"
343 TARGET="_top"
344 >http://p.p/show-status</A
345 >) for the
346     various actions files. 
347    </P
348 ></LI
349 ><LI
350 ><P
351 >    <SPAN
352 CLASS="QUOTE"
353 >"Filter files"</SPAN
354 > (the <A
355 HREF="filter-file.html"
356 >filter
357     file</A
358 >) can be used to re-write the raw page content, including
359     viewable text as well as embedded HTML and JavaScript, and whatever else
360     lurks on any given web page. The filtering jobs are only pre-defined here;
361     whether to apply them or not is up to the actions files. 
362     <TT
363 CLASS="FILENAME"
364 >default.filter</TT
365 > includes various filters made 
366     available for use by the developers. Some are much more intrusive than 
367     others, and all should be used with caution. You may define additional 
368     filter files in <TT
369 CLASS="FILENAME"
370 >config</TT
371 > as you can with 
372     actions files. We suggest <TT
373 CLASS="FILENAME"
374 >user.filter</TT
375 > for any 
376     locally defined filters or customizations.
377    </P
378 ></LI
379 ></UL
380 ></P
381 ><P
382 > The syntax of all configuration files has remained the same throughout the
383  3.x series. There have been enhancements, but no changes that would preclude
384  the use of any configuration file from one version to the next. (There is 
385  one exception: <A
386 HREF="actions-file.html#FAST-REDIRECTS"
387 >+fast-redirects</A
388 > which 
389  has enhanced syntax and will require updating any local configs from earlier 
390  versions.)</P
391 ><P
392 > All files use the <SPAN
393 CLASS="QUOTE"
394 >"<TT
395 CLASS="LITERAL"
396 >#</TT
397 >"</SPAN
398 > character to denote a
399  comment (the rest of the line will be ignored) and understand line continuation
400  through placing a backslash ("<TT
401 CLASS="LITERAL"
402 >\</TT
403 >") as the very last character
404  in a line. If the <TT
405 CLASS="LITERAL"
406 >#</TT
407 > is preceded by a backslash, it looses
408  its special function. Placing a <TT
409 CLASS="LITERAL"
410 >#</TT
411 > in front of an otherwise
412  valid configuration line to prevent it from being interpreted is called "commenting
413  out" that line. Blank lines are ignored.</P
414 ><P
415 > The actions files and filter files  
416  can use Perl style <A
417 HREF="appendix.html#REGEX"
418 >regular expressions</A
419 > for
420  maximum flexibility. </P
421 ><P
422 > After making any changes, there is no need to restart
423  <SPAN
424 CLASS="APPLICATION"
425 >Privoxy</SPAN
426 > in order for the changes to take
427  effect. <SPAN
428 CLASS="APPLICATION"
429 >Privoxy</SPAN
430 > detects such changes 
431  automatically. Note, however, that it may take one or two additional
432  requests for the change to take effect. When changing the listening address
433  of <SPAN
434 CLASS="APPLICATION"
435 >Privoxy</SPAN
436 >, these <SPAN
437 CLASS="QUOTE"
438 >"wake up"</SPAN
439 > requests
440  must obviously be sent to the <SPAN
441 CLASS="emphasis"
442 ><I
443 CLASS="EMPHASIS"
444 >old</I
445 ></SPAN
446 > listening address.</P
447 ></DIV
448 ></DIV
449 ><DIV
450 CLASS="NAVFOOTER"
451 ><HR
452 ALIGN="LEFT"
453 WIDTH="100%"><TABLE
454 SUMMARY="Footer navigation table"
455 WIDTH="100%"
456 BORDER="0"
457 CELLPADDING="0"
458 CELLSPACING="0"
459 ><TR
460 ><TD
461 WIDTH="33%"
462 ALIGN="left"
463 VALIGN="top"
464 ><A
465 HREF="startup.html"
466 ACCESSKEY="P"
467 >Prev</A
468 ></TD
469 ><TD
470 WIDTH="34%"
471 ALIGN="center"
472 VALIGN="top"
473 ><A
474 HREF="index.html"
475 ACCESSKEY="H"
476 >Home</A
477 ></TD
478 ><TD
479 WIDTH="33%"
480 ALIGN="right"
481 VALIGN="top"
482 ><A
483 HREF="config.html"
484 ACCESSKEY="N"
485 >Next</A
486 ></TD
487 ></TR
488 ><TR
489 ><TD
490 WIDTH="33%"
491 ALIGN="left"
492 VALIGN="top"
493 >Starting Privoxy</TD
494 ><TD
495 WIDTH="34%"
496 ALIGN="center"
497 VALIGN="top"
498 >&nbsp;</TD
499 ><TD
500 WIDTH="33%"
501 ALIGN="right"
502 VALIGN="top"
503 >The Main Configuration File</TD
504 ></TR
505 ></TABLE
506 ></DIV
507 ></BODY
508 ></HTML
509 >