Difference between revisions of "SquidGuard: Instalasi di Ubuntu 16.04"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 10: | Line 10: | ||
vi /etc/squid3/squid.conf | vi /etc/squid3/squid.conf | ||
− | + | ||
− | visible_hostname your-machines-hostname | + | visible_hostname your-machines-hostname |
− | http_port 3128 | + | http_port 3128 |
− | cache_dir ufs /var/spool/squid 1000 16 256 | + | cache_dir ufs /var/spool/squid 1000 16 256 |
− | cache_access_log /var/log/squid/access.log | + | cache_access_log /var/log/squid/access.log |
− | |||
− | |||
− | |||
− | |||
− | + | # bisa juga menggunakan localnet | |
− | + | acl intranet 10.50.0.0/32 | |
+ | http_access allow intranet | ||
+ | sudo service restart squid3 | ||
− | + | Squid bisa digunakan pada port 3128 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==Instalasi SquidGuard== | |
+ | |||
+ | sudo su | ||
+ | apt-get install squidguard | ||
+ | mkdir /opt/3rdparty | ||
+ | |||
+ | Sumber blacklist | ||
+ | |||
+ | http://urlblacklist.com/ | ||
+ | http://www.shallalist.de | ||
+ | |||
+ | Download | ||
+ | |||
+ | sudo wget http://www.shallalist.de/Downloads/shallalist.tar.gz | ||
+ | sudo tar xzf shallalist.tar.gz | ||
+ | sudo cp -a /opt/3rdparty/BL/porn/var/lib/squidguard/db | ||
+ | sudo cp -a /opt/3rdparty/BL/adv/var/lib/squidguard/db | ||
+ | sudo cp -a /opt/3rdparty/BL/spyware /var/lib/squidguard/db | ||
+ | |||
+ | Tambahkan squidGuard ke squid | ||
+ | |||
+ | vi /etc/squid3/squid.conf” | ||
+ | |||
+ | url_rewrite_program /usr/bin/squidGuard | ||
+ | |||
+ | Cek | ||
+ | |||
+ | sudo squidGuard -C all | ||
+ | chown -R proxy:proxy /var/lib/squidguard/db | ||
+ | vi /etc/squid3/squid.conf” | ||
+ | |||
+ | url_rewrite_program /usr/bin/squidGuard | ||
+ | |||
+ | |||
+ | Edit konfigurasi squidguard | ||
+ | |||
+ | sudo cp /etc/squidguard/squidGuard.conf /etc/squidGuard.conf.bak | ||
+ | sudo rm /etc/squidguard/squidGuard.conf | ||
+ | sudo vi /etc/suqidgurd/squidGuard.conf | ||
− | |||
− | |||
− | |||
− | |||
Copy and paste this, | Copy and paste this, | ||
− | # | + | |
− | # CONFIG FILE FOR SQUIDGUARD | + | # |
− | # | + | # CONFIG FILE FOR SQUIDGUARD |
− | dbhome /usr/local/squidGuard/db | + | # |
− | logdir /usr/local/squidGuard/logs | + | dbhome /usr/local/squidGuard/db |
− | dest porn { | + | logdir /usr/local/squidGuard/logs |
− | domainlist porn/domains | + | dest porn { |
− | urllist porn/urls | + | domainlist porn/domains |
− | } | + | urllist porn/urls |
− | dest adv { | + | } |
− | domainlist adv/domains | + | dest adv { |
− | urllist adv/urls | + | domainlist adv/domains |
− | } | + | urllist adv/urls |
− | dest spyware { | + | } |
− | domainlist spyware/domains | + | dest spyware { |
− | urllist spyware/urls | + | domainlist spyware/domains |
− | } | + | urllist spyware/urls |
− | acl { | + | } |
− | default { | + | acl { |
− | pass !porn !adv !spyware all | + | default { |
− | redirect http://localhost/block.html | + | pass !porn !adv !spyware all |
− | } | + | redirect http://localhost/block.html |
− | } | + | } |
− | + | } | |
− | sudo echo "http://www.pornhub.com 10.50.55.10/- - GET" | squidGuard -c /etc/squidguard/squidGuard.conf –d | + | |
+ | Test squidguard, jalankan | ||
+ | |||
+ | sudo echo "http://www.pornhub.com 10.50.55.10/- - GET" | squidGuard -c /etc/squidguard/squidGuard.conf –d | ||
You should see, | You should see, |
Revision as of 09:44, 23 June 2017
Squid
apt update sudo apt-get upgrade sudo apt-get install squid3
Konfigurasi squid
vi /etc/squid3/squid.conf
visible_hostname your-machines-hostname http_port 3128 cache_dir ufs /var/spool/squid 1000 16 256 cache_access_log /var/log/squid/access.log
# bisa juga menggunakan localnet acl intranet 10.50.0.0/32 http_access allow intranet
sudo service restart squid3
Squid bisa digunakan pada port 3128
Instalasi SquidGuard
sudo su apt-get install squidguard mkdir /opt/3rdparty
Sumber blacklist
http://urlblacklist.com/ http://www.shallalist.de
Download
sudo wget http://www.shallalist.de/Downloads/shallalist.tar.gz sudo tar xzf shallalist.tar.gz sudo cp -a /opt/3rdparty/BL/porn/var/lib/squidguard/db sudo cp -a /opt/3rdparty/BL/adv/var/lib/squidguard/db sudo cp -a /opt/3rdparty/BL/spyware /var/lib/squidguard/db
Tambahkan squidGuard ke squid
vi /etc/squid3/squid.conf”
url_rewrite_program /usr/bin/squidGuard
Cek
sudo squidGuard -C all chown -R proxy:proxy /var/lib/squidguard/db vi /etc/squid3/squid.conf”
url_rewrite_program /usr/bin/squidGuard
Edit konfigurasi squidguard
sudo cp /etc/squidguard/squidGuard.conf /etc/squidGuard.conf.bak sudo rm /etc/squidguard/squidGuard.conf sudo vi /etc/suqidgurd/squidGuard.conf
Copy and paste this,
# # CONFIG FILE FOR SQUIDGUARD # dbhome /usr/local/squidGuard/db logdir /usr/local/squidGuard/logs dest porn { domainlist porn/domains urllist porn/urls } dest adv { domainlist adv/domains urllist adv/urls } dest spyware { domainlist spyware/domains urllist spyware/urls } acl { default { pass !porn !adv !spyware all redirect http://localhost/block.html } }
Test squidguard, jalankan
sudo echo "http://www.pornhub.com 10.50.55.10/- - GET" | squidGuard -c /etc/squidguard/squidGuard.conf –d
You should see, squidGuard ready for requests squidGuard stopped If there are errors, it will tell you.. The most likely errors you’ll run into are permission issues.. If it gives you permission issues with your database, make sure that you set the user and group named “proxy” ownership. You can tell that by “sudo ls -l /var/lib/squidguard/db*”
You can now use the Firefox browser you setup to use with your proxy server to make sure you are blocking porn and ads. For better protection, I recommend using the blacklist from, http://urlblacklist.com/