Sync with source.
[privoxy.git] / doc / webserver / faq / configuration.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Configuration</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8 "><LINK
9 REL="HOME"
10 TITLE="Privoxy Frequently Asked Questions"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="Installation"
14 HREF="installation.html"><LINK
15 REL="NEXT"
16 TITLE="Miscellaneous"
17 HREF="misc.html"><LINK
18 REL="STYLESHEET"
19 TYPE="text/css"
20 HREF="../p_doc.css"></HEAD
21 ><BODY
22 CLASS="SECT1"
23 BGCOLOR="#EEEEEE"
24 TEXT="#000000"
25 LINK="#0000FF"
26 VLINK="#840084"
27 ALINK="#0000FF"
28 ><DIV
29 CLASS="NAVHEADER"
30 ><TABLE
31 WIDTH="100%"
32 BORDER="0"
33 CELLPADDING="0"
34 CELLSPACING="0"
35 ><TR
36 ><TH
37 COLSPAN="3"
38 ALIGN="center"
39 >Privoxy Frequently Asked Questions</TH
40 ></TR
41 ><TR
42 ><TD
43 WIDTH="10%"
44 ALIGN="left"
45 VALIGN="bottom"
46 ><A
47 HREF="installation.html"
48 >Prev</A
49 ></TD
50 ><TD
51 WIDTH="80%"
52 ALIGN="center"
53 VALIGN="bottom"
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="right"
58 VALIGN="bottom"
59 ><A
60 HREF="misc.html"
61 >Next</A
62 ></TD
63 ></TR
64 ></TABLE
65 ><HR
66 ALIGN="LEFT"
67 WIDTH="100%"></DIV
68 ><DIV
69 CLASS="SECT1"
70 ><H1
71 CLASS="SECT1"
72 ><A
73 NAME="CONFIGURATION"
74 >3. Configuration</A
75 ></H1
76 ><DIV
77 CLASS="SECT2"
78 ><H3
79 CLASS="SECT2"
80 ><A
81 NAME="NEWCONFIG"
82 >3.1. Can I use my old config files?</A
83 ></H3
84 ><P
85 >   There are major changes to <SPAN
86 CLASS="APPLICATION"
87 >Junkbuster</SPAN
88 >/ 
89    <SPAN
90 CLASS="APPLICATION"
91 >Privoxy</SPAN
92 > configuration from version 2.0.x to
93    2.9.x and later. Most of the older files will not work at all. This is 
94    especially true of <TT
95 CLASS="FILENAME"
96 >blocklist</TT
97 >. If this is the case, you
98    will need to re-enter your old data into the new configuration structure.
99    This is probably also a good recommendation even if upgrading from 2.9.x to
100    3.x since there were many minor changes along the way.
101  </P
102 ></DIV
103 ><DIV
104 CLASS="SECT2"
105 ><H3
106 CLASS="SECT2"
107 ><A
108 NAME="AEN237"
109 >3.2. What is an <SPAN
110 CLASS="QUOTE"
111 >"actions"</SPAN
112 > file?</A
113 ></H3
114 ><P
115 > <SPAN
116 CLASS="QUOTE"
117 >"actions"</SPAN
118 > files are where various actions that
119  <SPAN
120 CLASS="APPLICATION"
121 >Privoxy</SPAN
122 > might take, are configured. 
123  Typically, you would define a set of default actions that apply 
124  to all URLs, then add exceptions to these defaults where needed.</P
125 ><P
126 > Actions can be defined on a per site basis, or for groups of sites. Actions
127  can also be grouped together and then applied to one or more sites. There
128  are many possible actions that might apply to any given site. As an example,
129  if we are blocking cookies as one of our default
130  <SPAN
131 CLASS="APPLICATION"
132 >actions</SPAN
133 >, but need to accept cookies from a given
134  site, we would define this in our <SPAN
135 CLASS="QUOTE"
136 >"actions"</SPAN
137 > file.&#13;</P
138 ></DIV
139 ><DIV
140 CLASS="SECT2"
141 ><H3
142 CLASS="SECT2"
143 ><A
144 NAME="ACTIONSS"
145 >3.3. The <SPAN
146 CLASS="QUOTE"
147 >"actions"</SPAN
148 > concept confuses me. Please list 
149 some of these <SPAN
150 CLASS="QUOTE"
151 >"actions"</SPAN
152 >.</A
153 ></H3
154 ><P
155 > These are all explained in the 
156  <A
157 HREF="../user-manual/actions-file.html"
158 TARGET="_top"
159 >user-manual</A
160 >.
161  Please refer to that.</P
162 ></DIV
163 ><DIV
164 CLASS="SECT2"
165 ><H3
166 CLASS="SECT2"
167 ><A
168 NAME="AEN252"
169 >3.4. How are actions files configured? What is the easiest
170 way to do this?</A
171 ></H3
172 ><P
173 > The easiest way to do this, is to access <SPAN
174 CLASS="APPLICATION"
175 >Privoxy</SPAN
176 >
177  with your web browser at <A
178 HREF="http://p.p/"
179 TARGET="_top"
180 >http://p.p/</A
181 >, 
182  and then select 
183  "<A
184 HREF="http://config.privoxy.org"
185 TARGET="_top"
186 >View &#38; change the current configuration</A
187 >"
188  from the selection list. You can also do this by editing the appropriate 
189  file with a text editor.</P
190 ><P
191 > Please see the 
192  <A
193 HREF="../user-manual/actions-file.html"
194 TARGET="_top"
195 >user-manual</A
196 > for a
197  detailed explanation of these and other configuration files, and their
198  various options and syntax.</P
199 ></DIV
200 ><DIV
201 CLASS="SECT2"
202 ><H3
203 CLASS="SECT2"
204 ><A
205 NAME="AEN260"
206 >3.5. There are several different <SPAN
207 CLASS="QUOTE"
208 >"actions"</SPAN
209 > files. What are
210 the differences?</A
211 ></H3
212 ><P
213 > As of <SPAN
214 CLASS="APPLICATION"
215 >Privoxy</SPAN
216 > v2.9.15, three actions files 
217  are being included, to be used for 
218  different purposes. These are 
219  <TT
220 CLASS="FILENAME"
221 >default.action</TT
222 >, <TT
223 CLASS="FILENAME"
224 >standard.action</TT
225 >, 
226  and <TT
227 CLASS="FILENAME"
228 >user.action</TT
229 >. Please see 
230  <A
231 HREF="../user-manual/actions-file.html"
232 TARGET="_top"
233 >the User Manual</A
234
235  for an explanation of each.</P
236 ><P
237 > Earlier versions included three different versions
238  <TT
239 CLASS="FILENAME"
240 >default.action</TT
241 > files. The new scheme allows for 
242  greater flexibility of local configuration, and for browser based 
243  configuration.</P
244 ></DIV
245 ><DIV
246 CLASS="SECT2"
247 ><H3
248 CLASS="SECT2"
249 ><A
250 NAME="BROWSECONFIG"
251 >3.6. Why can I change the configuration with a
252 browser? Does that not raise security issues?</A
253 ></H3
254 ><P
255 >What I don't understand, is how I can browser edit the config file as a
256 regular user, while the whole <TT
257 CLASS="FILENAME"
258 >/etc/privoxy</TT
259 > hierarchy
260 belongs to the user <SPAN
261 CLASS="QUOTE"
262 >"privoxy"</SPAN
263 >, with only 644 permissions.
264  </P
265 ><P
266 >When you use the browser-based editor, <SPAN
267 CLASS="APPLICATION"
268 >Privoxy</SPAN
269 >
270 itself is writing to the config files.  Because
271 <SPAN
272 CLASS="APPLICATION"
273 >Privoxy</SPAN
274 > is running as the user <SPAN
275 CLASS="QUOTE"
276 >"privoxy"</SPAN
277 >, it can
278 update the config files.
279  </P
280 ><P
281 >If you don't like this, setting <SPAN
282 CLASS="QUOTE"
283 >"enable-edit-actions 0"</SPAN
284 > in the
285 config file will disable the browser-based editor.  If you're that paranoid,
286 you should also consider setting <SPAN
287 CLASS="QUOTE"
288 >"enable-remote-toggle 0"</SPAN
289 > to prevent
290 browser-based enabling/disabling of <SPAN
291 CLASS="APPLICATION"
292 >Privoxy</SPAN
293 >.
294  </P
295 ><P
296 >Note that normally only local users can connect to
297 <SPAN
298 CLASS="APPLICATION"
299 >Privoxy</SPAN
300 >, so this is not (normally) a security
301 problem.
302  </P
303 ></DIV
304 ><DIV
305 CLASS="SECT2"
306 ><H3
307 CLASS="SECT2"
308 ><A
309 NAME="AEN286"
310 >3.7. What is <SPAN
311 CLASS="QUOTE"
312 >"default.filter"</SPAN
313 >?</A
314 ></H3
315 ><P
316 > The <SPAN
317 CLASS="QUOTE"
318 >"default.filter"</SPAN
319 > file is where <SPAN
320 CLASS="QUOTE"
321 >"filters"</SPAN
322 >
323  are defined, which are used to <SPAN
324 CLASS="QUOTE"
325 >"filter"</SPAN
326 > any
327  web page content. By <SPAN
328 CLASS="QUOTE"
329 >"filtering"</SPAN
330 > we mean it can modify, remove, 
331  or change <I
332 CLASS="EMPHASIS"
333 >anything</I
334 > on the page, including HTML tags, and
335  JavaScript. Regular expressions are used to accomplish this, and operate 
336  on a line by line basis. This is potentially a very powerful feature, but
337  requires some expertise. </P
338 ><P
339 > If you are familiar with regular expressions, and HTML, you can look at 
340  the provided <TT
341 CLASS="FILENAME"
342 >default.filter</TT
343 > with a text editor and see
344  some of things it can be used for.</P
345 ><P
346 > Presently, there is no GUI editor option for this part of the configuration, 
347  but you can disable/enable various sections of the included default 
348  file with the <SPAN
349 CLASS="QUOTE"
350 >"View &#38; change the current configuration"</SPAN
351 > from
352  your browser. </P
353 ></DIV
354 ><DIV
355 CLASS="SECT2"
356 ><H3
357 CLASS="SECT2"
358 ><A
359 NAME="AEN299"
360 >3.8. How can I set up <SPAN
361 CLASS="APPLICATION"
362 >Privoxy</SPAN
363 > to act as a proxy for my 
364  LAN?</A
365 ></H3
366 ><P
367 > By default, <SPAN
368 CLASS="APPLICATION"
369 >Privoxy</SPAN
370 > only responds to requests 
371  from localhost. To have it act as a server for a network, this needs to be 
372  changed in the main config file where the <SPAN
373 CLASS="APPLICATION"
374 >Privoxy</SPAN
375 >
376  configuration is located. In that file is a <SPAN
377 CLASS="QUOTE"
378 >"listen-address"</SPAN
379
380  option. It may be commented out with a <SPAN
381 CLASS="QUOTE"
382 >"#"</SPAN
383 > symbol. Make sure 
384  it is uncommented, and assign it the address of the LAN gateway interface, 
385  and port number to use:</P
386 ><P
387 > <TABLE
388 BORDER="0"
389 BGCOLOR="#E0E0E0"
390 WIDTH="100%"
391 ><TR
392 ><TD
393 ><PRE
394 CLASS="SCREEN"
395 >  listen-address  192.168.1.1:8118</PRE
396 ></TD
397 ></TR
398 ></TABLE
399 ></P
400 ><P
401 > Save the file, and restart <SPAN
402 CLASS="APPLICATION"
403 >Privoxy</SPAN
404 >. Configure 
405  all browsers on the network then to use this address and port number.</P
406 ></DIV
407 ><DIV
408 CLASS="SECT2"
409 ><H3
410 CLASS="SECT2"
411 ><A
412 NAME="AEN311"
413 >3.9. Instead of ads, now I get a checkerboard pattern. I don't want to see anything.</A
414 ></H3
415 ><P
416 > This is a configuration option for images that
417  <SPAN
418 CLASS="APPLICATION"
419 >Privoxy</SPAN
420 > is stopping. You have the choice of a
421  checkerboard pattern, a transparent 1x1 GIF image (aka <SPAN
422 CLASS="QUOTE"
423 >"blank"</SPAN
424 >),
425  or a custom URL of your choice. Note that to fit this category, the URL must
426  match both the <A
427 HREF="../user-manual/actions-file.html#HANDLE-AS-IMAGE"
428 TARGET="_top"
429 ><SPAN
430 CLASS="QUOTE"
431 >"+handle-as-image"</SPAN
432 ></A
433 >
434  <I
435 CLASS="EMPHASIS"
436 >and</I
437
438  <A
439 HREF="../user-manual/actions-file.html#BLOCK"
440 TARGET="_top"
441 ><SPAN
442 CLASS="QUOTE"
443 >"+block"</SPAN
444 ></A
445 > actions.</P
446 ><P
447 > If you want to see nothing, then change the 
448  <A
449 HREF="../user-manual/actions-file.html#SET-IMAGE-BLOCKER"
450 TARGET="_top"
451 ><SPAN
452 CLASS="QUOTE"
453 >"+set-image-blocker"</SPAN
454 ></A
455 >
456  action to <SPAN
457 CLASS="QUOTE"
458 >"+image-blocker{blank}"</SPAN
459 >. This can be done from the 
460  <SPAN
461 CLASS="QUOTE"
462 >"View &#38; change the current configuration"</SPAN
463 > selection at <A
464 HREF="http://p.p/"
465 TARGET="_top"
466 >http://p.p/</A
467 >. Or by hand editing the appropriate 
468  actions file. This will only effect what is defined as <SPAN
469 CLASS="QUOTE"
470 >"images"</SPAN
471 >
472  though. Also, some URLs that generate the bright red <SPAN
473 CLASS="QUOTE"
474 >"Blocked"</SPAN
475 >
476  banner, can be moved to the <SPAN
477 CLASS="QUOTE"
478 >"+set-image-blocker"</SPAN
479 > section for the
480  same reason, but there are some limits and risks to this (see below).</P
481 ></DIV
482 ><DIV
483 CLASS="SECT2"
484 ><H3
485 CLASS="SECT2"
486 ><A
487 NAME="AEN330"
488 >3.10. Why would anybody want to see a checkerboard pattern?</A
489 ></H3
490 ><P
491 > This can be helpful for troubleshooting problems. It might also be good 
492  for anyone new to <SPAN
493 CLASS="APPLICATION"
494 >Privoxy</SPAN
495 > so that they can 
496  see if their favorite pages are displaying correctly, and
497  <SPAN
498 CLASS="APPLICATION"
499 >Privoxy</SPAN
500 > is not inadvertently removing something 
501  important.</P
502 ></DIV
503 ><DIV
504 CLASS="SECT2"
505 ><H3
506 CLASS="SECT2"
507 ><A
508 NAME="AEN335"
509 >3.11. I see large red banners on some pages that say 
510 <SPAN
511 CLASS="QUOTE"
512 >"Blocked"</SPAN
513 >. Why and how do I get rid of this?</A
514 ></H3
515 ><P
516 > These are URLs that match something in one of 
517  <SPAN
518 CLASS="APPLICATION"
519 >Privoxy's</SPAN
520 > block actions 
521  (<A
522 HREF="../user-manual/actions-file.html#BLOCK"
523 TARGET="_top"
524 ><SPAN
525 CLASS="QUOTE"
526 >"+block"</SPAN
527 ></A
528 >).
529  It is meant to be a warning so that you know something has been blocked and
530  an easy way for you to see why. These are handled differently than what has
531  been defined explicitly as <SPAN
532 CLASS="QUOTE"
533 >"images"</SPAN
534 > (e.g. ads that are GIF image
535  files). Depending on the URL itself, it is sometimes hard for
536  <SPAN
537 CLASS="APPLICATION"
538 >Privoxy</SPAN
539 > to really know whether there is indeed an
540  ad image there or not. And there are limitations as to what
541  <SPAN
542 CLASS="APPLICATION"
543 >Privoxy</SPAN
544 > can do to <SPAN
545 CLASS="QUOTE"
546 >"fool"</SPAN
547 > the
548  browser.</P
549 ><P
550 > For instance, if the ad is in a frame, then it is embedded in the separate
551  HTML page used for the frame. In this case, you cannot just substitute an
552  aribitrary image (like we would for a <SPAN
553 CLASS="QUOTE"
554 >"blank"</SPAN
555 > image), for an HTML
556  page. The browser is expecting an HTML page, and that is what it must have
557  for frames. Such situations can be a little trickier to deal with, and 
558  <SPAN
559 CLASS="APPLICATION"
560 >Privoxy</SPAN
561 > may show the <SPAN
562 CLASS="QUOTE"
563 >"Blocked"</SPAN
564 > page,
565  despite your best efforts.</P
566 ><P
567 > If you want these to be treated as if they were images, so that they can be
568  made invisible, you can try moving the offending URL from the
569  <SPAN
570 CLASS="QUOTE"
571 >"+block"</SPAN
572 > section to the <SPAN
573 CLASS="QUOTE"
574 >"+imageblock"</SPAN
575 > section of
576  your actions file. Just be forewarned, if any URL is made
577  <SPAN
578 CLASS="QUOTE"
579 >"invisible"</SPAN
580 >, you may not have any inkling that something has
581  been removed from that page, or why. If this approach does not work, then you are
582  probably dealing with a frame (or <SPAN
583 CLASS="QUOTE"
584 >"ilayer"</SPAN
585 >), and the only thing
586  that can go there is an HTML page of some sort.</P
587 ><P
588 > To deal with this situation, you could modify the
589  <SPAN
590 CLASS="QUOTE"
591 >"<TT
592 CLASS="FILENAME"
593 >block</TT
594 >"</SPAN
595 > HTML template that is used by
596  <SPAN
597 CLASS="APPLICATION"
598 >Privoxy</SPAN
599 > to display this, and make it something
600  more to your liking. Currently, there is no configuration option for this.
601  You will have to modify, or create your own page, and use this to replace
602  <TT
603 CLASS="FILENAME"
604 >templates/blocked</TT
605 >, which is what
606  <SPAN
607 CLASS="APPLICATION"
608 >Privoxy</SPAN
609 > uses to display the <SPAN
610 CLASS="QUOTE"
611 >"Blocked"</SPAN
612 >
613  page.</P
614 ><P
615 > Another way to deal with this is find why and where
616  <SPAN
617 CLASS="APPLICATION"
618 >Privoxy</SPAN
619 > is blocking the frame, and 
620  diable this. Then let the <SPAN
621 CLASS="QUOTE"
622 >"+set-image-blocker"</SPAN
623 > action 
624  handle the ad that is embedded in the frame's HTML page. </P
625 ></DIV
626 ><DIV
627 CLASS="SECT2"
628 ><H3
629 CLASS="SECT2"
630 ><A
631 NAME="ALLISEEISRED"
632 >3.12. I cannot see all of the <SPAN
633 CLASS="QUOTE"
634 >"Blocked"</SPAN
635 > page banner. Help.</A
636 ></H3
637 ><P
638 > There is not enough available space to fit the entire Blocked page. Try right
639  clicking on the visible portion, and select <SPAN
640 CLASS="QUOTE"
641 >"Show Frame"</SPAN
642 >,
643  or equivalent. This will usually allow you to see the entire Privoxy
644  <SPAN
645 CLASS="QUOTE"
646 >"Blocked"</SPAN
647 > page, and from there you can see just what is being
648  blocked, and why.</P
649 ><P
650 > As of Privoxy 2.9.14, the Blocked banner page is re-sizeable, and tries
651  to adjust to the allotted space. There may be occassions where there 
652  just isn't enough room to display much of anything useful though. &#13;</P
653 ></DIV
654 ><DIV
655 CLASS="SECT2"
656 ><H3
657 CLASS="SECT2"
658 ><A
659 NAME="SRVANY"
660 >3.13. Can <SPAN
661 CLASS="APPLICATION"
662 >Privoxy</SPAN
663 > run as a service 
664 on Win2K/NT?</A
665 ></H3
666 ><P
667 > Yes, it can run as a system service using <B
668 CLASS="COMMAND"
669 >srvany.exe</B
670 >.
671  The only catch is that this will effectively disable the
672  <SPAN
673 CLASS="APPLICATION"
674 >Privoxy</SPAN
675 > icon in the taskbar. You can have 
676  one or the other, but not both at this time :( </P
677 ><P
678 > There is a pending feature request for this functionality. See 
679  thread: <A
680 HREF="http://sourceforge.net/tracker/?func=detail&atid=361118&aid=485617&group_id=11118"
681 TARGET="_top"
682 >http://sourceforge.net/tracker/?func=detail&#38;atid=361118&#38;aid=485617&#38;group_id=11118</A
683 >, 
684  for details, and a sample configuration.&#13;</P
685 ></DIV
686 ><DIV
687 CLASS="SECT2"
688 ><H3
689 CLASS="SECT2"
690 ><A
691 NAME="OTHERPROXY"
692 >3.14. How can I make <SPAN
693 CLASS="APPLICATION"
694 >Privoxy</SPAN
695 > work with other 
696 proxies like <SPAN
697 CLASS="APPLICATION"
698 >Squid</SPAN
699 >?</A
700 ></H3
701 ><P
702 > This can be done. See the <A
703 HREF="../user-manual/config.html#FORWARDING"
704 TARGET="_top"
705 >user manual</A
706 >, 
707  which describes how to do this.&#13;</P
708 ></DIV
709 ></DIV
710 ><DIV
711 CLASS="NAVFOOTER"
712 ><HR
713 ALIGN="LEFT"
714 WIDTH="100%"><TABLE
715 WIDTH="100%"
716 BORDER="0"
717 CELLPADDING="0"
718 CELLSPACING="0"
719 ><TR
720 ><TD
721 WIDTH="33%"
722 ALIGN="left"
723 VALIGN="top"
724 ><A
725 HREF="installation.html"
726 >Prev</A
727 ></TD
728 ><TD
729 WIDTH="34%"
730 ALIGN="center"
731 VALIGN="top"
732 ><A
733 HREF="index.html"
734 >Home</A
735 ></TD
736 ><TD
737 WIDTH="33%"
738 ALIGN="right"
739 VALIGN="top"
740 ><A
741 HREF="misc.html"
742 >Next</A
743 ></TD
744 ></TR
745 ><TR
746 ><TD
747 WIDTH="33%"
748 ALIGN="left"
749 VALIGN="top"
750 >Installation</TD
751 ><TD
752 WIDTH="34%"
753 ALIGN="center"
754 VALIGN="top"
755 >&nbsp;</TD
756 ><TD
757 WIDTH="33%"
758 ALIGN="right"
759 VALIGN="top"
760 >Miscellaneous</TD
761 ></TR
762 ></TABLE
763 ></DIV
764 ></BODY
765 ></HTML
766 >