{"id":296,"date":"2007-09-08T02:16:00","date_gmt":"2007-09-07T18:16:00","guid":{"rendered":"http:\/\/www.akuadi.org\/?p=22"},"modified":"2007-09-08T02:16:00","modified_gmt":"2007-09-07T18:16:00","slug":"basic-configuration-of-squidguard","status":"publish","type":"post","link":"https:\/\/akuadi.org\/life\/blog\/2007\/09\/08\/basic-configuration-of-squidguard\/","title":{"rendered":"Basic Configuration of squidGuard"},"content":{"rendered":"<p><center> <\/p>\n<table width=\"97%\">\n<tbody>\n<tr>\n<td align=\"left\">  Once SquidGuard is successfully installed, you want to configure the software according to your needs. A sample configuration has been installed in the  default directory  <tt>\/usr\/local\/squidGuard<\/tt> (or whatever directory you pointed you intallation to).<br \/>Below you find three examples for the basic configuration of SquidGuard.<\/p>\n<ol>\n<li> Most simple configuration<br \/>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid rgb(136, 136, 136); background-color: rgb(34, 52, 153);\"> <span style=\"color:white;\">Most simple config uration: one category, one rule for all<\/span> <\/td>\n<\/tr>\n<tr style=\"color: rgb(0, 0, 0);\">\n<td>\n<pre>#<br \/># CONFIG FILE FOR SQUIDGUARD<br \/>#<br \/><br \/>dbhome \/usr\/local\/squidGuard\/db<br \/>logdir \/usr\/local\/squidGuard\/logs<br \/><br \/>dest porn {<br \/>      domainlist porn\/domains<br \/>      urllist porn\/urls<br \/>      }<br \/><br \/>acl {<br \/>      default {<br \/>              pass !porn all<br \/>              redirect http:\/\/localhost\/block.html<br \/>      }<br \/>}<br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Make always sure that the very first line of your squidGuard.conf is not empty!<br \/>The entries have the following meaning:<\/p>\n<table border=\"1\" width=\"80%\">\n<tbody>\n<tr>\n<td width=\"15%\"><tt>dbhome<\/tt><\/td>\n<td>Location of the blacklists<\/td>\n<\/tr>\n<tr>\n<td><tt>logdir<\/tt><\/td>\n<td>Location of the logfiles<\/td>\n<\/tr>\n<tr>\n<td><tt>dest<\/tt><\/td>\n<td>Definition of a category to block. You can         enter the domain and url file along with a regular expression list         (talk about regular expressions later on).<\/td>\n<\/tr>\n<tr>\n<td><tt>acl<\/tt><\/td>\n<td>The actual blocking defintion. In our example only         the default is displayed. You can have more than one <tt>acl<\/tt>         in place. The category porn you defined in <tt>dest<\/tt> is          blocked by the expression <tt>!porn<\/tt>. You have to add the         identifier <tt>all<\/tt> after the blocklist or your users will         not be able to surf anyway.<br \/>       The <tt>redirect<\/tt> directive is madatory! You must tell         SquidGuard which page to display instead of the blocked one.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>>  Choosing more than one category to block<\/p>\n<p>First you define your categories. Just like you did above for porn. For example:<\/p>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid rgb(136, 136, 136); background-color: rgb(34, 52, 153);\">  <span style=\"color:white;\">Defining three categories for blocking<\/span> <\/td>\n<\/tr>\n<tr style=\"color: rgb(0, 0, 0);\">\n<td>\n<pre>dest adv {<br \/>      domainlist      adv\/domains<br \/>      urllist         adv\/urls<br \/>}<br \/>dest porn {<br \/>      domainlist      porn\/domains<br \/>      urllist         porn\/urls<br \/>}<br \/>dest warez {<br \/>      domainlist      warez\/domains<br \/>      urllist         warez\/urls<br \/>}<br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Now your <tt>acl<\/tt> looks like that:<\/p>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td>\n<pre><span style=\"color: rgb(0, 0, 0);\">acl {<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">        default {<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">                pass    !adv !porn !warez all<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">                redirect http:\/\/localhost\/block.html<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">                }<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">}<\/span><br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>Whitelisting\n<p>Sometimes there is a demand to allow specific URLs and domains although they are part of the blocklists for a good reason. In this case you  want to whitelist these domains and URLs.<\/p>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid rgb(136, 136, 136); background-color: rgb(34, 52, 153);\">  <span style=\"color:white;\">Defining a whitelist<\/span> <\/td>\n<\/tr>\n<tr style=\"color: rgb(0, 0, 0);\">\n<td>\n<pre>dest white {<br \/>      domainlist      white\/domains<br \/>      urllist         white\/urls<br \/>}<br \/><br \/>acl {<br \/>      default {<br \/>              pass    white !adv !porn !warez all<br \/>              redirect http:\/\/localhost\/block.html<br \/>              }<br \/>}<br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In this example we assumed that your whitelists are located in a directory called <tt>white<\/tt> whithin the blacklist directory you specified with <tt>dbhome<\/tt>.<br \/>Make sure that your <tt>white<\/tt> identifier is the first in the row of the <tt>pass<\/tt> directive. It must not have an exclamation mark in front (otherwise all entries belonging to <tt>white<\/tt> will be blocked, too).<\/p>\n<\/li>\n<li>Initializing the blacklists\n<p>Before you start up your squidGuard you should initialize the blacklists i.e. convert them from the textfiles to db files. Using the db format will speed up the checking and blocking.<br \/>The initialization is performed by the following command:<\/p>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td style=\"border-bottom: 1px solid rgb(136, 136, 136); background-color: rgb(34, 52, 153);\"> <span style=\"color:white;\">Initializing the b lacklists<\/span> <\/td>\n<\/tr>\n<tr>\n<td>\n<pre><span style=\"color: rgb(0, 0, 0);\">squidGuard -C all<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">chown -R <squiduser> \/usr\/local\/squidGuard\/db\/*<\/squiduser><\/span><br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The second command ensures that your squid is able to access the blacklists. Please for <squiduser> the uid of your squid.<br \/>Depending on the size of your blacklists and the power of your computer this may take a while. If anything is running fine you should see something like the following output in your logfile:<\/p>\n<p><\/squiduser><\/p>\n<table style=\"border: 1px solid rgb(68, 85, 187); background-color: rgb(242, 255, 240);\" cellpadding=\"0\" cellspacing=\"0\" width=\"75%\">\n<tbody>\n<tr>\n<td>\n<pre><span style=\"color: rgb(0, 0, 0);\">2006-01-29 12:16:14 [31977] squidGuard 1.2.0p2 started (1138533256.959)<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">2006-01-29 12:16:14 [31977] db update done<\/span><br \/><span style=\"color: rgb(0, 0, 0);\">2006-01-29 12:16:14 [31977] squidGuard stopped (1138533374.571)<\/span><br \/><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>If you look into the directories holding the files <tt>domains<\/tt> and <tt>urls<\/tt> you see that additional files have been created: <tt>domains.db<\/tt> and <tt>urls.db<\/tt>. These new files must not be empty!<br \/>Only those files are converted you specified to block or whitelist in your <tt>squidGuard.conf<\/tt> file.<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.squidguard.org\/Doc\/verify.html\" target=\"_blank\" rel=\"noopener\">SquidGuard<\/a><\/td>\n<\/tr>\n<tr>\n<td style=\"vertical-align: top;\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/center><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once SquidGuard is successfully installed, you want to configure the software according to your needs. A sample configuration has been installed in the default directory \/usr\/local\/squidGuard (or whatever directory you pointed you intallation to).Below you find three examples for the basic configuration of SquidGuard. Most simple configuration Most simple config uration: one category, one rule [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-basic-configuration-of-squidguard"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":0,"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"wp:attachment":[{"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/akuadi.org\/life\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}