24a165336e2365f1cdb75b8c54148c82ec0937ee
[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.</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 ><P
139 > <SPAN
140 CLASS="APPLICATION"
141 >Privoxy</SPAN
142 > comes with several default
143  <SPAN
144 CLASS="APPLICATION"
145 >actions</SPAN
146 > files, with varying degrees 
147  of filtering and blocking, as starting points for your own 
148  configuration (see below).</P
149 ></DIV
150 ><DIV
151 CLASS="SECT2"
152 ><H3
153 CLASS="SECT2"
154 ><A
155 NAME="ACTIONSS"
156 >3.3. The <SPAN
157 CLASS="QUOTE"
158 >"actions"</SPAN
159 > concept confuses me. Please list 
160 some of these <SPAN
161 CLASS="QUOTE"
162 >"actions"</SPAN
163 >.</A
164 ></H3
165 ><P
166 > These are all explained in the 
167  <A
168 HREF="../user-manual/configuration.html#ACTIONS-FILE"
169 TARGET="_top"
170 >user-manual</A
171 >.
172  Please refer to that.</P
173 ></DIV
174 ><DIV
175 CLASS="SECT2"
176 ><H3
177 CLASS="SECT2"
178 ><A
179 NAME="AEN255"
180 >3.4. How are actions files configured? What is the easiest
181 way to do this?</A
182 ></H3
183 ><P
184 > The easiest way to do this, is to access <SPAN
185 CLASS="APPLICATION"
186 >Privoxy</SPAN
187 >
188  with your web browser at <A
189 HREF="http://p.p/"
190 TARGET="_top"
191 >http://p.p/</A
192 >, 
193  and then select 
194  "<A
195 HREF="http://config.privoxy.org"
196 TARGET="_top"
197 >Edit the actions list</A
198 >"
199  from the selection list. You can also do this by editing the appropriate 
200  file with a text editor.</P
201 ><P
202 > Please see the 
203  <A
204 HREF="../user-manual/configuration.html#ACTIONS-FILE"
205 TARGET="_top"
206 >user-manual</A
207 > for a
208  detailed explanation of these and other configuration files, and their
209  various options and syntax.</P
210 ></DIV
211 ><DIV
212 CLASS="SECT2"
213 ><H3
214 CLASS="SECT2"
215 ><A
216 NAME="BROWSECONFIG"
217 >3.5. Why can I change the configuration with a
218 browser? Does that not raise security issues?</A
219 ></H3
220 ><P
221 >What I don't understand, is how I can browser edit the config file as a
222 regular user, while the whole <TT
223 CLASS="FILENAME"
224 >/etc/privoxy</TT
225 > hierarchy
226 belongs to the user <SPAN
227 CLASS="QUOTE"
228 >"privoxy"</SPAN
229 >, with only 644 permissions.
230  </P
231 ><P
232 >When you use the browser-based editor, <SPAN
233 CLASS="APPLICATION"
234 >Privoxy</SPAN
235 >
236 itself is writing to the config files.  Because
237 <SPAN
238 CLASS="APPLICATION"
239 >Privoxy</SPAN
240 > is running as the user <SPAN
241 CLASS="QUOTE"
242 >"privoxy"</SPAN
243 >, it can
244 update the config files.
245  </P
246 ><P
247 >If you don't like this, setting <SPAN
248 CLASS="QUOTE"
249 >"enable-edit-actions 0"</SPAN
250 > in the
251 config file will disable the browser-based editor.  If you're that paranoid,
252 you should also consider setting <SPAN
253 CLASS="QUOTE"
254 >"enable-remote-toggle 0"</SPAN
255 > to prevent
256 browser-based enabling/disabling of <SPAN
257 CLASS="APPLICATION"
258 >Privoxy</SPAN
259 >.
260  </P
261 ><P
262 >Note that normally only local users can connect to
263 <SPAN
264 CLASS="APPLICATION"
265 >Privoxy</SPAN
266 >, so this is not (normally) a security
267 problem.
268  </P
269 ></DIV
270 ><DIV
271 CLASS="SECT2"
272 ><H3
273 CLASS="SECT2"
274 ><A
275 NAME="AEN278"
276 >3.6. What is <SPAN
277 CLASS="QUOTE"
278 >"default.filter"</SPAN
279 >?</A
280 ></H3
281 ><P
282 > The <SPAN
283 CLASS="QUOTE"
284 >"default.filter"</SPAN
285 > file is used to <SPAN
286 CLASS="QUOTE"
287 >"filter"</SPAN
288 > any
289  web page content. By <SPAN
290 CLASS="QUOTE"
291 >"filtering"</SPAN
292 > we mean it can modify, remove, 
293  or change <I
294 CLASS="EMPHASIS"
295 >anything</I
296 > on the page, including HTML tags, and
297  JavaScript. Regular expressions are used to accomplish this, and operate 
298  on a line by line basis. This is potentially a very powerful feature, but
299  requires some expertise. </P
300 ><P
301 > If you are familiar with regular expressions, and HTML, you can look at 
302  the provided <TT
303 CLASS="FILENAME"
304 >default.filter</TT
305 > with a text editor and see
306  some of things it can be used for.</P
307 ><P
308 > Presently, there is no GUI editor option for this part of the configuration, 
309  but you can disable/enable various sections of the included default 
310  file with the <SPAN
311 CLASS="QUOTE"
312 >"Actions List Editor"</SPAN
313 > from your browser.</P
314 ></DIV
315 ><DIV
316 CLASS="SECT2"
317 ><H3
318 CLASS="SECT2"
319 ><A
320 NAME="AEN290"
321 >3.7. How can I set up <SPAN
322 CLASS="APPLICATION"
323 >Privoxy</SPAN
324 > to act as a proxy for my 
325  LAN?</A
326 ></H3
327 ><P
328 > By default, <SPAN
329 CLASS="APPLICATION"
330 >Privoxy</SPAN
331 > only responds to requests 
332  from localhost. To have it act as a server for a network, this needs to be 
333  changed in the main config file where the <SPAN
334 CLASS="APPLICATION"
335 >Privoxy</SPAN
336 >
337  configuration is located. In that file is a <SPAN
338 CLASS="QUOTE"
339 >"listen-address"</SPAN
340
341  option. It may be commented out with a <SPAN
342 CLASS="QUOTE"
343 >"#"</SPAN
344 > symbol. Make sure 
345  it is uncommented, and assign it the address of the LAN gateway interface, 
346  and port number to use:</P
347 ><P
348 > <TABLE
349 BORDER="0"
350 BGCOLOR="#E0E0E0"
351 WIDTH="100%"
352 ><TR
353 ><TD
354 ><PRE
355 CLASS="SCREEN"
356 >  listen-address  192.168.1.1:8118</PRE
357 ></TD
358 ></TR
359 ></TABLE
360 ></P
361 ><P
362 > Save the file, and restart <SPAN
363 CLASS="APPLICATION"
364 >Privoxy</SPAN
365 >. Configure 
366  all browsers on the network then to use this address and port number.</P
367 ></DIV
368 ><DIV
369 CLASS="SECT2"
370 ><H3
371 CLASS="SECT2"
372 ><A
373 NAME="AEN302"
374 >3.8. Instead of ads, now I get a checkerboard pattern. I don't want to see anything.</A
375 ></H3
376 ><P
377 > This is a configuration option for images that
378  <SPAN
379 CLASS="APPLICATION"
380 >Privoxy</SPAN
381 > is stopping. You have the choice   of a checkerboard
382  pattern, a transparent 1x1 GIF image (aka <SPAN
383 CLASS="QUOTE"
384 >"blank"</SPAN
385 >), or a custom
386  URL of your choice. Note that to fit this category, the URL must match both 
387  the <SPAN
388 CLASS="QUOTE"
389 >"+image"</SPAN
390 > and <SPAN
391 CLASS="QUOTE"
392 >"+block"</SPAN
393 > actions.</P
394 ><P
395 > If you want to see nothing, then change the <SPAN
396 CLASS="QUOTE"
397 >"+image-blocker"</SPAN
398
399  action to <SPAN
400 CLASS="QUOTE"
401 >"+image-blocker{blank}"</SPAN
402 >. This can be done from the 
403  <SPAN
404 CLASS="QUOTE"
405 >"Edit Actions List"</SPAN
406 > selection at <A
407 HREF="http://p.p/"
408 TARGET="_top"
409 >http://p.p/</A
410 >. Or by hand editing the appropriate 
411  actions file. This will only effect what is defined as <SPAN
412 CLASS="QUOTE"
413 >"images"</SPAN
414 >
415  though. Also, some URLs that generate the bright red <SPAN
416 CLASS="QUOTE"
417 >"Blocked"</SPAN
418 >
419  banner, can be moved to the <SPAN
420 CLASS="QUOTE"
421 >"+image-blocker"</SPAN
422 > section for the
423  same reason, but there are some limits and risks to this (see below).</P
424 ></DIV
425 ><DIV
426 CLASS="SECT2"
427 ><H3
428 CLASS="SECT2"
429 ><A
430 NAME="AEN317"
431 >3.9. Why would anybody want to see a checkerboard pattern?</A
432 ></H3
433 ><P
434 > This can be helpful for troubleshooting problems. It might also be good 
435  for anyone new to <SPAN
436 CLASS="APPLICATION"
437 >Privoxy</SPAN
438 > so that they can 
439  see if their favorite pages are displaying correctly, and
440  <SPAN
441 CLASS="APPLICATION"
442 >Privoxy</SPAN
443 > is not inadvertently removing something 
444  important.</P
445 ></DIV
446 ><DIV
447 CLASS="SECT2"
448 ><H3
449 CLASS="SECT2"
450 ><A
451 NAME="AEN322"
452 >3.10. I see large red banners on some pages that say 
453 <SPAN
454 CLASS="QUOTE"
455 >"Blocked"</SPAN
456 >. Why and how do I get rid of this?</A
457 ></H3
458 ><P
459 > These are URLs that match something in one of 
460  <SPAN
461 CLASS="APPLICATION"
462 >Privoxy's</SPAN
463 > block actions (+block). It is meant
464  to be a warning so that you know something has been blocked and an easy way
465  for you to see why. These are handled differently than what has been defined
466  explicitly as <SPAN
467 CLASS="QUOTE"
468 >"images"</SPAN
469 > (e.g. ad banners). Depending on the 
470  URL itself, it is sometimes hard for <SPAN
471 CLASS="APPLICATION"
472 >Privoxy</SPAN
473 > to 
474  really know whether there is indeed an ad image there or not. And there are
475  limitations as to what <SPAN
476 CLASS="APPLICATION"
477 >Privoxy</SPAN
478 > can do to 
479  <SPAN
480 CLASS="QUOTE"
481 >"fool"</SPAN
482 > the browser.</P
483 ><P
484 > For instance, if the ad is in a frame, then it is embedded in the separate
485  HTML page used for the frame. In this case, you cannot just substitute an
486  aribitray image (like we would for a <SPAN
487 CLASS="QUOTE"
488 >"blank"</SPAN
489 > image), for an HTML
490  page. The browser is expecting an HTML page, and that is what it must have
491  for frames. So this situation can be a little trickier to deal with, and 
492  <SPAN
493 CLASS="APPLICATION"
494 >Privoxy</SPAN
495 > will use the <SPAN
496 CLASS="QUOTE"
497 >"Blocked"</SPAN
498 > page.</P
499 ><P
500 > If you want these to be treated as if they were images, so that they can be
501  made invisible, you can try moving the offending URL from the
502  <SPAN
503 CLASS="QUOTE"
504 >"+block"</SPAN
505 > section to the <SPAN
506 CLASS="QUOTE"
507 >"+imageblock"</SPAN
508 > section of
509  your actions file. Just be forewarned, if any URL is made
510  <SPAN
511 CLASS="QUOTE"
512 >"invisible"</SPAN
513 >, you may not have any inkling that something has
514  been removed from that page, or why. If this approach does not work, then you are
515  probably dealing with a frame (or <SPAN
516 CLASS="QUOTE"
517 >"ilayer"</SPAN
518 >), and the only thing
519  that can go there is an HTML page of some sort.</P
520 ><P
521 > To deal with this situation, you could modify the
522  <SPAN
523 CLASS="QUOTE"
524 >"<TT
525 CLASS="FILENAME"
526 >block</TT
527 >"</SPAN
528 > HTML template that is used by
529  <SPAN
530 CLASS="APPLICATION"
531 >Privoxy</SPAN
532 > to display this, and make it something
533  more to your liking. Currently, there is no configuration option for this.
534  You will have to modify, or create your own page, and use this to replace
535  <TT
536 CLASS="FILENAME"
537 >templates/blocked</TT
538 >, which is what
539  <SPAN
540 CLASS="APPLICATION"
541 >Privoxy</SPAN
542 > uses to display the <SPAN
543 CLASS="QUOTE"
544 >"Blocked"</SPAN
545 >
546  page.</P
547 ><P
548 > Another way to deal with this is find why and where
549  <SPAN
550 CLASS="APPLICATION"
551 >Privoxy</SPAN
552 > is blocking the frame, and 
553  diable this. Then let the <SPAN
554 CLASS="QUOTE"
555 >"+image-blocker"</SPAN
556 > action 
557  handle the ad that is embedded in the frame's HTML page. </P
558 ></DIV
559 ><DIV
560 CLASS="SECT2"
561 ><H3
562 CLASS="SECT2"
563 ><A
564 NAME="ALLISEEISRED"
565 >3.11. I cannot see all of the <SPAN
566 CLASS="QUOTE"
567 >"Blocked"</SPAN
568 > page banner. All I
569 see is a bright red square.</A
570 ></H3
571 ><P
572 > There is not enough space to fit the entire page. Try right clicking on the
573  visible, red portion, and select <SPAN
574 CLASS="QUOTE"
575 >"Show Frame"</SPAN
576 >, or equivalent.
577  This will usually allow you to see the entire Privoxy <SPAN
578 CLASS="QUOTE"
579 >"Blocked"</SPAN
580 >
581  page, and from there you can see just what is being blocked, and why.</P
582 ></DIV
583 ><DIV
584 CLASS="SECT2"
585 ><H3
586 CLASS="SECT2"
587 ><A
588 NAME="SRVANY"
589 >3.12. Can <SPAN
590 CLASS="APPLICATION"
591 >Privoxy</SPAN
592 > run as a service 
593 on Win2K/NT?</A
594 ></H3
595 ><P
596 > Yes, it can run as a system service using <B
597 CLASS="COMMAND"
598 >srvany.exe</B
599 >.
600  The only catch is that this will effectively disable the
601  <SPAN
602 CLASS="APPLICATION"
603 >Privoxy</SPAN
604 > icon in the taskbar. You can have 
605  one or the other, but not both at this time :( </P
606 ><P
607 > There is a pending feature request for this functionality. See 
608  thread: <A
609 HREF="http://sourceforge.net/tracker/?func=detail&atid=361118&aid=485617&group_id=11118"
610 TARGET="_top"
611 >http://sourceforge.net/tracker/?func=detail&#38;atid=361118&#38;aid=485617&#38;group_id=11118</A
612 >, 
613  for details, and a sample configuration.&#13;</P
614 ></DIV
615 ><DIV
616 CLASS="SECT2"
617 ><H3
618 CLASS="SECT2"
619 ><A
620 NAME="OTHERPROXY"
621 >3.13. How can I make <SPAN
622 CLASS="APPLICATION"
623 >Privoxy</SPAN
624 > work with other 
625 proxies like <SPAN
626 CLASS="APPLICATION"
627 >Squid</SPAN
628 >?</A
629 ></H3
630 ><P
631 > This can be done. See the <A
632 HREF="../user-manual/configuration.html#FORWARDING"
633 TARGET="_top"
634 >user manual</A
635 >, 
636  which describes how to do this.&#13;</P
637 ></DIV
638 ></DIV
639 ><DIV
640 CLASS="NAVFOOTER"
641 ><HR
642 ALIGN="LEFT"
643 WIDTH="100%"><TABLE
644 WIDTH="100%"
645 BORDER="0"
646 CELLPADDING="0"
647 CELLSPACING="0"
648 ><TR
649 ><TD
650 WIDTH="33%"
651 ALIGN="left"
652 VALIGN="top"
653 ><A
654 HREF="installation.html"
655 >Prev</A
656 ></TD
657 ><TD
658 WIDTH="34%"
659 ALIGN="center"
660 VALIGN="top"
661 ><A
662 HREF="index.html"
663 >Home</A
664 ></TD
665 ><TD
666 WIDTH="33%"
667 ALIGN="right"
668 VALIGN="top"
669 ><A
670 HREF="misc.html"
671 >Next</A
672 ></TD
673 ></TR
674 ><TR
675 ><TD
676 WIDTH="33%"
677 ALIGN="left"
678 VALIGN="top"
679 >Installation</TD
680 ><TD
681 WIDTH="34%"
682 ALIGN="center"
683 VALIGN="top"
684 >&nbsp;</TD
685 ><TD
686 WIDTH="33%"
687 ALIGN="right"
688 VALIGN="top"
689 >Miscellaneous</TD
690 ></TR
691 ></TABLE
692 ></DIV
693 ></BODY
694 ></HTML
695 >