Install FreeBSD 7.2 + Compile kernel + SQUID 3.x / squid-3.HEAD
September 3, 2009 at 4:49 am | In FreeBSD | Leave a CommentTags: cachemgr.cgi, compile, compile kernel, conf, config, FreeBSD, hight performance, kernel, kompile, kompile kernel, lightsquid, squid, squid 3, squid 3.0, squid conf, squid config, squid HEAD, squid hight performance, squid-3.HEAD, squid3, suid.config
[Kumpulan beberapa referensi, pengalaman dan source terbaru "ON TESTED"]
Jika Ada yang dah Hight Performance dan sukses, kasih info yah….
Setelah sebelumnya, 2 tahun lalu aku Install FreeBSD 6 dengan Squid 2.6, sekarang aku akan buat TUT untuk versi yang terbaru.
seperti biasanya :
[Seperti kata mas ogeb]
PERHATIAN:
1. Jangan pernah mencoba ini jika anda tidak tau apa yang anda lakukan.
2. Jangan pula mencoba ini jika anda tidak tau apa itu FreeBSD .
3. siapkan rokok + kopi secukup nya jika anda perokok berat , karena proses ini akan memakan waktu. ( bagi yang ngak puasa
)
4. Tulisan ini di dedikasikan untuk kemajuan freebsd di indonesia.
5. Dipersilahkan mengcopy atau memeperbanyak tulisan ini tanpa seijin saya demi kemajuan freebsd di Indonesia.
Spec Intel Desktop Server, Proc PIV 2.8 Ghz HDD SATA 120GB, RAM 1GB
FreeBSD 7.2-RELEASE/i386
squid-3.HEAD
Perls5.10
Apache 2.2
Lightsquid
Bissmillahirohmannirrohim
Install FreeBSD
Masukin CD Iso, buat slace HDD dan set Bootable Flag ( kalo lupa, ulang lagi lo
)
mount partisi dan hasil nya :
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 9.7G 143M 8.8G 2% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/ad4s1d 15G 4.0K 14G 0% /cache
/dev/ad4s1g 3.7G 12K 3.4G 0% /tmp
/dev/ad4s1e 34G 1.1G 30G 4% /usr
/dev/ad4s1f 44G 12M 40G 0% /var
Lalu pilih Standart Installasi, Distribution [X] 6 Kern-Developer Full binaries and doc, kernel source only
lalu ikuti saja permintaan nya seperti :
IP, ssh_login, Time, PS/2, Browser Collection “no” lalu restart… SELESAI
edit file /etc/ssh/sshd_config
line :
#PermitRootLogin no
dirubah :
PermitRootLogin yes
Nah… saat nya FreeBSD di kawinin ma Ports nya pakai CVSUP
proxy# pkg_add -r cvsup-without-gui
Installation DONE.
proxy# cp /usr/share/examples/cvsup/ports-supfile /root/
proxy# ee ports-supfile
*default host=CHANGE_THIS.FreeBSD.org
ganti menjadi :
*default host=ftp.sg.FreeBSD.org
ganti CHANGE_THIS.FreeBSD.org dengan mirror yang kita inginkan, lihat di :
http://www.freebsd.org/doc/en/books/handbook/mirrors-ftp.html
proxy# cvsup -g -L 2 /root/ports-supfile
silahkan tunggu, di aku sekitar 30 menit
SELESAI deh, kita masuk tahap selanjut nya.
Compile Kernel
proxy# cd /usr/src/sys/i386/conf/
backup dulu file konfigurasi kernel nya :
proxy# cp GENERIC KERNELBARU
Kemudian Edit file konfigurasi KERNELBARU sesuai kebutuhan, Jangan lupa mengganti baris “ident” dari GENERIC menjadi KERNELBARU (sesuaikan dengan nama file konfigurasinya).
Untuk Hardware, bijaksana ajah yah, sesuaikan dengan kebutuhan
OPTION yang di tambah kan untuk menjalankan squid :
# untuk PF #
device pf
device pflog
device pfsync# untuk optimasi squid #
options SYSVMSG
options MSGMNB=32768
options MSGMNI=164
options MSGSEG=8196
options MSGSSZ=512
options MSGTQL=2048
setelah itu :
proxy# config KERNELBARU
proxy# cd ../../compile/KERNELBARU
proxy# make cleandepend && make depend
proxy# make && make install
CELECEI…… REBUT…..
Install Perl5.10
proxy# cd /usr/ports/lang/perl5.10/
proxy# make install clean
Install Apache2.2
proxy# cd /usr/ports/www/apache22
proxy# make install clean
biar jalan setiap kali restart masukan parameter ke /etc/rc.conf
apache22_enable=”YES”
Install Squid
Buat group dan user yang akan di gunakan untuk menjalankan squid :
proxy# pw group add squid -g 100
proxy# pw user add squid -u 100 -g squid -s /usr/sbin/nologin -d /usr/local/squid
proxy# chown -Rv squid:squid /cache
proxy# cd /usr/local/
proxy# fetch http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE18.tar.bz2
proxy# tar -zxvf ssquid-3.HEAD.tar.bz2
proxy# cd squid-3.0.STABLE18
proxy# ./configure -prefix=/usr/local/squid \
–enable-gnuregex \
–enable-async-io=24 –with-pthreads –with-aio –with-dl –with-aufs-threads=24 –with-pthreads \
-enable-pf-transparent \
–enable-ipfw-transparent \
-enable-storeio=aufs \
-enable-removal-policies=heap \
-enable-delay-pools \
-enable-underscores \
–enable-http-violations \
–enable-unlinkd \
-enable-snmp \
-enable-useragent-log \
-enable-htcp \
-enable-ssl \
-enable-icmp \
–enable-poll \
-enable-arp-acl \
-enable-cache-digests \
-enable-kill-parent-hack \
-enable-large-cache-files \
-enable-follow-x-forwarded-for \
-enable-default-err-languages=English \
-enable-err-languages=English \
-disable-ident-lookups \
-disable-hostname-checks \
-disable-wccpv2 \
-disable-wccpproxy# make && make install
Setelah itu edit lah squid.conf sesuai dengan kebutuhan
proxy# ee /usr/local/squid/etc/squid.conf
ctt: squid conf aku pakai yang minimalis dulu, karena trial dan error, karena aku lihat masih ada permasalahan di sana sini, jadi kembangin ajah, kalo nemu yang ok, aku publish… atau kawan~ dah nemu kasih info yah, thx
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 192.168.10.0/27
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow localhost
http_access deny all
http_port 8080 transparent
hierarchy_stoplist cgi-bin ?cache_mem 6 MB
maximum_object_size_in_memory 32 KB
memory_replacement_policy heap LFUDAcache_replacement_policy heap GDSF
cache_dir aufs /cache 10000 24 256
maximum_object_size 128 MB
cache_swap_low 90
cache_swap_high 95access_log /var/log/squid/logs/access.log
cache_log /var/log/squid/logs/cache.logcoredump_dir /cache
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320cache_mgr webmaster@domainku.com-(0752-xxxxxx)
cachemgr_passwd squid-cache password
cache_effective_user squid
cache_effective_group squid
proxy# squid -z
2009/05/10 16:38:37| Creating Swap Directories
cek terlebih dahulu konfigurasi nya dengan perintah :
proxy# /usr/local/squid/sbin/squid -k parse
proxy# /usr/local/squid/sbin/squid -NCd1
setelah dirasa cukup, jalan kan squid :
proxy# /usr/local/squid/sbin/squid
dan untuk menjalankan perubahan config, dapat dengan perintah
proxy# /usr/local/squid/sbin/squid -k reconfigure
biar jalan setiap kali restart masukan parameter ke /etc/rc.conf
squid_enable=”YES”
pf_enable=”YES”
atau masukkan perintah /usr/local/squid/sbin/squid ke /etc/rc.local
lalu tambahkan di /etc/rc.local
chgrp squid /dev/pf && chmod g+rw /dev/pf
Cache Manager
CACHE MANAGER
If you want to use the WWW interface to the Cache Manager, copy
the cachemgr.cgi program into your httpd server’s cgi-bin
directory.
lalu tambahkan di httpd.conf :
AllowOverride None
Options None
Order allow,deny
Allow from all
Restart Semua service terkait
proxy# /usr/local/etc/rc.d/apache22 restart
proxy# /usr/local/etc/rc.d/squid restart
CIMIIW….
Install Lightsquid
Di kawinin ama ports nya ajah untuk lightsquid, gampang kok
==========================================================================================
Kesimpulan :
dari langkah di atas di dapat :
Connection information for squid:
Number of clients accessing cache: 11
Number of HTTP requests received: 733
Number of ICP messages received: 0
Number of ICP messages sent: 0
Number of queued ICP replies: 0
Number of HTCP messages received: 0
Number of HTCP messages sent: 0
Request failure ratio: 0.00
Average HTTP requests per minute since start: 617.5
Average ICP messages per minute since start: 0.0
Select loop called: 1184 times, 9.109 ms avg
Cache information for squid:
Hits as % of all requests: 5min: 18.7%, 60min: 18.7%
Hits as % of bytes sent: 5min: 4.4%, 60min: 4.4%
Memory hits as % of hit requests: 5min: 0.0%, 60min: 0.0%
Disk hits as % of hit requests: 5min: 9.0%, 60min: 9.0%
Storage Swap size: 68374 KB
Storage Swap capacity: 0.7% used, 99.3% free
Storage Mem size: 4320 KB
Storage Mem capacity: 70.3% used, 29.7% free
Mean Object Size: 10.45 KB
Requests given to unlinkd: 0
Median Service Times (seconds) 5 min 60 min:
HTTP Requests (All): 1.05672 1.05672
Cache Misses: 1.17732 1.17732
Cache Hits: 0.00000 0.00000
Near Hits: 0.80651 0.80651
Not-Modified Replies: 0.00000 0.00000
DNS Lookups: 0.00394 0.00394
ICP Queries: 0.00000 0.00000
Resource usage for squid:
UP Time: 101.662 seconds
CPU Time: 2.160 seconds
CPU Usage: 2.12%
CPU Usage, 5 minute avg: 1.89%
CPU Usage, 60 minute avg: 1.89%
Process Data Segment Size via sbrk(): 0 KB
Maximum Resident Size: 20872 KB
Page faults with physical i/o: 0
Memory accounted for:
Total accounted: 9917 KB
memPoolAlloc calls: 227328
memPoolFree calls: 194354
File descriptor usage for squid:
Maximum number of file descriptors: 11072
Largest file desc currently in use: 266
Number of file desc currently in use: 249
Files queued for open: 0
Available number of file descriptors: 10823
Reserved number of file descriptors: 100
Store Disk files open: 22
Internal Data Structures:
6617 StoreEntries
513 StoreEntries with MemObjects
467 Hot Object Cache Items
6546 on-disk objects
GOOD LUCK
Belum Ada Tanggapan »
RSS umpan untuk komentar-komentar dalam tulisan ini. URI Lacak Balik
Tinggalkan komentar
Blog pada WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

