View Poll Results: Was this Howto Useful to you

Voters
69. You may not vote on this poll
  • Yes

    55 79.71%
  • No

    11 15.94%
  • I Don't Care

    3 4.35%
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 51

Thread: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

  1. #1
    Join Date
    Feb 2006
    Location
    Fresno, CA, USA
    Beans
    301
    Distro
    Ubuntu 10.04 Lucid Lynx

    HOWTO: Squid Proxy & DansGuardian Internet Content Filter

    Hi All -

    This howto guide was created to describe setting up a Squid Proxy/DansGuardian server using Ubuntu 6.06 LTS installed with the LAMP server option. This guide assumes the user has previous knowledge of installing a LAMP server using Ubuntu and will not be covered. While each program may have a multitude of options to configure, this guide will show you how to configure the basics to get a server started.

    ***** Edgy Users: Squid Appears To Be Broken In Transparent Proxy Mode *****

    Installing Apache

    Start off by ensuring Apache Web Server is installed, if not, install it using this command
    Code:
    sudo aptitude install apache2
    Setting a Static IP Address

    Now make sure that you have a static IP address
    Code:
    sudo nano /etc/network/interfaces
    And change the following (bold) to match your network
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
    	address	192.168.1.2
    	netmask	255.255.255.0
    	gateway	192.168.1.1
    Press ctrl + x to exit, yes to save, and enter to keep the same file name. After saving the file, you must now restart the networking process
    Code:
    sudo /etc/init.d/networking restart
    Installing and Configuring Squid

    Next install the Squid Proxy Server
    Code:
    sudo aptitude install squid
    If you want to change the default port that squid listens on [3128], change the http_port tag using nano, making a backup copy first
    Code:
    sudo cp /etc/squid/squid.conf /etc/squid/squid.conf_backup
    sudo nano /etc/squid/squid.conf
    OK, now we'll setup who is allowed access to the proxy. Find the http_access section (should start around line 1860) Uncomment these 2 lines and add your network allocations
    Code:
    acl our_networks src 192.168.1.0/24 192.168.2.0/24
    http_access allow our_networks
    Optional = if you get a startup error 'FATAL: Could not determine fully qualified hostname. Please set visible_hostname' you will also need to modify the visible_hostname tag
    Code:
    visible_hostname localhost
    Save the file and close nano.

    Installing and Configuring DansGuardian

    To install DansGuardian, use the following command
    Code:
    sudo aptitude install dansguardian
    Once the package is installed, edit the following lines in the conf file to match, this will set DansGuardian to do basic filtering and use Squid as its proxy server.
    Code:
    # UNCONFIGURED
    filterip = 
    filterport = 8080
    proxyip = 127.0.0.1
    proxyport = 3128
    To configure banned/exception sites based on either phrases, ip addresses, urls, mime type, etc… you would need to edit one of the following files using nano. All files are located in /etc/dansguardian/
    Code:
    bannedextensionlist
    bannediplist
    bannedmimetypelist
    bannedphraselist
    bannedregexpurllist
    bannedsitelist
    bannedurllist
    banneduserlist
    
    exceptioniplist
    exceptionphraselist
    exceptionsitelist
    exceptionurllist
    exceptionuserlist
    exceptionvirusextensionlist
    exceptionvirusmimetypelist
    exceptionvirussitelist
    exceptionvirusurllist
    Restarting Squid and DansGuardian

    Whenever a file is edited, it is good practice to restart both Squid and DansGuardian services by using the following commands
    Code:
    sudo /etc/init.d/dansguardian stop
    sudo /etc/init.d/squid stop
    sudo /etc/init.d/squid start
    sudo /etc/init.d/dansguardian start
    ps –e | grep dansguardian ## to see if the service is running
    Now that Squid and DansGuardian are configured, test it by setting up your browser to use the proxy server with port 8080. A site that is blocked by default in DansGuardian is www.porn.com, if you get a page redirect then you’re good to go.

    Again, this howto assumes that you know how to install a LAMP server yourself. There are far more features that can be configured using Squid/DG, but they are beyond the scope of this howto. I hope this helps everyone and please note, I am no where near an expert on this subject. Safe surfing!
    Last edited by bmathis; February 2nd, 2008 at 08:25 AM.

  2. #2
    Join Date
    Oct 2006
    Location
    India, Chennai, Mylapore
    Beans
    268
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    hank you Bro,
    A very clear and crisp HOW TO
    Thank you once again
    Regards,
    Abhi Kalyan
    http://www.kgsplus.com

  3. #3
    Join Date
    Feb 2006
    Location
    Kentucky
    Beans
    417

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    I have got to set one of these up at work.
    Thanks,

    etank

  4. #4
    Join Date
    Oct 2006
    Location
    India, Chennai, Mylapore
    Beans
    268
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    Thank you for the tip. It waorked.
    Some more tweaking with the IP tables has now created a transparant proxy.
    Great work thank you bro
    Regards,
    Abhi Kalyan
    http://www.kgsplus.com

  5. #5
    Join Date
    Feb 2006
    Location
    Fresno, CA, USA
    Beans
    301
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    no problem... glad you could find this basic howto useful!

  6. #6
    Join Date
    Feb 2007
    Beans
    4

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    Hi.
    First of all, thank you for this excellent guide, it really helped me, and i've managed to get everything up and running...
    Now, is there anyway to add a user but only with access to a restricted list of sites ?

    Thanks in advance...

    []
    SergioLopes

  7. #7
    Join Date
    Feb 2007
    Beans
    17

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    When I try to do the installation of dansguardian, I'm told that there is no such package. See output below.

    ~$sudo aptitude install dansguardian

    Reading package lists... Done
    Building dependency tree... Done
    Reading extended state information
    Initializing package states... Done
    Building tag database... Done
    Couldn't find any package whose name or description matched "dansguardian"
    No packages will be installed, upgraded, or removed.
    0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0B of archives. After unpacking 0B will be used.

    Ok, what dumb thing am I doing? (I'm extremely new to ubuntu, and administering linux/unix operating systems in general.)

    Michael

  8. #8
    Join Date
    Feb 2007
    Beans
    4

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    Try this:

    sudo gedit /etc/apt/sources.list

    find and uncomment/add this lines:

    # deb http://pt.archive.ubuntu.com/ubuntu/ edgy universe
    # deb -src http://pt.archive.ubuntu.com/ edgy universe

    then

    sudo apt-get update
    sudo aptitude install dansguardian

  9. #9
    Join Date
    Feb 2007
    Beans
    17

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    Fantastic! Yes, that took care of it. Thank you for that, and thank you bmathis for the instructions. It's up and running!

  10. #10
    Join Date
    Jul 2006
    Beans
    250
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Squid Proxy & DansGaurdian Internet Content Filter

    hey BMATHIS,

    for the rest of us that use Edgy please tell them that squid is broken in transparent proxy mode

    not usre if ur using it in transparent mode but if you are at least you know - it's not an issue for 6.06 or feisty
    www.endorsedbylinux.org -
    HTML Code:
    [B]www.linuxpetitions.org[/B]
    Letting Company's know we do give a damn about our software!
    Please contribute code and time to make these sites work

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •