
Terikhir saya ada posting Mengoptimalkan Squid Proxy menggunakan ThunderCache 5,
Kalau menurut saya sepertinya kurang cocok jika menggunakan ThunderCache 5, dikarenakan file konfigurasi berada di Portal Web Bmsoftware. Bedanya juga kalau pakai ThunderCache 5 file youtube (file .flv) jika kita ambil tidak bisa dibuka, tapi kalau pakai ThunderCache 3, file hasil cache bisa kita ambil dan bisa dibuka. Kereeenn.
Kemarin dengar-dengar ada cara install ThunderCache 3 di gabung dengan Squid Proxy atau bisa juga dijadisatukan dengan Squid Lusca, (Wedeww,,,, mantep bener).
Langsung saja..
Rencana server yang akan dibangun menggunakan 1HDD SATA sebagai System OS Ubuntu Mini 9.04 32bit.
Cache akan dibangun di dalam 1 partisi harddisk 2TB.
Berikut Cara installasinya.
Install OS Ubuntu di server buat 2 partisi (partisi / dan partisi /thunder)
Bagi pengguna Ubuntu 9.04 ganti file /etc/apt/source.list sebagai berikut
###=======================
deb http://kambing.ui.edu/ubuntu jaunty main restricted universe multiverse
deb http://kambing.ui.edu/ubuntu jaunty-updates main restricted universe multiverse
deb http://kambing.ui.edu/ubuntu jaunty-security main restricted universe multiverse
deb http://kambing.ui.edu/ubuntu jaunty-backports main restricted universe multiverse
deb http://kambing.ui.edu/ubuntu jaunty-proposed main restricted universe multiverse
###========================
apt-get update
apt-get upgrade
apt-get install squid apache2 libapache2-mod-php5 php5 php-db php5-gd php5-sqlite sqlite3 libsqlite3-dev libstdc++6 unzip bzip2
cd /root
wget http://www.biazus.com/forum/download/file.php?id=179 -O thunder3-32bits.tar.bz2
mkdir thunder3-32bits
tar xjvf thunder3-32bits.tar.bz2 -C thunder3-32bits
cd thunder3-32bits
cp -R /root/thunder3-32bits/sbin/* /usr/local/sbin
chmod a+x /usr/local/sbin/thunder
mkdir /var/log/thunder
mkdir /var/tmp/thunder
mkdir /var/run/thunder
chmod a+rwx /var/log/thunder
chmod a+rwx /var/tmp/thunder
chmod a+rwx /var/run/thunder
cp -R /root/thunder3-32bits/etc/init.d/* /etc/init.d
chmod a+x /etc/init.d/thunder
cp -R /root/thunder3-32bits/etc/thunder /etc/thunder
touch /etc/thunder/whitelist
touch /etc/thunder/blacklist
mkdir /thunder
chmod a+rwx /thunder
chown -R www-data /thunder/
chmod -R 777 /thunder/
umask 000 /thunder/
Tambahkan baris ini di file php.ini dengan menggunakan command berikut
echo "extension=pdo.so" >> /etc/php5/apache2/php.ini
echo "extension=pdo_sqlite.so" >> /etc/php5/apache2/php.ini
Buat link agar hasil cache bisa dilihat di webbrowser
ln -s /etc/thunder/thunder.php /var/www/thunder3.php
update-rc.d thunder defaults
Edit file squid.conf
#===================================================================#
#Redirecionamento Thunder 3.x - REGEx
#===================================================================#
acl thunder_lst url_regex -i "/etc/thunder/thunder.lst"
cache deny thunder_lst
cache_peer IPTHUNDER parent 8080 0 proxy-only no-digest
dead_peer_timeout 2 seconds
cache_peer_access IPTHUNDER allow thunder_lst
cache_peer_access IPTHUNDER deny all
Beri tanda pagar pada baris berikut
#hierarchy_stoplist cgi-bin ?
OK Sipp, langsung reboot.
Note :
Kalau saya lebih suka ditambahkan RB750, jadi dari RB750 yang mengarahkan port 80 untuk mengarahkan ke proxy.
Source :
http://www.biazus.com/forum/viewtopic.php?f=6&t=636&p=5303
---------
Tambahan
#cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'
Command diatas digunakan untuk melihat baris yang tidak di comment pagar.
Berikut isi file squid.conf
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
icp_access allow localnet
icp_access deny all
http_port 3128 transparent
acl thunder_lst url_regex -i "/etc/thunder/thunder.lst"
cache deny thunder_lst
cache_peer 192.168.100.100 parent 8080 0 proxy-only no-digest
dead_peer_timeout 2 seconds
cache_peer_access 192.168.100.100 allow thunder_lst
cache_peer_access 192.168.100.100 deny all
access_log /var/log/squid/access.log squid
refresh_pattern -i \.(class|css|js|tif)(\?.*)?$ 1440 95% 100000080 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(jpe|jpg|jpeg|png|bmp|gif)(\?.*)?$ 0 95% 1000000080 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(tiff|mov|avi|qt|mpeg|3gp)(\?.*)?$ 0 95% 201600000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(mpg|mpe|wav|au|mid|flv)(\?.*)?$ 0 95% 2016000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(zip|gz|arj|lha|lzh)(\?.*)?$ 0 95% 2016000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(rar|tgz|tar|exe|bin)(\?.*)?$ 0 95% 2016000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(cab|psf|part|0*|swf|gz|grf|gpf)(\?.*)?$ 0 95% 2000160 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(pdf|rtf|doc|swf|txt|inf)(\?.*)?$ 1 95% 2016000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(inc|cab|ad|hqx|dll)(\?.*)?$ 10080 95% 4320000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(asp|acgi|pl|shtml|php3|php)(\?.*)?$ 2 20% 432000 override-expire ignore-no-cache ignore-private
refresh_pattern -i \.(ini)(\?.*)?$ 2 5% 10800 override-expire ignore-no-cache ignore-private
acl shoutcast rep_header X-HTTP09-First-Line ^ICY\s[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
server_http11 on
cache_mgr admin@ganteng.com
mail_program admin@ganteng.com
cache_effective_user proxy
visible_hostname Proxy.barubelajar.com
hosts_file /etc/hosts
coredump_dir /var/spool/squid