Syarat untuk mudahnya installasi :
- Module Web Proxy Server telah terinstall
1. Installasi dependencies & needed packages
   # yum install automake gcc glibc-devel e2fsprogs-devel sharutils perl autoconf make sudo wget

2. Download Paket SquidSTABLE9.tar.gz
   # cd /usr/local/src
   # wget http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz

3. Ekstak semua file yang diperlukan
   # tar zxvf squid-2.7.STABLE9.tar.gz
   # cd squid-2.7.STABLE9

4. Copykan Paket Patched (4 files) untuk Squid2.7STABLE9 yang ada di folder "File"
   kemudian lakukan patching dengan perintah berikut ini :
   # yum install patch
   # patch -p0 < aggressive.patch && patch -p0 < loop.patch && patch -p0 < ignore_must_revalidate.patch && patch -p0 < ignore-no-store_new.patch

5. Cek info cpu proxy nya dan sesuaikan dengan processor yang anda pakai
   # cat /proc/cpuinfo
   Link untuk mengetahui CHOST dan CFLAGS ;
   untuk AMD http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD
   untuk INTEL http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel atau http://www.gentoo-wiki.info/Safe_Cflags
   dalam contoh ini CHOST & CFLAGS komputer saya adalah
   CHOST="i686-pc-linux-gnu"
   CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"

6. Compile squid
   # CHOST="i686-pc-linux-gnu" \
     CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer" \
     ./configure --enable-stacktraces --enable-truncate --prefix=/usr --exec_prefix=/usr --bindir=/usr/sbin \
     --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/var/spool/squid \
     --datadir=/usr/share/squid --enable-async-io --with-pthreads --enable-storeio=coss,aufs --enable-linux-netfilter \
     --enable-epoll --enable-removal-policies=lru,heap --enable-snmp --enable-delay-pools --with-aio --with-dl \
     --enable-cache-digests --with-large-files --with-maxfd=65535 --enable-http-violations --enable-follow-x-forwarded-for \
     --enable-large-cache-files --enable-err-languages=English --enable-default-err-language=English --disable-linux-tproxy \
     --disable-ssl --disable-select --disable-poll --disable-unlinkd --disable-dependency-tracking --disable-htcp --disable-auth \
     --disable-ident-lookups --disable-wccp --disable-wccpv2 --enable-dlmalloc --enable-arp-acl \
     --enable-htcp --enable-referer-log --enable-useragent-log

   # make all && make install

   atau bisa juga seperti ini :
   #make && umask 022 && make install && make clean

7. Drag squid.conf dan storeurl.pl  yang ada di folder "file" ke etc/squid dengan winscp
   Edit file squid.conf sesuaikan cache_dir dan localnet dengan kapasitas harddisk dan jaringan anda.

8. Beri hak akses dan kepemilikan pada folder cache
   # chown -R squid:squid /var/spool/squid
   # chmod 777 /var/spool/squid

   # chown squid:squid /etc/squid/storeurl.pl
   # chmod 777 /etc/squid/storeurl.pl

9. Installasi File-ReadBackwards untuk keperluan cache Youtube
   # wget http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/perl-File-ReadBackwards-1.04-1.2.el5.rf.noarch.rpm
   # rpm -Uvh perl-File-ReadBackwards-1.04-1.2.el5.rf.noarch.rpm

10. Membuat folder-folder swap/cache di dalam folder cache yang telah ditentukan dg perintah :
   # squid -f /etc/squid/squid.conf -z
   # ulimit -HSn 65535

11. Optimasi
   Edit file /etc/rc.local
   # echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
   # ulimit -HSn 65535
   # /usr/sbin/squid -NDd1 &

12. Jalankan Proxy Server Squid dengan perintah :
   # /usr/sbin/squid -NDd1 &

download file squid conf. path dan squid di sini

