Recent Posts

Your browser does not support frame.

Selasa, 23 September 2014

20 Langkah Instal proxy lusca di ubuntu server

# ======================================================= #
# 20 langkah instalasi proxy lusca di ubuntu 12.04 / 14.04 server
# Berjalan default pada port 3126, silahkan ganti sesuai keinginan anda
# Tutorial by jinho diaz
# ======================================================= #














Pastikan ubuntu server sudah terinstal dengan baik dan dapat ping ke salah satu situs.
Selanjutnya silahkan remote Ubuntu server anda Dengan PuTTY.

1. Update data yang diperlukan, copy paste script dibawah ini ke terminal putty :

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get install squid -y && apt-get install squid squidclient squid-cgi -y && apt-get install gcc -y && apt-get install build-essential -y && apt-get install sharutils -y && apt-get install ccze -y && apt-get install libzip-dev -y && apt-get install automake1.9 -y && wget https://www.dropbox.com/s/crl20s4r7ha78y8/LUSCA_PRO.tar.gz && tar xzvf LUSCA_PRO.tar.gz && cd LUSCA_PRO/ && make distclean


2. Lakukan perintah compile, copy paste Kode nya ke terminal putty :

./configure --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-http-gzip --enable-async-io=24 --with-aufs-threads=24 --with-pthreads --enable-storeio=aufs --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=heap --with-aio --with-dl --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --disable-unlinkd --enable-large-cache-files --with-large-files --enable-err-languages=English --enable-default-err-language=English --with-maxfd=65536 && make && make install


3. Beri akses proxy pada direktory daemon squid :
   sudo chmod 777 /usr/share/squid

4. Buatlah direktory untuk tempat cache anda, disini saya contohkan 9 cache, silahkan sesuaikan :
   mkdir /cache-1 && mkdir /cache-2 && mkdir /cache-3 && mkdir /cache-4 && mkdir /cache-5 && mkdir /cache-6 && mkdir /cache-7 && mkdir /cache-8 && mkdir /cache-9

5. Beri akses proxy pada direktory cache :
   chown proxy:proxy /cache-* && chmod 777 /cache-*

6. Buat file log squid dan beri akses proxy :
   mkdir /var/log/squid && chmod 777 /var/log/squid
   touch /var/log/squid/access.log && touch /var/log/squid/cache.log
   sudo chmod 777 /var/log/squid/access.log
   sudo chmod 777 /var/log/squid/cache.log

7. Masuk ke direktory squid engine :
   cd /etc/init.d

8. Download dan extract engine squid :
   wget https://www.dropbox.com/s/oh60zwaztpwed55/squideng.tar.gz && tar xzvf squideng.tar.gz

9. Beri akses proxy pada engine dan hentikan proses sementara :
   sudo chmod +x /etc/init.d/squid && /etc/init.d/squid stop

10.Masuk ke direktory squid :
   cd /etc/squid

11. Download config squid :
    wget https://www.dropbox.com/s/jfaqbzlrde00njn/squidconf.tar.gz && tar xzvf squidconf.tar.gz

12. Beri hak akses proxy pada file squid.conf dan storeurl.pl :
    chown proxy:proxy /etc/squid/storeurl.pl && chmod 777 /etc/squid/storeurl.pl && chown proxy:proxy /etc/squid/squid.conf && chmod 777 /etc/squid/squid.conf

13. copykan file yg di perlukan, kemudian Silahkan edit squid.conf, terutama dibagian port (proxy berjalan di port 3126), cache squid, dan localnet sesuai dengan jaringan LAN anda, ketik :
cp /etc/squid/mime.conf /usr/share/squid
chown proxy:proxy /usr/share/squid/mime.conf
chmod 777 /usr/share/squid/mime.conf
nano /etc/squid/squid.conf
 
14. Jika sudah selesai mengedit, simpan dan keluar, caranya tekan ctrl+x, lalu tekan y

15. Jalankan setting squid :
    squid -f /etc/squid/squid.conf -z && /etc/init.d/squid restart

16. Periksa apakah ada pesan kesalahan instalasi :
    squid -k parse
    squid -k reconfigure

17. Periksa apakah squid sudah berjalan :
    squid -NDd1

18. Ganti file sysctl dan Lakukan soft restart pada jaringan :
    mv /etc/sysctl.conf sysctl.conf.backup
    cd /etc/
    wget https://www.dropbox.com/s/1dndqjl5y3bs1rs/sysctl.conf
    sudo sysctl -p
    sudo /etc/init.d/networking restart

19. Atur crontab agar squid berjalan otomatis saat komputer restart :
    cd /usr/sbin/
    wget https://www.dropbox.com/s/mzl61mw53cqvk3h/squidst.sh
    wget https://www.dropbox.com/s/4jbnlqjea0zxxid/squid.tgz
    chmod 777 /usr/sbin/squidst.sh && chmod 777 /usr/sbin/squid.tgz
    echo 0 */1 * * * squidst.sh >> /var/spool/cron/root
    echo 0 */1 * * * service squid restart >> /var/spool/cron/root
    echo 30 8 * * * /usr/sbin/squidst.sh >> /var/spool/cron/crontabs/root

20. Jika semua sudah selesai, silahkan lihat hit nya :
    tail -f /var/log/squid/access.log | ccze


# Tutorial by jinho on squid lusca high performance
# Download step installation in txt file, here

10 komentar:

  1. Balasan
    1. drobbox wget https://www bla.. blaa jangan disambung &&, penggal &&nya trus lanjut tanpa &&..

      Hapus
  2. nano squid.conf ,,,,contoh editnya gmana bang ,,,

    BalasHapus
  3. tail -f /var/log/squid/access.log | ccze...tidak mau jalan.squid sudah running.
    apa ada tambahannya mas?
    hanya sedikit merubah
    pid_filename /var/run/squid.pid
    coredump_dir /cache/cache1
    error_directory /usr/share/squid/errors/English
    icon_directory /usr/share/squid/icons
    mime_table /usr/share/squid/mime.conf

    maximum_object_size_in_memory 32 KB
    memory_replacement_policy heap GDSF
    cache_replacement_policy heap LFUDA
    maximum_object_size 256 MB
    cache_swap_low 98%
    cache_swap_high 99%
    # ========================================= #
    # dibawah ini silahkan disesuaikan dengan #
    # direktory cache proxy anda #
    # ========================================= #
    cache_dir aufs /cache/cache1 200000 32 256
    access_log /var/log/squid/access.log
    cache_log /var/log/squid/cache.log
    cache_log /dev/null
    cache_store_log /dev/null
    redirect_rewrites_host_header off
    acl manager proto cache_object
    acl localhost src 10.10.10.2/255.255.255.255
    masih newbie>>>>mf

    BalasHapus
  4. pak klo https belum bisa di cache ya? sekarang youtube https masalahnya

    BalasHapus
  5. cara nya pak
    biar bisa ng cache https
    sebelumnya terimakasih

    BalasHapus
  6. di tunggu pak tutorial selanjut nya

    BalasHapus
  7. mas untuk link download di dropbox nya sudah tidak bisa lagi ya?

    BalasHapus