Qgelm

Privoxy

Originalartikel

Backup

<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&#252;r die folgenden

Ubuntu-Versionen getestet:</h3></div><div class=„box knowledge“><h3 class=„box knowledge“>Zum Verst&#228;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 &#252;berpr&#252;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}“/> &#8211; der Name steht f&#252;r <strong>Privacy Enhancing Proxy</strong> &#8211; ist zum Schutz der Privatsph&#228;re beim Internet-Surfen gedacht. Mit Privoxy k&#246;nnen mit wenig Aufwand aufgerufene Webseiten nach eigenen Regeln gefiltert werden. So k&#246;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&#246;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&#223;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 &#252;ber die ausf&#252;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>). &#196;nderungen werden automatisch &#252;bernommen werden. Wie man den Privoxy-Dienst steuert, erf&#228;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&#228;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 &#252;ber den Port <code class=„notranslate“>443</code> (HTTPS), die als direkte Anfragen behandelt werden sollen. Will man eine Weiterleitung ausschlie&#223;lich f&#252;r bestimmte Domains einrichten, sieht die Zeile so aus:</p><pre class=„notranslate“>forward .i2p localhost:4444</pre><p>Dies leitet alle Aufrufe f&#252;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&#228;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&#252;gung stehen, sondern auch von anderen Rechnern im LAN erreichbar sein, so muss die Adresse ge&#228;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 &#252;ber die Pseudo-Adresse <code class=„notranslate“>http://p.p/</code> steuern k&#246;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&#252;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“>&lt;Server-IP&gt;:8118</pre><p> falls man Privoxy im LAN eingerichtet hat. Je nach Desktop-Umgebung k&#246;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&#252;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 &#228;ndern, etwa eine Werbe-URL hinzuf&#252;gen, die Privoxy nicht selbst erkennt, geht das &#252;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 &amp; 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&#252;hrt von einem Punkt, aber ohne ein eventuelles <em>„<code class=„notranslate“>http://www</code>“</em>. Das Resultat sind z.B. Eintr&#228;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&#252;gt man die Werbe-URL hinzu.</p><p>Analog tr&#228;gt man Seiten, die irrt&#252;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, &#252;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 &#252;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&#252;r Privoxy nutzen zu k&#246;nnen, kann man ein Shell-Skript nutzen. Damit das Skript korrekt arbeiten kann, m&#252;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&#223;erdem sollte die Datei <strong>/etc/privoxy/config</strong> vorab auf Eintr&#228;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&lt;at&gt;renona-studios&lt;dot&gt;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 ] &amp;&amp; echo -e „Root privileges needed. Exit.\n\n“ &amp;&amp; usage &amp;&amp; exit 1 # check whether an instance is already running [ -e ${TMPDIR}/${TMPNAME}.lock ] &amp;&amp; echo „An Instance of ${TMPNAME} is already running. Exit“ &amp;&amp; exit DBG=0 function debug() { [ ${DBG} -ge ${2} ] &amp;&amp; echo -e „${1}“ } function main() { cpoptions=„“ [ ${DBG} -gt 0 ] &amp;&amp; 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} &gt;${TMPDIR}/wget-${url\#}.log 2&gt;&amp;1 debug „$(cat ${TMPDIR}/wget-${url\#}.log)“ 2 debug „.. downloading done.“ 0 [ „$(grep -E '^\[Adblock.*\]$' ${file})“ == „“ ] &amp;&amp; echo „The list recieved from ${url} isn't an AdblockPlus list. Skipped“ &amp;&amp; continue # convert AdblockPlus list to Privoxy list # blacklist of urls debug „Creating actionfile for ${list} …“ 1 echo -e „{ +block{${list}} }“ &gt; ${actionfile} sed '/^!.*/d;1,1 d;/^@@.*/d;/\$.*/d;/#/d;s/\./\\./g;s/\?/\\?/g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&amp;:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} &gt;&gt; ${actionfile} debug „… creating filterfile for ${list} …“ 1 echo „FILTER: ${list} Tag filter of ${list}“ &gt; ${filterfile} # set filter for html elements sed '/^#/!d;s/^##g;s/^#\(.*\)\[.*\]\[.*\]*/s|&lt;([a-zA-Z0-9]+)\\s+.*id=.?\1.*&gt;.*&lt;\/\\1&gt;||g/g;s/^#\(.*\)/s|&lt;([a-zA-Z0-9]+)\\s+.*id=.?\1.*&gt;.*&lt;\/\\1&gt;||g/g;s/^\.\(.*\)/s|&lt;([a-zA-Z0-9]+)\\s+.*class=.?\1.*&gt;.*&lt;\/\\1&gt;||g/g;s/^a\[\(.*\)\]/s|&lt;a.*\1.*&gt;.*&lt;\/a&gt;||g/g;s/^\([a-zA-Z0-9]*\)\.\(.*\)\[.*\]\[.*\]*/s|&lt;\1.*class=.?\2.*&gt;.*&lt;\/\1&gt;||g/g;s/^\([a-zA-Z0-9]*\)#\(.*\):.*[:[^:]]*[^:]*/s|&lt;\1.*id=.?\2.*&gt;.*&lt;\/\1&gt;||g/g;s/^\([a-zA-Z0-9]*\)#\(.*\)/s|&lt;\1.*id=.?\2.*&gt;.*&lt;\/\1&gt;||g/g;s/^\[\([a-zA-Z]*\).=\(.*\)\]/s|\1^=\2&gt;||g/g;s/\^/[\/\&amp;:\?=_]/g;s/\.\([a-zA-Z0-9]\)/\\.\1/g' ${file} &gt;&gt; ${filterfile}

	debug "... filterfile created - adding filterfile to actionfile ..." 1
	echo "{ +filter{${list}} }" &gt;&gt; ${actionfile}
	echo "*" &gt;&gt; ${actionfile}
	debug "... filterfile added ..." 1
	debug "... creating and adding whitlist for urls ..." 1
	# whitelist of urls
	echo "{ -block }" &gt;&gt; ${actionfile}
	sed '/^@@.*/!d;s/^@@//g;/\$.*/d;/#/d;s/\./\\./g;s/\?/\\?/g;s/\*/.*/g;s/(/\\(/g;s/)/\\)/g;s/\[/\\[/g;s/\]/\\]/g;s/\^/[\/\&amp;:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} &gt;&gt; ${actionfile}
	debug "... created and added whitelist - creating and adding image handler ..." 1
	# whitelist of image urls
	echo "{ -block +handle-as-image }" &gt;&gt; ${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/\^/[\/\&amp;:\?=_]/g;s/^||/\./g;s/^|/^/g;s/|$/\$/g;/|/d' ${file} &gt;&gt; ${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 &gt; ${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 &gt; ${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 ] &amp;&amp; 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" ] &amp;&amp; exit 0
		rm -rf ${CONFDIR}/*.script.{action,filter} &amp;&amp; \
		sed '/^actionsfile .*\.script\.action$/d;/^filterfile .*\.script\.filter$/d' -i ${CONFDIR}/config &amp;&amp; \
		echo "Lists removed." &amp;&amp; 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" &gt;&amp;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 ] &amp;&amp; rm -r ${TMPDIR} [ ${DBG} -eq 2 ] &amp;&amp; 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&#252;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 &#8211; bedingt durch den Zwischenspeicher (Cache) &#8211; ein Neustart des Webbrowsers. Das Skript kann man sp&#228;ter (beispielsweise ein- bis zweimal im Monat) immer wieder erneut ausf&#252;hren, um die Filterlisten zu aktualisieren. Fortgeschrittene k&#246;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&#228;ndig und r&#252;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&#252;tze im Rahmen des ehemaligen Projekts „KinderTux“ sehr elegant umgesetzt hat. Es werden zwei Dateien mit Regeln ben&#246;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 &#8211; am besten nach R&#252;cksprache mit den Kindern &#8211; 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&#252;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&#228;ge (durch ein <strong>#</strong> am Zeilenanfang) und f&#252;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 &#8211; bedingt durch den Zwischenspeicher (Cache) &#8211; ein Neustart des Webbrowsers. Weitere erlaubte Webseiten werden sp&#228;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&#252;r Kinder (die bereits lesen k&#246;nnen) verst&#228;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&#228;che, mit der man bei KinderTux neue Adressen bequem hinzuf&#252;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) &#252;berfl&#252;ssig machen kann.</p></div><div class=„section_1“ readability=„7“><h2 id=„Funktion-ueberpruefen“>Funktion &#252;berpr&#252;fen</h2><p> Die Aktivit&#228;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&#252;gbar</h3><p> Immer wieder berichten Anwender, dass Privoxy beim Systemstart scheinbar nicht automatisch gestartet wird. Zwar l&#228;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&#246;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 &amp;&amp; /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&#246;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&#228;chst versuchen, statt der IP-Adresse

localhost

als Rechnernamen zu benutzen. Hilft dies nicht, &#228;ndert man den Rechnernamen zur&#252;ck auf

127.0.0.1

, und f&#252;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&#223;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&#252;cksichtigt unter GNOME und KDE die systemweiten Proxy-Einstellungen automatisch. Benutzer anderer Desktop-Umgebungen wie Xfce und LXDE oder alternativer Fenstermanager m&#252;ssen selbst Hand anlegen, um Privoxy verwenden zu k&#246;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&#252;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&#252;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&#252;r Proxy-Nutzung konfigurieren</p></li></ul></div>

</body>

</html>

Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information