This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

keyword filtering with http proxy

I am sure this question has come around more than once, but I could not find an answer when I did a search. We do not have the Surf Protection but we wish to use some filtering options of the squid proxy server. We are currently using squid just as http proxy/cache. We would like to find a way to filter sites based on keywords. For instance if we wanted to block all access to any sites with AOL or aim in the URL. Can this be done? We used to use Netscape proxy server, which allowed you to setup keyword filtering, and would block access to containing the defined words in the URL. Is there a way I can add this to squid? If there is could someone possibly provide detailed information on this? I thank you in advance for any advice or support that you can add to this.
Sincerely,
Ben Hambleton


This thread was automatically locked due to age.
  • First you should log into  your ASL using SSH, and as root edit the squid.conf-default file.

    #--------------------------
    vi /var/chroot-squid/etc/squid.conf-default 
    #--------------------------

    Look for the acl declarations and add the following lines:

    #-----------------------------
    acl blocked url_regex "/etc/bldom.txt"
    acl deniedtypes url_regex "/etc/deniedtypes"
    #-----------------------------

    where /etc/bldom.txt is the file that lists the domains you want to block. And /etc/deniedtypes refers to the extensions you want to block.

    Then look for the http_access list and insert the lines below

    #-----------------------------
    http_access deny blocked
    http_access deny deniedtypes
    #-----------------------------

    Save changes and vi 
    "/var/chroot-squid/etc/bldom.txt" and 
    "/var/chroot-squid/etc/deniedtypes.txt"

    ------------------------
    #EXAMPLE bldom.txt 
    audiogalaxy.com
    datafull.com/arcade 
    sex
    aol
    aim
    kazaa.com
    ------------------------

    ------------------------
    #EXAMPLE deniedtypes.txt
    \.afx$
    \.asf$
    \.asx$
    \.au$
    \.avi$
    \.divx$
    \.m3u$
    \.mov$
    \.mp2$
    \.mp3$
    \.mpeg$
    \.mpg$
    \.qt$
    \.ra$
    \.ram$
    \.rm$
    \.viv$
    \.vivo$
    \.vob$
    \.vqf$
    \.wav$
    \.wma$
    \.wmv$ 
    \.vbs$
    \.shs$
    \.pif$
    -------------------

    browse into de Webmin and restart Http Proxy, and you're blocking !!!