15 comments:

  1. mas saya sudah ngikutin step by step tutorialnya, tapi saya mandek di langkah ke 10, kira2salah nya di mana ya mas? mohon pencerahannya

    BalasHapus
    Balasan
    1. mandek gmn ya om mksdnya? :)

      Hapus
    2. mandek nya di sini mba/mas :)

      [root@system squid-2.7.STABLE9]# squid -f /etc/squid/squid.conf -z
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '(speedtest|firefox)': ignore-must-revalidate
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(jp(e?g|e|2)|tiff?|bmp|gif|png)': ignore-no-store
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(z(ip|[0-9]{2})|r(ar|[0-9]{2})|jar|bz2|gz|tar|rpm|vpu)': ignore-must-revalidate
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(mp3|wav|og(g|a)|flac|midi?|rm|aac|wma|mka|ape)': ignore-must-revalidate
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(kom|nzp|iop|exe|msi|dmg|bin|xpi|iso|swf|mar|psf|cab)': ignore-must-revalidate
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|m\dv|rv|vob|asx|ogm|flv|3gp|on2)': ignore-must-revalidate
      2014/09/16 00:21:31| parse_refreshpattern: Unknown option '\.(mpeg|ra?m|avi|mp(g|e|4)|mov|divx|asf|wmv|m\dv|rv|vob|asx|ogm|flv|3gp|on2)': ignore-no-store
      FATAL: Icon Directory /etc/squid/icons: (2) No such file or directory
      Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
      CPU Usage: 0.010 seconds = 0.006 user + 0.004 sys
      Maximum Resident Size: 0 KB
      Page faults with physical i/o: 0
      squid[0x80cf2c4]
      Aborted
      kira-kira salah nya di mana ya?

      Hapus
    3. itu yang parse di hapus aja om, trs ketik perintah # squid -d1 kalau gak ada apa2 lanjut # squid -z

      Hapus
    4. [root@system squid-2.7.STABLE9]# patch -p0 < aggressive.patch && patch -p0 < loop.patch && patch -p0 < ignore_must_revalidate.patch && patch -p0 < ignore-no-store_new.patch
      -bash: aggressive.patch: No such file or directory
      kalo langkah 4, file patch nya di copy ke folder mana ya? soalnya pas langkah setelah instal patch muncul error seperti yg diatas?

      Hapus
    5. file path ada 4 kalau gk salah di copy ke folder usr/local/src/squid 2.4 stables,sesuai tutorial di atas squid diinstal ke dalam folder usr/local/src. (bkn yang etc/squid) terus lakukan path :d

      Hapus
    6. squid 2.7 stables mksudnya :d salah ketik

      Hapus
    7. sudah saya coba langkah 4 sesuai tutorial di atas, tapi hasilnya masih sama seperti laporan saya di atas ;-(

      Hapus
    8. cb ketik ini pada putty # yum install patch :d [-(

      Hapus
  2. terimaksih mba/mas, langkah 4 sudah lancar, cuma di langkah terakhir masih nemuin kendala error kaya gini
    [root@system squid-2.7.STABLE9]# /usr/sbin/squid -NDd1 &
    [1] 16342
    2014/09/16 23:17:29| Starting Squid Cache version 2.7.STABLE9 for i686-pc-linux- gnu...
    2014/09/16 23:17:29| Process ID 16342
    2014/09/16 23:17:29| With 65536 file descriptors available
    2014/09/16 23:17:29| Using epoll for the IO loop
    2014/09/16 23:17:29| DNS Socket created at 0.0.0.0, port 21161, FD 6
    2014/09/16 23:17:29| Adding nameserver 8.8.8.8 from squid.conf
    2014/09/16 23:17:29| Adding nameserver 8.8.4.4 from squid.conf
    2014/09/16 23:17:29| helperOpenServers: Starting 1 'storeurl.pl' processes
    2014/09/16 23:17:29| User-Agent logging is disabled.
    2014/09/16 23:17:29| Referer logging is disabled.
    2014/09/16 23:17:29| errorTryLoadText: '/etc/squid/errors/ERR_READ_TIMEOUT': (2) No such file or directory
    2014/09/16 23:17:29| errorTryLoadText: '/usr/local/squid/etc/errors/ERR_READ_TIM EOUT': (2) No such file or directory
    FATAL: failed to find or read error text file.
    kira2 error nya d mana ya? :>)

    BalasHapus
    Balasan
    1. cb ketik
      # rm -rf /var/spool/squid
      # mkdir /var/spool/squid
      # chmod 777 /var/spool/squid
      # chown -Rf squid:squid /var/spool/squid
      # squid -z

      Hapus
    2. Alhamdulillah terimakasih mba/mas :), akhirnya setelah otak atik sana sini proxy nya bisa jalan juga, terimakasih tutorial d blog nya sangat membantu sekali :))

      Hapus
    3. (h) sama om keep oprek, di forum buayak om yg kayak ginian

      Hapus
    4. [root@system ~]# /usr/local/squid/sbin/squid -NDd1 &
      2016/01/28 16:38:04| Adding nameserver 202.155.0.10 from /etc/resolv.conf
      2016/01/28 16:38:04| helperOpenServers: Starting 1 'storeurl.pl' processes
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_READ_TIMEOUT': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_LIFETIME_EXP': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_READ_ERROR': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_WRITE_ERROR': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_SHUTTING_DOWN': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_CONNECT_FAIL': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_INVALID_REQ': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_UNSUP_REQ': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_INVALID_URL': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_SOCKET_FAILURE': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/share/squid/errors/English/ERR_DNS_FAIL': (2) No such file or directory
      2016/01/28 16:38:04| errorTryLoadText: '/usr/local/squid/etc/errors/ERR_DNS_FAIL': (2) No such file or directory
      FATAL: failed to find or read error text file.

      kalo ini errornya dimana ya mba/mas

      Hapus
  3. maaf mau nanya ini versi gateway atau stand alone no firewall di clear os nya? :))

    BalasHapus

Silahkan Tinggalkan Jejak Dengan komentar Yang Baik

 
Top