Install squid di slackware

Posted: February 27, 2009 in Slackware

Benda yg selalu aku buat tapi memang payah nak ingat,

bukan setting tapi squid.conf punya setting.

download squid package:

wget http://mirrors.unixsol.org/linuxpackages//Slackware-12.0/Daemon/squid/squid-2.6.STABLE14-i486-1xav.tgz

tak pun clik sini ——> squid

dah tu install

# installpkg Squid-2.6.STABLE14-i486-1xav.tgz

Kemudian buat script bash:

# pico /etc/rc.d/rc.squid


——————————————– cut here ————————————

#!/bin/sh
echo -n ‘ squid ‘
case “$1″ in
start)
/usr/sbin/squid -D
;;
stop)
/usr/sbin/squid -k shutdown
;;
restart)
/usr/sbin/squid -k reconfigure
;;
*)
echo “Usage: `basename $0`
{start|stop|restart}”
;;
esac

——————————————— cut here ————————————

pas tu chmod kan

#chmod 755 /etc/rc.d/rc.squid

kalau nak senang letak dalam /etc/rc.d/rc.init2

#pico  /etc/rc.d/rc.inet2

tambah benda alah ni kat bawah sekali fule tuh

———————————— cut here ——————————————–

# Start SQUID (Squid proxy server):
if [ -x /etc/rc.d/rc.squid ]; then
. /etc/rc.d/rc.squid start
fi

——————————— cut here ————————————————

pah tu chmod kan folder squid tuh

# chown -R nobody:nogroup /var/lib/squid/

Create swap directories

# squid -z
2009/01/02 13:31:10| Creating Swap Directories

dah tu semua selesai buat plak

# mv squid.conf squid.conf-asal

#pico squid.conf

———————————- cut here ————————————————

http_port 312 transparent
cache_mem 128 MB
maximum_object_size 256 KB
minimum_object_size 4 KB
cache_dir diskd /cache 20000 16 256 Q1=72 Q2=64
cache_access_log /usr/local/squid/var/logs/access.log
cache_log /usr/local/squid/var/logs/cache.log
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl all src 0.0.0.0/0.0.0.0
acl our_networks src 192.168.100.0/24 <— network sendiri lah
acl lan src 10.35.20.0/24
http_access allow our_networks

——————————— cut here ————————————————

yg nih jangan lupa forward kan port 80 utk jumpa squid kito.

iptables -t nat -A PREROUTING -i eth1 -p tcp –dport 80 -j DNAT –to 118.98.169.11:3128

yg ni jangan lupa plak idupkan squid tuh
# /etc/rc.d/rc.squid start

kalau follow tutorial nih memang menjadi kalau tak jadi pepandai lah tanya pak sedara aku.. MR.GOOGLE ;p

Comments
  1. robby says:

    cache_dir diskd /cache 20000 16 256 Q1=72 Q2=64 <<–dapat perhitungan Q1=72 dan Q2=64 itu darimana mas??

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s