Monday, May 5, 2014

Squid 2.7STABLE9 with patch untuk dinamic dan youtube ( Gateway )

Sumber: http://forum.clearos.or.id/index.php?topic=1580.0
Hmmm gien mau coba share cara instalasi Squid 2.7STABLE9 with patch. Squid 2.7 ini bisa nge cache conten-conten dinamic terutama di tujukan untuk cache youtube...  :idea: ...

Yang masih penasaran pengen nge cache youtube boleh di coba dan resiko tanggung sendiri.
kita mulai dari persiapan tool2 yang mungkin tidak aneh bagi rekan-rekan yang sudah tingkat lanjut dalam seting proxy..

squid calculator = untuk menghitung jumlah partisi / folder cache yang di alokasikan bedasarkan jumlah ram
Kode: [Pilih]
http://stai-alazhary-cianjur.ac.id/download/squidcalc.rar
roko dan kopi untuk menemani agar tidak terlalu tegang  :-[

1. Persiapkan CFLAGS untuk tiap jenis prosesor yang di butuhkan saat proses compile
Kode: [Pilih]
Intel : http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
AMD   : http:http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD

untuk mengetahui jenis prosesor apa yang kita pakai bisa mengetikan perintah
Kode: [Pilih]
# cat /proc/cpuinfo
2. Update ClearOS untuk mendapatkan update terbaru ( bila sudah di lakukan skip )
Kode: [Pilih]
# yum updatesetelah proses download dan instalasi update selesai reboot ClearOS
Kode: [Pilih]
# shutdown -r now
3. Import repo Timb burges
Kode: [Pilih]
# rpm --import ftp://timburgess.net/RPM-GPG-KEY-TimB.txt
# wget ftp://timburgess.net/repo/clearos/5.2/os/timb-release-1-0.noarch.rpm
# rpm -Kv timb-release-1-0.noarch.rpm
# rpm -Uvh timb-release-1-0.noarch.rpm

4. Install paket-paket Compiler yang di butuhkan
Kode: [Pilih]
# yum install automake gcc glibc-devel e2fsprogs-devel sharutils
# yum groupinstall "Development Tools"
# yum install patch

5. Download squid 2.7Stable9 dan patchnya
Kode: [Pilih]
# wget http://stai-alazhary-cianjur.ac.id/download/squid-2.7.STABLE9.tar.gz
# wget http://stai-alazhary-cianjur.ac.id/download/patch-stable9.tar.gz

6. Remove dan install squid yang telah terinstall
Kode: [Pilih]
# yum remove squid
# yum install squid
# service squid stop

7. Extract berkas squid dan patchnya
Kode: [Pilih]
# tar -zxvf squid-2.7.STABLE9.tar.gz
# tar -xzvf patch-stable9.tar.gz


8. Masuk ke directory squid dan lakukan patch atas squid-2.7Stable9 nya.
Kode: [Pilih]
# cd squid-2.7.STABLE9
# patch -p0 < ../patch/aggressive.patch && patch -p0 < ../patch/loop.patch && patch -p0 < ../patch/ignore_must_revalidate.patch && patch -p0 < ../patch/ignore-no-store_new.patch

9. Lakukan proses Compile
Kode: [Pilih]
# CHOST="i686-pc-linux-gnu" CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer" ./configure --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --sysconfdir=/etc/squid --localstatedir=/cache --enable-async-io --with-pthreads --enable-storeio=aufs,coss,null --enable-linux-netfilter --enable-arp-acl --enable-epoll --enable-removal-policies=lru,heap --enable-snmp --enable-delay-pools --enable-htcp --enable-cache-digests --enable-referer-log --enable-useragent-log --enable-follow-x-forwarded-for --with-large-files --enable-large-cache-files --enable-truncate --disable-ident-lookups --with-maxfd=65536Dalam contoh saya memakai prosesor intel core 2 duo untuk 32bit : CHOST="i686-pc-linux-gnu" CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"

Next
Kode: [Pilih]
# make && umask 022 && make install && make clean
Setelah proses compile dan install selesai coba cek squid kita dengan mengetikan perintah
Kode: [Pilih]
# squid -v
10. Berikan hak akses dan perubahan owner untuk partisi/directory /cache
Kode: [Pilih]
# chown squid:squid /cache && chmod 777 /cacheDalam contoh gien hanya memakai satu partisi/directory untuk penyimpanan file cache ( /cache )

11. Delet file squid.conf yang ada dan download dengan yang telah di siapkan
Kode: [Pilih]
# rm /etc/squid/squid.conf
# cd /etc/squid
# wget http://stai-alazhary-cianjur.ac.id/download/squid.conf
# wget http://stai-alazhary-cianjur.ac.id/download/storeurl.pl
# chmod 777 /etc/squid/storeurl.pl

12. Edit dan sesuaikan dengan kebutuhan squid.conf nya terutama di bagian acl, directory cache, delay pools dll. Setelah di rasa sudah cukup editing squid.conf nya kita lanjut

13. Test apakah rule squid.conf yang telah di edit ada masalah
Kode: [Pilih]
# squid -k parse
Rebuild cache nya
Kode: [Pilih]
# squid -z
bisa juga dengan mengetikan perintah di bawah :
Kode: [Pilih]
# squid -f /etc/squid/squid.conf -z
14 . Edit firewall
Kode: [Pilih]
# nano /etc/firewalRubah configurasi
Kode: [Pilih]
# Squid configuration
#--------------------

SQUID_TRANSPARENT="off"
SQUID_FILTER_PORT=""

Menjadi
Kode: [Pilih]
# Squid configuration
#--------------------

SQUID_TRANSPARENT="on"
SQUID_FILTER_PORT="3128"
Setelah di edit keluar dan simpan

15. Restart Firewall dan jalankan service squid nya
Kode: [Pilih]
# service firewall restart
# /usr/sbin/squid -NDd1 &

16. Agar squid bisa jalan secara otomatis saat proses booting
Kode: [Pilih]
# nano /etc/rc.local/tambahkan baris berikut di bawah
Kode: [Pilih]
/usr/sbin/squid -NDd1 &
tambahan dari bang odon bila ingin lebih lengkap :
Kode: [Pilih]
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -HSn 65535
/usr/sbin/squid -NDd1 &

 :idea:

Ok semua proses telah beres...Semoga bisa bermanfaat untuk rekan-rekan sekalian..

dan ta lupa terima kasih kepada rekan-rekan yang telah membantu untuk oprex squid ini...  :shakehand:


Nb : bila rekan-rekan melihat video youtube yang nge hit sampe setengah ...tenang sisanya itu tetep nge hit ke proxy....
« Edit Terakhir: Jumat, 05 Juli 2013, 12:15:15 oleh giens26 »

Saturday, May 3, 2014

CLEAROS STANDALONE MODE + SQUID 3.4.2 + TPROXY + HTTPS SSL BUMP

[TUT] CLEAROS STANDALONE MODE + SQUID 3.4.2 + TPROXY + HTTPS SSL BUMP
« pada: Rabu, 12 Pebruari 2014, 21:51:14 »
Bismillahirrahmanirrahim

EVEN THE BEST CAN BE IMPROVED

1. Hal-hal yang berbau teknis mohon di selesaikan di thread ini, sehingga diketahui oleh semua pembaca setiap kesalahan dan kekurangan dari thread saya
2. Untuk itu demi penyempurnaan thread ini di mohon teman-teman forum COSI yang lain untuk membantu
3. Buat Mengingatkan Di Baca Dulu!
WARNING: HTTPS was designed to give users an expectation of privacy and security. Decrypting HTTPS tunnels without user consent or knowledge may violate ethical norms and may be illegal in your jurisdiction. Squid decryption features described here and elsewhere are designed for deployment with user consent or, at the very least, in environments where decryption without consent is legal. These features also illustrate why users should be careful with trusting HTTPS connections and why the weakest link in the chain of HTTPS protections is rather fragile. Decrypting HTTPS tunnels constitutes a man-in-the-middle attack from the overall network security point of view. Attack tools are an equivalent of an atomic bomb in real world: Make sure you understand what you are doing and that your decision makers have enough information to make wise choices.

GOAL:
1. Menerapkan tproxy pada Server ClearOS Mode Standalone
2. mencache youtube
3. Cache HTTPS
sekali lagi https di katakan tercache jika ada tulisan di access.log
GET https://....
 
TOPOLOGI
                                port ethernet no.3 ------- SQUID
Klien ---- Switch ---- port ethernet no.2
                                port ethernet no.1 ------- Modem


    
Oke langsung saja, saya asumsikan COS sudah berjalan

1. Update CLearOS anda
Kode: [Pilih]
# yum update
# shutdown -r now

2. Install Development Tools
Kode: [Pilih]
# yum-config-manager --enable clearos-core
# yum --enablerepo=clearos-core,clearos-developer,clearos-epel install clearos-devel app-devel

3. Instal Paket-paket yang di butuhkan
Kode: [Pilih]
# yum install openssl openssl-devel fakeroot ebtables libcap libcap-devel automake gcc glibc-devel e2fsprogs-devel sharutils
# yum --enablerepo=* install libtool libtool-ltdl libtool-ltdl-devel perl-File-ReadBackwards ccze

4. Download dan Install Squid-3.4.2
Kode: [Pilih]
# yum install squid
# yum remove squid
# wget https://www.dropbox.com/s/vkfhwk28hy9tul8/squid-3.4.2.tar.gz
# tar -zxvf squid-3.4.2.tar.gz
# cd squid-3.4.2
# ./bootstrap.sh
# ./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/cache --libdir=/usr/lib --includedir=/usr/include --datadir=/usr/share/squid --infodir=/usr/share/info --mandir=/usr/share/man --disable-dependency-tracking --enable-storeio=ufs,aufs,diskd --enable-removal-policies=lru,heap --enable-icmp --enable-esi --enable-icap-client --disable-wccp --disable-wccpv2 --enable-kill-parent-hack --enable-cachemgr-hostname=localhost--enable-ssl --enable-cache-digests --enable-linux-netfilter --enable-follow-x-forwarded-for --enable-x-accelerator-vary --enable-zph-qos --with-default-user=squid --with-logdir=/var/log/squid --with-pidfile=/var/run/squid.pid --with-large-files --enable-ltdl-convenience --with-filedescriptors=65536 --enable-ssl --enable-ssl-crtd --enable-ssl-crtd --with-openssl=/usr/lib/openssl  --disable-auth --build=i686-linux-gnu build_alias=i686-linux-gnu
# make && make install
# squid -v
# chown squid:squid /cache && chmod 777 /cache
# chown squid:squid /var/log/squid

5. Hapus squid.conf lama dan download squid.conf dan storeid.pl
Kode: [Pilih]
# rm /etc/squid/squid.conf
# cd /etc/squid
# wget https://www.dropbox.com/s/zy8y5ygnwy3txay/squid.conf
# wget https://www.dropbox.com/s/6x7d86iyogb8qgi/store-id.pl?m=
# chmod 777 /etc/squid/store-id.pl

6. Download file squid untuk /etc/init.d
download filenya di https://www.dropbox.com/s/pqxzuiofh1yqia7/squid.init.d.txt
rubah file name menjadi "squid" tanpa tanda petik kemudian masukkan ke folder /etc/init.d
Beri izin execute squid
Kode: [Pilih]
# chmod +x /etc/init.d/squid
7. Setup SSL Bump Squid 3.4.2
Kode: [Pilih]
# cd /etc/squid
# mkdir ssl_cert
# cd ssl_cert
# openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout myCA.pem  -out myCA.pem
# openssl x509 -in myCA.pem -outform DER -out myCA.der
# cd
# mkdir /var/squid
# cd /var/squid
# mkdir ssl_db
# cd
# chown -R nobody /var/squid/ssl_db/
# /usr/lib/squid/ssl_crtd -c -s /var/squid/ssl_db/certs
# chown -R squid:squid /var/squid/ssl_db/
# squid -k parse
# squid -z

8. Load modul-modul tproxy dan tambahkan juga di rc.local
Kode: [Pilih]
# modprobe xt_TPROXY
# modprobe xt_socket
# modprobe nf_tproxy_core
# modprobe xt_mark
# modprobe nf_nat
# modprobe nf_conntrack_ipv4
# modprobe nf_conntrack
# modprobe nf_defrag_ipv4
# modprobe ipt_REDIRECT
# modprobe iptable_nat

Cek Hasilnya
Kode: [Pilih]
# dmesg | grep PROXYNF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.

9. Tambahkan rule TProxy ke /etc/rc.d/rc.local
Kode: [Pilih]
modprobe xt_TPROXY
modprobe xt_socket
modprobe nf_tproxy_core
modprobe xt_mark
modprobe nf_nat
modprobe nf_conntrack_ipv4
modprobe nf_conntrack
modprobe nf_defrag_ipv4
modprobe ipt_REDIRECT
modprobe iptable_nat

iptables -t mangle -F
iptables -t mangle -X

iptables -t mangle -N DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
iptables -t mangle -A INPUT -j ACCEPT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A PREROUTING ! -d XX.XX.XX.XX/XX -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
iptables -t mangle -A PREROUTING ! -d XX.XX.XX.XX/XX -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127

/sbin/ip rule add fwmark 1 lookup 100
/sbin/ip route add local 0.0.0.0/0 dev lo table 100

echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
echo 1 > /proc/sys/net/ipv4/ip_forward
exit 0

10. Disable selinux
Kode: [Pilih]
# vi /etc/selinux/configUbahmenjadi SELINUX=disabled

11. Tambah dan edit settingan sysctl.conf
Kode: [Pilih]
# vi /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0

12. Tambahkan baris berikut di rc.local
Kode: [Pilih]
echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -HSn 65535
/usr/sbin/squid -Nd1 &

13. Restart firewall dan jalankan squidnya
Kode: [Pilih]
# service firewall restart
# /usr/sbin/squid -Nd1 &

14. Tanamkan myCA.der di Browser

15. Konfigurasi di MikroTik & Mangle dan Routing TPROXY (sesuaikan dengan IP Proxy Anda)
#copy paste command dibawah ini menggunakan menu New Terminal di Winbox#
kasi nama interface dan IP address

Kode: [Pilih]
/interface ethernet
set 2 name=ether3-proxy

/ip address
add address=XX.XX.XX.XX/XX interface=ether3-proxy

/ip firewall mangle
add action=mark-routing chain=prerouting comment="TPROXY ROUTING" disabled=no dst-port=80,443 in-interface=ether2-local new-routing-mark=tproxy_rm passthrough=no \
    protocol=tcp
add action=mark-connection chain=prerouting disabled=no dst-port=80,443 in-interface=ether3-proxy new-connection-mark=tproxy_cm passthrough=yes protocol=tcp \
    src-address=!XX.XX.XX.XX
add action=mark-routing chain=prerouting connection-mark=tproxy_cm disabled=yes in-interface=!ether3-proxy new-routing-mark=tproxy_rm passthrough=no

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=XX.XX.XX.XX routing-mark=tproxy_rm scope=30 target-scope=10


Coba browsing jika ada
TCP_MISS/504 5135 GET https://.... berarti anda sudah sukses mencache content HTTPS

NOTE:
- Tutorial ini hasil copas saya dari berbagai tempat di dasarkan dari Forum Clear Indonesia, Forum Ubuntu Indonesia, Grup Squid Mikrotik Indonesia, dan tempat lain yang tidak bisa saya sebutkan 1 per 1
- Terima Kasih yang sebesar-besarnya atas clue dan petunjuknya kepada Om MikroTiker N SquidLover, giens26, Syaifuddin JW, Andi Micro, dan semua pihak yang telah membantu dan tidak dapat saya sebutkan. Semoga Amal Baik Mereka di catat sebagai amal baik di sisi-Nya
« Edit Terakhir: Jumat, 14 Pebruari 2014, 22:26:26 oleh zoff46 »


Sumber: http://forum.clearos.or.id/index.php?topic=2479.0

Monday, January 27, 2014

CLEAROS MODE BRIDGE (catatan sebagai pengingat pribadi)

Source: http://forum.clearos.or.id/index.php?topic=2458.0

[TUT] ClearOS 6.5/Bridge Mode + Squid3 + TProxy + HTTPS SSL BUMP
« pada: Minggu, 22 Desember 2013, 00:29:28 »
Bismillahirrahmanirrahim

EVEN THE BEST CAN BE IMPROVED

Didasarkan atas keinginan saya untuk mencache content https di warnet yang memang kebanyakan pelanggan mengakses facebook yang seperti kita ketahui sekarang sudah https walaupun sudah kita rubah settingan securenya.
Ada beberapa point yang harus saya sampaikan sebelum di mulainya tut ini:
1. Saya bukan ahli yg berkompeten dalam bidang IT saya hanya OP warnet yang ingin cache content HTTPS untuk pelanggan saya
2. Untuk itu demi penyempurnaan thread ini di mohon teman-teman yang lain untuk membantu
2. Hal-hal yang berbau teknis mohon di selesaikan di thread ini, sehingga diketahui oleh semua pembaca setiap kesalahan dan kekurangan dari thread saya
3. Resiko di tanggung sendiri karena yang punya squid saja membuat notice:
Kode: [Pilih]
WARNING: HTTPS was designed to give users an expectation of privacy and security. Decrypting HTTPS tunnels without user consent or knowledge may violate ethical norms and may be illegal in your jurisdiction. Squid decryption features described here and elsewhere are designed for deployment with user consent or, at the very least, in environments where decryption without consent is legal. These features also illustrate why users should be careful with trusting HTTPS connections and why the weakest link in the chain of HTTPS protections is rather fragile. Decrypting HTTPS tunnels constitutes a man-in-the-middle attack from the overall network security point of view. Attack tools are an equivalent of an atomic bomb in real world: Make sure you understand what you are doing and that your decision makers have enough information to make wise choices.
artinya mbuh ra eroh  :-[

GOAL dari ini bukan hanya fokus pada caching HTTPS tapi anda akan mendapatkan
1. membuat bridge dengan clearos
2. menerapkan tproxy pada proxy anda sehingga ip yang terbaca di access.log adalah ip klien
3. mencache youtube
4. dan tentunya cache HTTPS
https di katakan tercache jika ada tulisan di access.log
GET https://....   :th_in_love:
 
TOPOLOGI YANG SAYA TERAPKAN



Uploaded with ImageShack.us

Oke langsung saja, saya asumsikan COS sudah berjalan
Go Go Go
 :peace:
1. Buat Bridge ClearOS sesuai dengan hardware dan IP Adress Anda
Kode: [Pilih]
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE="Ethernet"
ONBOOT="yes"
USERCTL="no"
HWADDR="00:00:00:00:00:00" #(SESUAI HARDWARE)
BOOTPROTO="static"
BRIDGE="br0"

# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE="Ethernet"
ONBOOT="yes"
USERCTL="no"
HWADDR="00:00:00:00:00:00" #(SESUAI HARDWARE)
BOOTPROTO="static"
BRIDGE="br0"

# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE="Bridge"
ONBOOT="yes"
USERCTL="no"
BOOTPROTO="static"
IPADDR="0.0.0.0"
NETMASK="255.255.255.0"
GATEWAY="0.0.0.0"
PROMISC=yes
BRIDGE_STP="yes"
Edit network.conf supaya device “br0” dikenali oleh firewall.
Kode: [Pilih]
# vi /etc/clearos/network.conf
MODE="trustedgateway"
EXTIF="br0"
LANIF="br0"
Kemudian restart network
Kode: [Pilih]
# service network restartTest ping ke gateway, jika replay berarti bridge sudah berhasil dibangun.
Jika setelah di setting ke mode bridge status internet mati edit file "/etc/sysconfig/network"
ganti "GATEWAYDEV".
Kode: [Pilih]
# vi /etc/sysconfig/network
GATEWAYDEV="br0"
2. Update CLearOS anda
Kode: [Pilih]
# yum update
# shutdown -r now

TIPS = yang masih fresh instal COS bisa jalan2 dulu atau telpon istri atau pacarnya he he he  :-[

3. Tambahkan Repo Timburgess
Kode: [Pilih]
# rpm --import ftp://timburgess.net/RPM-GPG-KEY-TimB.txt
# wget ftp://timburgess.net/repo/clearos/6/os/i386/timb-release-1-1.noarch.rpm

OR for 64bit
# wget ftp://timburgess.net/repo/clearos/6/os/x86_64/timb-release-1-1.noarch.rpm

# rpm -Kv timb-release-1-1.noarch.rpm
# rpm -Uvh timb-release-1-1.noarch.rpm

repo enable, ketikan
# yum --enablerepo=timb

upgrade terbaru
# yum --enablerepo=timb upgrade BackupPC

mengupdate seluruh paket tim burgess
# yum --enablerepo=timb update

4. Install Development Tools
Kode: [Pilih]
# yum-config-manager --enable clearos-core
# yum --enablerepo=clearos-core,clearos-developer,clearos-epel install clearos-devel app-devel

Nunggu lagi sambil makan kerupuk  :th_karate: :peace:

5. Instal Paket-paket yang di butuhkan
Kode: [Pilih]
# yum install openssl openssl-devel fakeroot ccze ebtables perl-File-ReadBackwards libcap libcap-devel libtool-ltdl-devel automake gcc glibc-devel e2fsprogs-devel sharutils
# yum --enablerepo=* install libtool libtool-ltdl libtool-ltdl-devel

Siapkan Winscp
buat folder "squid" tanpa tanda petik di /opt/
kemudian buat folder "openssl" tanpa tanda petik di /opt/squid/
atau gunakan perintah
Kode: [Pilih]
# mkdir /opt/squid
# mkdir /opt/squid/openssl

6. Download dan Install Squid-3.HEAD-20130710-r12934
Kode: [Pilih]
# wget https://www.dropbox.com/s/r6bllb5i05aq0qi/squid-3.HEAD-20130710-r12934.tar.gz
# tar -zxvf squid-3.HEAD-20130710-r12934.tar.gz
# cd squid-3.HEAD-20130710-r12934
# ./bootstrap.sh
# ./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib/squid --sysconfdir=/etc/squid --localstatedir=/cache --libdir=/usr/lib --includedir=/usr/include --datadir=/usr/share/squid --infodir=/usr/share/info --mandir=/usr/share/man --disable-dependency-tracking --enable-storeio=ufs,aufs,diskd --enable-removal-policies=lru,heap --enable-icmp --enable-esi --enable-icap-client --disable-wccp --disable-wccpv2 --enable-kill-parent-hack --enable-cachemgr-hostname=localhost--enable-ssl --enable-cache-digests --enable-linux-netfilter --enable-follow-x-forwarded-for --enable-x-accelerator-vary --enable-zph-qos --with-default-user=squid --with-logdir=/var/log/squid --with-pidfile=/var/run/squid.pid --with-large-files --enable-ltdl-convenience --with-filedescriptors=65536 --enable-ssl --enable-ssl-crtd --enable-ssl-crtd --with-openssl=/usr/lib/openssl  --disable-auth --build=i686-linux-gnu build_alias=i686-linux-gnu
# make && make install
# squid -v
# adduser squid
# chown squid:squid /cache && chmod 777 /cache
# chown squid:squid /var/log/squid

7. Edit dan Sesuaikan squid.conf sesuaikan dengan kebutuhan
Kode: [Pilih]
# rm /etc/squid/squid.conf
# cd /etc/squid
# wget https://www.dropbox.com/s/v58fm9e8cqlrvt1/squid.txt
(rubah nama file squid.txt menjadi squid.conf)
# wget https://www.dropbox.com/s/n641khsoqucg1m8/store-id.pl
(rubah nama file menjadi store-id.pl)
# chmod 777 /etc/squid/store-id.pl

8. Download file squid untuk /etc/init.d
download filenya di https://www.dropbox.com/s/pqxzuiofh1yqia7/squid.init.d.txt
rubah file name menjadi "squid" tanpa tanda petik kemudian masukkan ke folder /etc/init.d
Beri izin execute squid
Kode: [Pilih]
# chmod +x /etc/init.d/squid
Jika link yang di atas mati anda dapat mendownload dan memasukkan manual ke server dengan menggunakan winscp
1) Squid-3HEAD-20130710-r12924 di
http://www.4shared.com/archive/kK-DEZt4/squid-3HEAD-20130710-r12934tar.html
2) squid.conf di
http://www.4shared.com/office/NSgVGf4y/squid.html
3) Squid untuk /etc/init.d di
http://www.4shared.com/office/pPUIu_01/squidinitd.html
4) store-id.pl di
http://www.4shared.com/file/WQGl-8yq/store-id.html

