Changes

From Amahi Wiki
Jump to: navigation, search
3,340 bytes added ,  03:35, 25 May 2019
no edit summary
<!-- b><i>This page is crated automaticaly by section will document how to run your HDA as a script.This part is commented network wide ad-blocking tool, utilising DNS redirects and shall not show--><!--At the top of the page can be vissible one of the following tags.a small pixel server.--> {{WorkInProgress}}<!--{{NeedsUpdate}}--br /><!--{{NeedsMerge | [[Main Page]]}}--><!--{{NeedsExpantion}}--><!--{{NeedsDelete |[[Main Page]]}}--><!--Please remove or place comment accordingly--/i><!--Your text bellow this line--/b>
Outline for using The work here was based on: https://sfxpt.wordpress.com/2011/02/21/the HDA as a network-wide best-ad-blocking tool:-method/.
This Pixelserv is a webserver which simply serves 1x1 blank pixels. By redirecting web requests for adverts to our pixelserver, ads are replaced by this 1x1 pixel leaving the target webpage intact. This will work in progress and currently only shows on all devices across your network, removing the very basic stepneed for software-by step to doing thisbased solutions on each device.
A shell script get-adlist.sh will update the list of blocked domains (stored as /etc/dnsmasq.adblock.conf) whever you run it. You can also manually edit the list and remove domains that you wish to see (in the case of wrongly blocked domains).
= Fedora 19 =
Create a new virtual interface with new IP *issues with Fedora 19 keeping it's config*
Bind Apache to the original IP /etc/httpd/conf/= Fedora 19 or Greater=
Download Pixelserv and modify Precusors - *You'll need net-tools installed to use the new virtual ifconfig yum install net-tools* You also need a file editing tool. Vi will suffice, however nano is a bit more user friendly. yum install nano* This guide assumes your network interface is named p2p1 and your HDA IPaddress is 192.168.1.2. Check with ifconfig, and change this guide where neccessary.
Setup Pixelserv to load at boot as a service
==Get Ad List==This part of the process creates a file on your HDA which identifies where adverts originate from, and where to redirect them to.* Create script to download an advert a new shell file nano /usr/local/bin/get-ad-block-list.sh
Create DNSMasq config that redirects * Copy and paste the following into it #!/bin/sh # Download the DNSmasq formatted ad-block list hosts to Pixelserv IP address curl <nowiki>"http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext"</nowiki> | sed "s/127\.0\.0\.1/192.168.1.99/" > /etc/dnsmasq.adblock.conf # Restart DNSmasq service dnsmasq restart
Enjoy * Change permissions on the shell file chmod -v 755 /usr/local/bin/get-ad-block-list.sh * Run the shell file /usr/local/bin/get-ad-block-list.sh ==Change DNSMasq config==DNSMasq reads the adlist file and redirects DNS requests as configured.* Add the block list to DNSMasq configuration echo "conf-file=/etc/dnsmasq.adblock.conf" >> /etc/dnsmasq.conf * Restart DNSMasq service dnsmasq restart ==Bind Apache to main IP address==By default, Apache will try to use all IP addresses. We require an IP address later in the process and so we have to tell Apache only to use the standard HDA address.* Edit the Apache config file using a file editor: nano /etc/httpd/conf/httpd.conf * Add your HDAs IP address to this section in the conf file: # # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the <VirtualHost> # directive. # # Change this to Listen on specific IP addresses as shown below to # prevent Apache from glomming onto all bound IP addresses. # #Listen 12.34.56.78:80 Listen 192.168.1.2:80 * Restart Apache service httpd restart  ==Pixel Server==The pixel server is where we're redirecting adverts to. A simple 1x1 pixel is served on the IP address specified.* You need to download Pixelserv to the HDA: wget <nowiki>http://proxytunnel.sourceforge.net/files/pixelserv.pl.txt</nowiki>  * Move and rename the Pixelserv binary: mv pixelserv.pl.txt /usr/local/bin/pixelserv * Edit pixelserv using a file editing program of your choice nano /usr/local/bin/pixelserv * Change the IP address to a free network on ALL devicesone of your choice (eg. 192.168.1.99) $sock = new IO::Socket::INET ( LocalHost => '0.0.0.0',change to $sock = new IO::Socket::INET ( LocalHost => '192.168.1.99', * Change permissions chmod 755 /usr/local/bin/pixelserv * Create file /etc/init.d/pixelserv nano /etc/init.d/pixelservand copy the following to it (changing the IP addresses and interfaces where neccessary): #!/bin/sh # /etc/init.d/pixelserv # # Carry out specific functions when asked to by the system case "$1" in start) echo "Creating Interface " ifconfig p2p1:0 192.168.1.99 echo "Starting pixelserv " /usr/local/bin/pixelserv & ;; stop) echo "Stopping script pixelserv" pkill -9 pixelserv & echo "Killing Interface " ifconfig p2p1:0 down ;; *) echo "Usage: /etc/init.d/pixelserv {start|stop}" exit 1 ;; esac exit 0 * Change permissions chmod 755 /etc/init.d/pixelserv * To bring the new interface up and start pixelserv /etc/init.d/pixelserv start
* To stop pixelserv and close the virtual interface
/etc/init.d/pixelserv stop
To keep the list updated weekly, do the following:
ln -s /usr/local/bin/get-ad-block-list.sh /etc/cron.daily/get-ad-block-list
<!--Your text above this line--><!--This page must bellong to one of the following categories please remove comment--><!--[[category:Apps]]--><!--[[Category:Fedora]]--><!--[[Category:Platform]]-Enjoy ad-><free network on ALL devices!--[[Category:Pro Version]]--><!--[[Category:Services]]--><!--[[Category:VPN]]-->
12,424

edits