<html> <head><meta http-equiv=„Content-Type“ content=„text/html; charset=utf-8“/><meta name=„robots“ content=„noindex“/><title>Privoxy</title></head><body class=„readabilityBody“ readability=„68“>
<div class="box tested_for"><h3 class="box tested_for">Dieser Artikel wurde für die folgenden
Ubuntu-Versionen getestet:</h3></div><div class=„box knowledge“><h3 class=„box knowledge“>Zum Verständnis dieses Artikels sind folgende Seiten hilfreich:</h3></div><div class=„toc toc-depth-1“><p>Inhaltsverzeichnis</p><ol class=„arabic“><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Installation“ class=„crosslink“>Installation </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Konfiguration“ class=„crosslink“>Konfiguration </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Privoxy-im-Browser-aktivieren“ class=„crosslink“>Privoxy im Browser aktivieren </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Werbefilter-einrichten“ class=„crosslink“>Werbefilter einrichten </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Kinderschutz-einrichten“ class=„crosslink“>Kinderschutz einrichten </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Funktion-ueberpruefen“ class=„crosslink“>Funktion überprüfen </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Problembehebung“ class=„crosslink“>Problembehebung </a></li><li><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Links“ class=„crosslink“>Links </a></li></ol></div><p><a href=„https://media-cdn.ubuntu-de.org/wiki/attachments/42/50/privoxy_logo.png“ rel=„nofollow“ class=„external“><img src=„https://media-cdn.ubuntu-de.org/wiki/thumbnails/d/d4/d418970111617334f20cfcd30bf232c953df0a77i48x.png“ alt=„./privoxy_logo.png“ class=„image-left“/></a> <a href=„http://www.privoxy.org/“ rel=„nofollow“ class=„external“>Privoxy</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/35/40/gb.png“ alt=„{en}“/> – der Name steht für <strong>Privacy Enhancing Proxy</strong> – ist zum Schutz der Privatsphäre beim Internet-Surfen gedacht. Mit Privoxy können mit wenig Aufwand aufgerufene Webseiten nach eigenen Regeln gefiltert werden. So können beispielsweise Werbebanner automatisch aus dem Seiteninhalt entfernt werden. Auch die Verfolgung des Nutzerverhaltens durch Cookies kann mit Privoxy verhindert werden. Privoxy ist ein sogenannter Content-Filtering-<a href=„https://de.wikipedia.org/wiki/Proxy“ class=„interwiki interwiki-wikipedia“>Proxy</a>.</p><div class=„section_1“ readability=„8“><h2 id=„Installation“>Installation</h2><p> Privoxy kann direkt aus den offiziellen Paketquellen installiert <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-1“>[1]</a> werden. Folgendes Paket wird benötigt:</p><ul><li><p><strong>privoxy</strong> (<em>universe</em>)</p></li></ul><p><a href=„apt:privoxy“ rel=„nofollow“ class=„external“><img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/07/17/button.png“ alt=„Wiki/Vorlagen/Installbutton/button.png“ class=„image-default“/></a> mit <a href=„https://wiki.ubuntuusers.de/apturl/“ class=„internal“>apturl</a> </p><div class=„package-list“ readability=„5“><div class=„contents“ readability=„36“><p> Paketliste zum Kopieren: </p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo apt-get install privoxy </pre></div></div><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo aptitude install privoxy </pre></div></div></div></div><p>Anschließend wird Privoxy automatisch gestartet und lauscht auf Port <em>8118</em>.</p></div><div class=„section_1“ readability=„29“><h2 id=„Konfiguration“>Konfiguration</h2><p> Privoxy wird über die ausführlich dokumentierte Datei <strong>/etc/privoxy/config</strong> konfiguriert. Zur Einrichtung von Privoxy muss diese mit einem Editor <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-4“>[4]</a> und Root-Rechten <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-5“>[5]</a> bearbeitet werden. Zu blockierende Elemente werden in der Datei <strong>/etc/privoxy/user.action</strong> eingetragen (siehe auch <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Werbefilter-einrichten“ class=„crosslink“>Werbefilter einrichten</a>). Änderungen werden automatisch übernommen werden. Wie man den Privoxy-Dienst steuert, erfährt man mit dem Befehl <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-2“>[2]</a>:</p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“># bis 14.04 sudo /etc/init.d/privoxy # ab 16.04 sudo service privoxy </pre></div></div><p>Weitere Einstellungen (siehe nächster Abschnitt) sind optional und nicht unbedingt erforderlich. Dann geht es weiter mit <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Privoxy-im-Browser-aktivieren“ class=„crosslink“>Privoxy im Browser aktivieren</a>.</p><div class=„section_2“ readability=„26“><h3 id=„Weiterleitung“>Weiterleitung</h3><p> Privoxy kann Anfragen an einen vorgelagerten Proxyserver (parent proxy) weiterleiten. Ein Beispiel:</p><pre class=„notranslate“># 5.1. forward forward / PROXY:PORT forward :443 .</pre><p> Hier werden alle Anfragen (<code class=„notranslate“>/</code> = alle URLs) an einen vorgelagerten Proxy weitergeleitet. Davon ausgenommen sind Anfragen über den Port <code class=„notranslate“>443</code> (HTTPS), die als direkte Anfragen behandelt werden sollen. Will man eine Weiterleitung ausschließlich für bestimmte Domains einrichten, sieht die Zeile so aus:</p><pre class=„notranslate“>forward .i2p localhost:4444</pre><p>Dies leitet alle Aufrufe für DNS-Namen, die auf <code class=„notranslate“>.i2p</code> enden, an den eigenen Rechner auf Port <code class=„notranslate“>4444</code> weiter. Da keine Proxy-Art angegeben ist, erwartet Privoxy dort einen weiteren Webproxy.</p><div class=„section_3“ readability=„16“><h4 id=„SOCKS“>SOCKS</h4><p> Auf Wunsch kann auch ein <a href=„https://de.wikipedia.org/wiki/SOCKS“ class=„interwiki interwiki-wikipedia“>SOCKS</a>-Proxy genutzt werden:</p><pre class=„notranslate“># 5.2. forward-socks4 and forward-socks4a (neuere Versionen auch forward-socks5) # … forward-socks4a / IP:PORT .</pre><p>Wichtig: Bitte nicht den <strong>Punkt</strong> am Ende vergessen! Sonst ignoriert Privoxy den Eintrag. IP muss durch die IP-Adresse ersetzt werden, an welcher der andere Proxy lauscht (wenn er auf demselben PC läuft, ist die IPv4-Adresse <code class=„notranslate“>127.0.0.1</code>), und PORT durch die entsprechenden Port-Nummer.</p></div></div><div class=„section_2“ readability=„11“><h3 id=„Protokollierung“>Protokollierung</h3><p> Optional kann man innerhalb der Konfiguration das Erstellen von Protokollen (z.B. zur Fehlersuche) ein- oder ausschalten. Zum Deaktivieren setzt man das Zeichen <strong>#</strong> an den Zeilenanfang, zum Aktivieren entfernt man es wieder. Beispiel (deaktiviert):</p><pre class=„notranslate“># 2.5. logfile # … # logfile logfile</pre></div><div class=„section_2“ readability=„18“><h3 id=„Als-Dienst-im-LAN“>Als Dienst im LAN</h3><p> Soll Privoxy nicht nur lokal zur Verfügung stehen, sondern auch von anderen Rechnern im LAN erreichbar sein, so muss die Adresse geändert werden, auf der Privoxy lauscht. Hier muss die LAN-IP eingetragen werden. In diesem Beispiel <em>192.168.0.1</em>:</p><pre class=„notranslate“># 4.1. listen-address # … listen-address 192.168.0.1:8118</pre><p> Dabei kann auch gleich aktiviert werden, dass Rechner aus dem lokalen Netzwerk (LAN) Privoxy über die Pseudo-Adresse <code class=„notranslate“>http://p.p/</code> steuern können:</p><pre class=„notranslate“># 4.4. enable-edit-actions # 0 = deaktiviert, 1 = aktiviert enable-edit-actions 0</pre></div></div><div class=„section_1“ readability=„14“><h2 id=„Privoxy-im-Browser-aktivieren“>Privoxy im Browser aktivieren</h2><p> <a href=„https://media-cdn.ubuntu-de.org/wiki/attachments/40/47/privoxy_firefox.png“ rel=„nofollow“ class=„external“><img src=„https://media-cdn.ubuntu-de.org/wiki/thumbnails/2/28/283bee439aea2e1975c35dc2e9a498dd5c0392c4i250x.png“ alt=„./privoxy_firefox.png“ class=„image-right“/></a> Damit Privoxy beim Surfen genutzt wird, müssen in den Netzwerkeinstellungen des Browsers der HTTP-Proxy und der Port angegeben werden:</p><pre class=„notranslate“>localhost:8118</pre><p> bzw.</p><pre class=„notranslate“><Server-IP>:8118</pre><p> falls man Privoxy im LAN eingerichtet hat. Je nach Desktop-Umgebung können auch eigene Konfigurationswerkzeuge zur Einrichtung eines Proxys verwendet werden (siehe <a href=„https://wiki.ubuntuusers.de/Proxyserver/“ class=„internal“>Proxyserver</a>). Aber nicht jeder Browser berücksichtigt die Verwendung eines zentralen Proxys, und evtl. streiken manche Programme (z.B. die <a href=„https://wiki.ubuntuusers.de/Paketverwaltung/“ class=„internal“>Paketverwaltung</a>). Von daher ist man mit der direkten Konfiguration nur im Browser auf der sicheren Seite.</p></div><div class=„section_1“ readability=„38“><h2 id=„Werbefilter-einrichten“>Werbefilter einrichten</h2><p> Will man die Konfiguration ändern, etwa eine Werbe-URL hinzufügen, die Privoxy nicht selbst erkennt, geht das über die Pseudo-Adresse: <a title=„http://p.p“ href=„http://p.p“ rel=„nofollow“ class=„external“>http://p.p</a></p><p>Dort gibt es den Link <em>„View & change the current configuration“</em>. Hier auf den Button <em>„Edit“</em> in der Zeile <strong>/etc/privoxy/user.action</strong> klicken. Den Abschnitt suchen, bei dem unter <em>„Actions“</em> lediglich <em>„<code class=„notranslate“>+block</code>“</em> steht. Dort die Domain des Werbe-Servers eintragen, angeführt von einem Punkt, aber ohne ein eventuelles <em>„<code class=„notranslate“>http://www</code>“</em>. Das Resultat sind z.B. Einträge wie <em>„<code class=„notranslate“>.altfarm.xxx.com</code>“</em> oder <em>„<code class=„notranslate“>.adserv.xxx.de</code>“</em>. Mit <em>„Add“</em> fügt man die Werbe-URL hinzu.</p><p>Analog trägt man Seiten, die irrtümlich ausgeblendet werden (zu erkennen an der „Blocked“-Meldung), unter <em>„<code class=„notranslate“>-block</code>“</em> ein. Hier wird auch der Link <em>„go there anyway“</em> angeboten, über den man blockierten Seiten trotzdem aufrufen kann.</p><div class=„box notice“ readability=„7“><h3 class=„box notice“>Hinweis:</h3><div class=„contents“ readability=„40“><p>Auch in der Zeile <strong>/etc/privoxy/default.action</strong> gibt es einen <em>„Edit“</em>-Button. Davon sollte man aber keinen Gebrauch machen. Hier befinden sich die grundlegenden Regeln, nach denen Privoxy filtert. Anders als <strong>/etc/privoxy/user.action</strong> wird diese Datei bei einer Systemaktualisierung überschrieben. </p></div></div><div class=„section_2“ readability=„30“><h3 id=„EasyList“>EasyList</h3><p> Um die Filterliste <a href=„https://easylist.to/“ rel=„nofollow“ class=„external“>EasyList</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/49/40/de.png“ alt=„{de}“/> (die unter anderem auch im Firefox Add-On <a href=„https://wiki.ubuntuusers.de/Adblock/“ class=„internal“>Adblock</a> verwendet wird) für Privoxy nutzen zu können, kann man ein Shell-Skript nutzen. Damit das Skript korrekt arbeiten kann, müssen aus dem Ordner <strong>/etc/privoxy/</strong> alle selbst angelegten Dateien zu Aktionen (<strong>.action</strong>) und Filtern (<strong>.filter</strong>) entfernt werden (wurden keine Anpassungen vorgenommen, kann man diesen Hinweis ignorieren). Gestattet sind lediglich folgende Dateien:</p><ul><li><p><strong>config</strong></p></li><li><p><strong>default.*</strong></p></li><li><p><strong>global.action</strong></p></li><li><p><strong>match-all.action</strong></p></li><li><p><strong>trust</strong></p></li><li><p><strong>user.action</strong></p></li></ul><p> Außerdem sollte die Datei <strong>/etc/privoxy/config</strong> vorab auf Einträge zu benutzerdefinierten Aktionen und Filtern kontrolliert werden.</p><p>Gespeichert wird das Skript unter dem Namen <strong>~/bin/privoxy-blocklist.sh</strong> oder <strong>/usr/local/bin/privoxy-blocklist.sh</strong>:</p><div class=„code“><table class=„notranslate syntaxtable“ readability=„8“><tr readability=„17“><td class=„linenos“ readability=„6“><div class=„linenodiv“ readability=„12“><pre> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187</pre></div></td><td class=„code“ readability=„8“><div class=„notranslate syntax“ readability=„15“><pre>#!/bin/bash # ###################################################################### # # Author: Andrwe Lord Weber # Mail: lord-weber-andrwe<at>renona-studios<dot>org # Version: 0.2 # URL: http://andrwe.dyndns.org/doku.php/blog/scripting/bash/privoxy-blocklist # ################## # # Sumary: # This script downloads, converts and installs # AdblockPlus lists into Privoxy # ###################################################################### ###################################################################### # # TODO: # - implement: # domain-based filter # ###################################################################### ###################################################################### # # script variables and functions # ###################################################################### # array of URL for AdblockPlus lists URLS=(„https://easylist-downloads.adblockplus.org/easylistgermany.txt“ „http://adblockplus.mozdev.org/easylist/easylist.txt“) # privoxy config dir (default: /etc/privoxy/) CONFDIR=/etc/privoxy # directory for temporary files TMPDIR=/tmp/privoxy-blocklist TMPNAME=$(basename ${0}) ###################################################################### # # No changes needed after this line. # ###################################################################### function usage() { echo „${TMPNAME} is a script to convert AdBlockPlus-lists into Privoxy-lists and install them.“ echo „ “ echo „Options:“ echo „ -h: Show this help.“ echo „ -q: Don't give any output.“ echo „ -v 1: Enable verbosity 1. Show a little bit more output.“ echo „ -v 2: Enable verbosity 2. Show a lot more output.“ echo „ -v 3: Enable verbosity 3. Show all possible output and don't delete temporary files.(For debugging only!!)“ echo „ -r: Remove all lists build by this script.“ } [ ${UID} -ne 0 ] && echo -e „Root privileges needed. Exit.\n\n“ && usage && exit 1 # check whether an instance is already running [ -e ${TMPDIR}/${TMPNAME}.lock ] && echo „An Instance of ${TMPNAME} is already running. Exit“ && exit DBG=0 function debug() { [ ${DBG} -ge ${2} ] && echo -e „${1}“ } function main() { cpoptions=„“ [ ${DBG} -gt 0 ] && cpoptions=„-v“ for url in ${URLS[@]} do debug „Processing ${url} …\n“ 0 file=${TMPDIR}/$(basename ${url}) actionfile=${file%\.*}.script.action filterfile=${file%\.*}.script.filter list=$(basename ${file%\.*}) # download list debug „Downloading ${url} …“ 0 wget -t 3 –no-check-certificate -O ${file} ${url} >${TMPDIR}/wget-${url\#}.log 2>&1 debug „$(cat ${TMPDIR}/wget-${url\#}.log)“ 2 debug „.. downloading done.“ 0 [ „$(grep -E '^\[Adblock.*\]$' ${file})“ == „“ ] && echo „The list recieved from ${url} isn't an AdblockPlus list. Skipped“ && continue # convert AdblockPlus list to Privoxy list # blacklist of urls debug „Creating actionfile for ${list} …“ 1 echo -e „{ +block{${list}} }“ > ${actionfile} sed '/^!.*/d;1,1 d;/^@@.*/d;/\$.*/d;/#/d;s/\./\\./g;s/\?/\\?/g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} >> ${actionfile} debug „… creating filterfile for ${list} …“ 1 echo „FILTER: ${list} Tag filter of ${list}“ > ${filterfile} # set filter for html elements sed '/^#/!d;s/^##g;s/^#\(.*\)\[.*\]\[.*\]*/s|<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>||g/g;s/^#\(.*\)/s|<([a-zA-Z0-9]+)\\s+.*id=.?\1.*>.*<\/\\1>||g/g;s/^\.\(.*\)/s|<([a-zA-Z0-9]+)\\s+.*class=.?\1.*>.*<\/\\1>||g/g;s/^a\[\(.*\)\]/s|<a.*\1.*>.*<\/a>||g/g;s/^\([a-zA-Z0-9]*\)\.\(.*\)\[.*\]\[.*\]*/s|<\1.*class=.?\2.*>.*<\/\1>||g/g;s/^\([a-zA-Z0-9]*\)#\(.*\):.*[:[^:]]*[^:]*/s|<\1.*id=.?\2.*>.*<\/\1>||g/g;s/^\([a-zA-Z0-9]*\)#\(.*\)/s|<\1.*id=.?\2.*>.*<\/\1>||g/g;s/^\[\([a-zA-Z]*\).=\(.*\)\]/s|\1^=\2>||g/g;s/\^/[\/\&:\?=_]/g;s/\.\([a-zA-Z0-9]\)/\\.\1/g' ${file} >> ${filterfile}
debug "... filterfile created - adding filterfile to actionfile ..." 1
echo "{ +filter{${list}} }" >> ${actionfile}
echo "*" >> ${actionfile}
debug "... filterfile added ..." 1
debug "... creating and adding whitlist for urls ..." 1
# whitelist of urls
echo "{ -block }" >> ${actionfile}
sed '/^@@.*/!d;s/^@@//g;/\$.*/d;/#/d;s/\./\\./g;s/\?/\\?/g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} >> ${actionfile}
debug "... created and added whitelist - creating and adding image handler ..." 1
# whitelist of image urls
echo "{ -block +handle-as-image }" >> ${actionfile}
sed '/^@@.*/!d;s/^@@//g;/\$.*image.*/!d;s/\$.*image.*//g;/#/d;s/\./\\./g;s/\?/\\?/g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} >> ${actionfile}
debug "... created and added image handler ..." 1
debug "... created actionfile for ${list}." 1
# install Privoxy actionsfile
cp ${cpoptions} ${actionfile} ${CONFDIR}
if [ "$(grep $(basename ${actionfile}) ${CONFDIR}/config)" == "" ]
then
debug "\nModifying ${CONFDIR}/config ..." 0
sed "s/^actionsfile user\.action/actionsfile $(basename ${actionfile})\nactionsfile user.action/" ${CONFDIR}/config > ${TMPDIR}/config
debug "... modification done.\n" 0
debug "Installing new config ..." 0
cp ${cpoptions} ${TMPDIR}/config ${CONFDIR}
debug "... installation done\n" 0
fi
# install Privoxy filterfile
cp ${cpoptions} ${filterfile} ${CONFDIR}
if [ "$(grep $(basename ${filterfile}) ${CONFDIR}/config)" == "" ]
then
debug "\nModifying ${CONFDIR}/config ..." 0
sed "s/^\(#*\)filterfile user\.filter/filterfile $(basename ${filterfile})\n\1filterfile user.filter/" ${CONFDIR}/config > ${TMPDIR}/config
debug "... modification done.\n" 0
debug "Installing new config ..." 0
cp ${cpoptions} ${TMPDIR}/config ${CONFDIR}
debug "... installation done\n" 0
fi
debug "... ${url} installed successfully.\n" 0
done
} # create temporary directory and lock file mkdir -p ${TMPDIR} touch ${TMPDIR}/${TMPNAME}.lock # set command to be run on exit [ ${DBG} -le 2 ] && trap „rm -fr ${TMPDIR};exit“ INT TERM EXIT # loop for options while getopts „:hrqv:“ opt do
case "${opt}" in
"h")
usage
exit 0
;;
"v")
DBG="${OPTARG}"
;;
"q")
DBG=-1
;;
"r")
echo "Do you really want to remove all build lists?(y/N)"
read choice
[ "${choice}" != "y" ] && exit 0
rm -rf ${CONFDIR}/*.script.{action,filter} && \
sed '/^actionsfile .*\.script\.action$/d;/^filterfile .*\.script\.filter$/d' -i ${CONFDIR}/config && \
echo "Lists removed." && exit 0
echo -e "An error occured while removing the lists.\nPlease have a look into ${CONFDIR} whether there are .script.* files and search for *.script.* in ${CONFDIR}/config."
exit 1
;;
":")
echo "${TMPNAME}: -${OPTARG} requires an argument" >&2
exit 1
;;
esac
done debug „URL-List: ${URLS}\nPrivoxy-Configdir: ${CONFDIR}\nTemporary directory: ${TMPDIR}“ 2 main # restore default exit command trap - INT TERM EXIT [ ${DBG} -lt 2 ] && rm -r ${TMPDIR} [ ${DBG} -eq 2 ] && rm -vr ${TMPDIR} exit 0 </pre></div> </td></tr></table></div><p> <a href=„http://andrwe.org/doku.php/scripting/bash/privoxy-blocklist“ rel=„nofollow“ class=„external“>Quelle</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/35/40/gb.png“ alt=„{en}“/></p><p>Das Skript muss mit Root-Rechten <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-5“>[5]</a> gestartet werden <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-3“>[3]</a>:</p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo bash privoxy-blocklist.sh -v 1 </pre></div></div><p>Nun werden automatisch:</p><ol class=„arabic“ readability=„2“><li readability=„1“><p>die aktuellen Filterlisten <em>„EasyList“</em> und <em>„EasyList Germany“</em> heruntergeladen</p></li><li readability=„1“><p>für die Nutzung mit Privoxy umgewandelt</p></li><li readability=„1“><p>in den Ordner <strong>/etc/privoxy/</strong> kopiert und</p></li><li readability=„1“><p>in der Datei <strong>/etc/privoxy/config</strong> eingetragen</p></li></ol><p> Die neue Konfiguration wird von Privoxy automatisch erkannt. Empfehlenswert ist – bedingt durch den Zwischenspeicher (Cache) – ein Neustart des Webbrowsers. Das Skript kann man später (beispielsweise ein- bis zweimal im Monat) immer wieder erneut ausführen, um die Filterlisten zu aktualisieren. Fortgeschrittene können sich dazu einen <a href=„https://wiki.ubuntuusers.de/Cron/“ class=„internal“>Cron</a>-Job einrichten.</p><p>Die angepasste Konfiguration und alle erzeugten Listen lassen sich mit dem Befehl:</p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo bash privoxy-blocklist.sh -r </pre></div></div><p> wieder vollständig und rückstandsfrei vom Rechner entfernen.</p></div></div><div class=„section_1“ readability=„33“><h2 id=„Kinderschutz-einrichten“>Kinderschutz einrichten</h2><p> <a href=„https://media-cdn.ubuntu-de.org/wiki/attachments/23/51/privoxy_kinderschutz.jpg“ rel=„nofollow“ class=„external“><img src=„https://media-cdn.ubuntu-de.org/wiki/thumbnails/e/eb/eb40949325148e998dcd90a09405bdeb9cdbde32i200x.png“ alt=„./privoxy_kinderschutz.jpg“ class=„image-right“/></a> Die folgende Idee basiert auf einer Kindersicherung, die Dieter Schütze im Rahmen des ehemaligen Projekts „KinderTux“ sehr elegant umgesetzt hat. Es werden zwei Dateien mit Regeln benötigt, zur Erstellung braucht man Root-Rechte:</p><ul readability=„3“><li readability=„2“><p><strong>/etc/privoxy/blacklist.action</strong> - einzige Regel: es ist alles verboten. Inhalt: </p><pre class=„notranslate“>{+block{Kinderschutz aktiv}} / # alles blockieren!</pre></li><li readability=„5“><p><strong>/etc/privoxy/whitelist.action</strong> - erlaubte Ausnahmen. Inhalt: </p><pre class=„notranslate“>{-block} .privoxy.org .wdrmaus.de .die-maus.de .hirnwindungen.de .mathe-spass.de .learnetix.de .wikipedia.org .wikimedia.org .fragfinn.de .geolino.de .geo.de .blinde-kuh.de .br-online.de .derkleinekoenig.de .kika.de .kindersache.de .kindernetz.de .seitenstark.de .rbb-online.de .kidsweb.de .bmu-kids.de .br-online.de .helles-koepfchen.de .kidsville.de .legakids.net .lilipuz.de .milkmoon.de .pixelkids.de .pomki.de .labbe.de .hamsterkiste.de .physikfuerkids.de .sowieso.de .hanisauland.de .rossipotti.de .wasistwas.de .wolf-kinderclub.de .kidnetting.de .radio108komma8.de .klasse-wasser.de .oekolandbau.de .news4kids.de .primolo.de .starke-pfoten.de .internet-abc.de .notenmax.de .lucylehmann.de .kidkit.de .junge-klassik.de .medizin-fuer-kids.de .global-gang.de .klickerkids.de .kinderrathaus.de .bayerische.staatsoper.de .zum.de .mechant-loup.schule.de .prinzessin-knoepfchen.de .1000-maerchen.de .creativecommons.org .toggo.de .toggolino.de</pre></li></ul><div class=„box notice“ readability=„6“><h3 class=„box notice“>Hinweis:</h3><div class=„contents“ readability=„37“><p>Diese Liste mit Ausnahmen ist nur ein Beispiel und sollte unbedingt – am besten nach Rücksprache mit den Kindern – angepasst werden! Weitere Informationen sind im Artikel <a href=„https://wiki.ubuntuusers.de/Kinder/#Browser“ class=„internal“>Kinder</a> zu finden. </p></div></div><p>Nun müssen diese Regeln noch aktiviert werden. Dazu bearbeitet <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-4“>[4]</a> man die Datei <strong>/etc/privoxy/config</strong> mit Root-Rechten <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-5“>[5]</a>, sucht den Abschnitt <em>„actionsfile“</em>, deaktiviert die vorhandenen Einträge (durch ein <strong>#</strong> am Zeilenanfang) und fügt die beiden neuen Regeln hinzu. Beispiel:</p><pre class=„notranslate“>#actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on. #actionsfile default.action # Main actions file #actionsfile user.action # User customizations actionsfile blacklist.action # alle blockieren actionsfile whitelist.action # erlaubte Seiten</pre><p>Die neue Konfiguration wird automatisch erkannt. Empfehlenswert ist – bedingt durch den Zwischenspeicher (Cache) – ein Neustart des Webbrowsers. Weitere erlaubte Webseiten werden später einfach in <strong>/etc/privoxy/whitelist.action</strong> nachgetragen <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-4“>[4]</a><a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#source-5“>[5]</a>.</p><p>Deutsche und für Kinder (die bereits lesen können) verständliche Fehlermeldungen erreicht man durch den Austausch der Dateien <a href=„https://wiki.ubuntuusers.de/_attachment/?target=Privoxy%2Fblocked“ class=„crosslink“>/etc/privoxy/templates/blocked</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/25/47/download.png“ alt=„{dl}“/> und <a href=„https://wiki.ubuntuusers.de/_attachment/?target=Privoxy%2Fcgi-style.css“ class=„crosslink“>/etc/privoxy/templates/cgi-style.css</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/25/47/download.png“ alt=„{dl}“/>. Leider fehlt im Gegensatz zum Original eine grafische Oberfläche, mit der man bei KinderTux neue Adressen bequem hinzufügen konnte.</p><p>Alternativ gibt es mit <a href=„https://wiki.ubuntuusers.de/Kinder/#KinderServer“ class=„internal“>KinderServer</a> eine hervorragende Alternative, die das Erstellen einer eigenen „Whitelist“ (erlaubte Adressen) überflüssig machen kann.</p></div><div class=„section_1“ readability=„7“><h2 id=„Funktion-ueberpruefen“>Funktion überprüfen</h2><p> Die Aktivitäten von Privoxy lassen sich im Terminal beobachten. Dazu muss die <a href=„https://wiki.ubuntuusers.de/Privoxy/a/export/html/#Protokolle“ class=„crosslink“>Protokollierung</a> aktiv sein:</p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo tail -f /var/log/privoxy/logfile </pre></div></div><p> Mehr zum Thema <a href=„https://wiki.ubuntuusers.de/Logdateien/“ class=„internal“>Logdateien</a>.</p></div><div class=„section_1“ readability=„17“><h2 id=„Problembehebung“>Problembehebung</h2><div class=„section_2“ readability=„15“><h3 id=„Privoxy-nach-Neustart-nicht-verfuegbar“>Privoxy nach Neustart nicht verfügbar</h3><p> Immer wieder berichten Anwender, dass Privoxy beim Systemstart scheinbar nicht automatisch gestartet wird. Zwar läuft das Programm, aber ein Clientprogramm (z.B. ein Webbrowser) meldet trotzdem einen Fehler. In der Regel hilft ein manueller Neustart (des Dienstes) mit:</p><div class=„bash“ readability=„5“><div class=„contents“ readability=„36“><pre class=„notranslate“>sudo /etc/init.d/privoxy restart #bzw. sudo service privoxy restart </pre></div></div><p> Eine andere pragmatische Lösung ist ein automatischer Neustart via <a href=„https://wiki.ubuntuusers.de/rc.local/#Probleme-und-Loesungen“ class=„internal“>/etc/rc.local</a>:</p><pre class=„notranslate“># startet Privoxy 30 Sekunden nach Systemstart erneut (/bin/sleep 30 && /etc/init.d/privoxy restart)</pre><p>Alternativ kann auch ein Cronjob eingerichtet werden.</p></div><div class=„section_2“ readability=„17“><h3 id=„Midori-kann-sich-nicht-mit-lokalem-Privoxy-verbinden“>Midori kann sich nicht mit lokalem Privoxy verbinden</h3><p> Wenn man <a href=„https://wiki.ubuntuusers.de/Midori/“ class=„internal“>Midori</a> in Kombination mit einem lokalen Privoxy verwenden möchte, kann es passieren, dass Midori die Fehlermeldung „
Cannot connect to proxy (127.0.0.1)
“ oder „
Connection terminated unexpectedly
“ ausgibt. Hier sollte man zunächst versuchen, statt der IP-Adresse
localhost
als Rechnernamen zu benutzen. Hilft dies nicht, ändert man den Rechnernamen zurück auf
127.0.0.1
, und fügt der Konfigurationsdatei <strong>/etc/privoxy/config</strong> zwei Zeilen zu:</p><ul readability=„2“><li readability=„2“><p>im Abschnitt 4.1 (
## listen-address
) die Zeile: </p><pre class=„notranslate“>listen-address 127.0.0.1:8118</pre></li><li readability=„2“><p>im Abschnitt 4.7 (
## ACLs: permit-access and deny-access
) die Zeile: </p><pre class=„notranslate“>permit-access 127.0.0.1</pre></li></ul><p>Anschließend startet man Privoxy neu.</p></div><div class=„section_2“ readability=„9“><h3 id=„Chromium“>Chromium</h3><p> <a href=„https://wiki.ubuntuusers.de/Chromium/“ class=„internal“>Chromium</a> bzw. Google Chrome berücksichtigt unter GNOME und KDE die systemweiten Proxy-Einstellungen automatisch. Benutzer anderer Desktop-Umgebungen wie Xfce und LXDE oder alternativer Fenstermanager müssen selbst Hand anlegen, um Privoxy verwenden zu können: <a href=„https://wiki.ubuntuusers.de/Chromium/#Proxy-Nutzung“ class=„internal“>Chromium Proxy-Einstellungen</a>.</p></div></div><div class=„section_1“><ul readability=„-0“><li readability=„-0“><p><a href=„http://www.fabiankeil.de/privoxy-anleitung/“ rel=„nofollow“ class=„external“>Ausführliche Anleitung zu Privoxy</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/49/40/de.png“ alt=„{de}“/></p><ul readability=„0“><li readability=„0“><p><a href=„http://www.fabiankeil.de/sourcecode/uagen/“ rel=„nofollow“ class=„external“>Ein Werkzeug zum Erstellen von User-agents für Privoxy-actionfiles</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/35/40/gb.png“ alt=„{en}“/></p></li></ul></li><li readability=„-0“><p><a href=„http://andrwe.org/doku.php/scripting/bash/privoxy-blocklist“ rel=„nofollow“ class=„external“>privoxy-blocklist.sh</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/35/40/gb.png“ alt=„{en}“/></p><ul readability=„0“><li readability=„0“><p><a href=„https://forum.ubuntuusers.de/topic/howto-adblock-plus-filerlisten-in-privoxy-einb/“ class=„crosslink topic“>Howto: Adblock Plus Filterlisten in Privoxy einbinden</a></p></li></ul></li><li readability=„1“><p><a href=„http://pgl.yoyo.org/as/serverlist.php?hostformat=junkbuster“ rel=„nofollow“ class=„external“>Ad server hostnames</a> <img src=„https://media-cdn.ubuntu-de.org/wiki/attachments/25/47/download.png“ alt=„{dl}“/> - Liste von Peter Lowe</p></li><li readability=„1“><p><a href=„https://wiki.ubuntuusers.de/Proxyserver/“ class=„internal“>Proxyserver</a> - System für Proxy-Nutzung konfigurieren</p></li></ul></div>
</body>
</html>