9. Setup SSL Bump Squid 3
Kode: [Pilih]
# cd /etc/squid
# mkdir ssl_cert
# cd ssl_cert
# openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout myCA.pem  -out myCA.pem
# openssl x509 -in myCA.pem -outform DER -out myCA.der
# cd
# mkdir /var/squid
# cd /var/squid
# mkdir ssl_db
# cd
# chown -R nobody /var/squid/ssl_db/
# /usr/lib/squid/ssl_crtd -c -s /var/squid/ssl_db/certs
# chown -R squid:squid /var/squid/ssl_db/
# squid -k parse
# squid -z

10. Load modul-modul tproxy dan tambahkan juga di rc.local
Kode: [Pilih]
# modprobe xt_TPROXY
# modprobe xt_socket
# modprobe nf_tproxy_core
# modprobe xt_mark
# modprobe nf_nat
# modprobe nf_conntrack_ipv4
# modprobe nf_conntrack
# modprobe nf_defrag_ipv4
# modprobe ipt_REDIRECT
# modprobe iptable_nat

Cek Hasilnya
Kode: [Pilih]
# dmesg | grep PROXYNF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.

11. Tambahkan rule TProxy ke /etc/clearos/firewall.d/local

Kode: [Pilih]
/sbin/ip rule add fwmark 1 lookup 100
/sbin/ip route add local 0.0.0.0/0 dev lo table 100

echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t mangle -F
iptables -t mangle -X

/sbin/iptables -t mangle -N DIVERT
/sbin/iptables -t mangle -A DIVERT -j MARK --set-mark 1
/sbin/iptables -t mangle -A DIVERT -j ACCEPT
/sbin/iptables -t mangle -A INPUT -j ACCEPT
/sbin/iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
/sbin/iptables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
/sbin/iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
/sbin/ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp --ip-dport 80 -j redirect --redirect-target DROP
/sbin/ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp --ip-sport 80 -j redirect --redirect-target DROP
/sbin/ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp --ip-dport 443 -j redirect --redirect-target DROP
/sbin/ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp --ip-sport 443 -j redirect --redirect-target DROP

12. Disable selinux
Kode: [Pilih]
# vi /etc/selinux/config
Ubahmenjadi SELINUX=disabled

13. Tambah dan edit settingan sysctl.conf
Kode: [Pilih]
# vi /etc/sysctl.conf
net.ipv4.ip_nonlocal_bind=1
net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0

14. Tambahkan baris berikut di rc.local
Kode: [Pilih]
echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
echo 1 > /proc/sys/net/ipv4/ip_forward

cd /proc/sys/net/bridge/
for i in *
do
echo 0 > $i
done
unset i

echo 1024 65535 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -HSn 65535
/usr/sbin/squid -Nd1 &

15. Restart firewall dan jalankan squidnya
Kode: [Pilih]
# service firewall restart
# /usr/sbin/squid -Nd1 &

16. Tanamkan myCA.der di Browser  :peace:

Coba browsing jika ada
TCP_MISS/504 5135 GET https://.... berarti anda sudah sukses mencache content HTTPS
Contohnya gini
 :th_beaten:  :th_pervert:


Uploaded with ImageShack.us
NOTE:
- Tutorial ini hasil copas saya dari berbagai tempat di dasarkan dari Forum Clear Indonesia, Forum Ubuntu Indonesia, Grup Squid Mikrotik Indonesia, dan tempat lain yang tidak bisa saya sebutkan 1 per 1
- Terima Kasih yang sebesar-besarnya atas clue dan petunjuknya kepada Om MikroTiker N SquidLover, giens26, Syaifuddin JW, Andi Micro, dan semua pihak yang telah membantu dan tidak dapat saya sebutkan. Semoga Amal Baik Mereka di catat sebagai amal baik di sisi-Nya  :shakehand: