Senin, 07 Mei 2012

Bandwidth Management with Squid






Squid is free and opensource proxy server/cache server software. Squid is normally run on the operating system GNU/Linux. Squid also has advantages regulate and restrict bandwidth based on the extension, for example, a server is configured to limit the client uses only 100kbps bandwidth to download files ending in .flv, .avi, and so forth.

Get to the stages of installation:

  • I recommend to install squid from source, so it can be configured at compile, because by default squid does not support delay pool as a regulator of bandwidth.
  • To obtain maximum performance, create a separate partition with a size of about 300MB, name the partition "/cache" (without the quotes).  
  • Add/create a user "squid" into the system:
    useradd -d /cache/ -r -s /dev/null squid >/dev/null 2>&1 
  • Download squid source using the link below (as of this writing, the latest release is version 1.3.11 squid) :
    http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.11.tar.gz
  • Extract the file .tar.gz :
    tar xzpf squid-3.1.11.tar.gz 
  • compile and install squid, installation folder is /opt
    ./configure --prefix=/opt/squid --exec-prefix=/opt/squid --enable-delay-pools --enable-cache-digests --enable-poll --disable-ident-lookups --enable-truncate --enable-removal-policies
    make all
    make install
  • edit squid.conf (located in /opt/squid/etc/squid.conf). Example : http://pastebin.com/WRNULTWX
  • configure squid folder :
    mkdir /var/log/squid/
    chown squid:squid /var/log/squid/
    chmod 770 /var/log/squid/
    chown -R squid:squid /opt/squid/
    chown -R squid:squid /opt/squid/
  • execute squid command to create the cache folder :
    /opt/squid/bin/squid -z
  • run squid :
    /opt/squid/bin/squid 
Squid will run on port 3128.

Tidak ada komentar:

Posting Komentar