အင္တာနက္ဆုိင္ေတာ္ေတာ္မ်ားမ်ား။ main server ၾကိးေတမွာျမင္ရမွာပါ။ squid ကိုပဲ gateway အျဖစ္သုံးၾကပါတယ္။ မ်ားအားျဖင့္ networking နဲ့ပတ္သက္လာရင္
ဒါကို လုပ္ခုိင္းၾကပါတယ္။ mpt က ADSL ကိုလည္း proxy server ခံခ်င္တယ္။ ipstar ကိုလည္း server ခံခ်င္တယ္ဆုိၾကပါစုိ႔ ။ဒါကို သုံးႏုိင္ပါတယ္။
တစ္ခ်ဳီ႔အင္တာနက္ဆုိင္ေတြ ရုံးေတြ industry ေတြ မွာ မလုပ္တတ္ၾကလုိ႔ squid ကို run နိုင္ဖုိ႔အတြက္ ပုိက္္ဆံေပးျပိး လုပ္ခုိင္းရပါတယ္။က်ေနာ္
ဒီေနရာမွာ မိမိကိုယ္တုိင္ လုပ္တဲ့နည္းရယ္ မလုပ္တတ္ဘူးဆုိရင္။ အလြယ္သုံးခ်င္တယ္ဆုိရင္လည္း အဆင္ေျပေအာင္
Software ပါ ေရးေပးထားပါတယ္။ start and stop လုပ္ရုံပါပဲ။ ဒီပို႔စ္မွာေတာ့ manually လုပ္နည္းကို တစ္ဆင့္ခ်င္းေျပာသြားပါ့မယ္။
ေနာက္ပို႔စေတြမွာ က်ေနာ္ကိုိယ္တုိင္ေရးထားတဲ့ software ကို တင္ေပးပါ့မယ္။
#########################################################
#squid installing and configuration by [EMAIL="yeakhar@myanmarengineer.org"]yeakhar@myanmarengineer.org[/EMAIL]
#[URL="http://www.myanmarenginer.org"]www.myanmarenginer.org[/URL]
#ေရခါး@MEF
#############################################
____________________________________________________________________________________________________
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Squid Installing and Configuration
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
___________________________________________________________________________________________________
===========================================
Installation Squid Proxy Server
===========================================
ိdownload လုပ္၇န္
[URL="http://squid.acmeconsulting.it/download/squid-2.7.STABLE6-bin-DELAYP.zip"]squid.2.7 stable 6 version[/URL]
1. squid folder ကို အရင္ ေနရာခ်။ c:\Squid ။ space ျခားတဲ့ ေနရာမွာ မထားပါနဲ႔။ ဥပမာ (မသုံးရန္) c:\my proxy\squid ။
2. etc folder ထဲမွ squid.conf.default ဖုိင္ကို ေကာ္ပီအရင္ပြားထားျပီးမွ squid.conf သု႔ိေျပာင္း။
3. etc folder ထဲမွ mime.conf.default ဖုိင္ကို ေကာ္ပီအရင္ပြားထားျပီးမွ mime.conf သုိ႔ေျပာင္း။
3. etc folder ထဲမွ cachemgr.conf.default ဖုိင္ကို ေကာ္ပီအရင္ပြားထားျပီးမွ cachemgr.conf သုိ႔ေျပာင္း။
squid.conf.default ==> squid.conf
mime.conf.default ==> mime.conf
cachemgr.conf.default ==> cachemgr.conf
------------------------------------------
@creating swap folder
--------------------------------------------
4. var folder ထဲမွာ cache ဆုိျပီး ဖုိဒါေဆာက္ေပး။
===================================================
Configuration Squid proxy server
====================================================
squid.conf ဖုိင္ကိုconfiguration စလုပ္။
# ကို ေရွ႔က ခံထားရင္ အဲဒါဟာ comment ပုံစံပဲျဖစ္ပါတယ္။ ဘာ effect မွ မရွိပါဘူး။
-------------------------------
@setting squid service port
------------------------------------
1. http_port ကို ထည့္ပါ။ squid က ဒီ port နဲ႔ run ေနမွာျဖစ္ပါတယ္။ default ကေတာ့
format
port [options]
hostname
ortexample
http_port 3128
ဒီအတုိင္း မထားခ်င္ဘူးဆုိရင္ေတာ့ 3128 ေနရာမွာ ကိုလုိခ်င္တဲ့ port ကို ေျပာင္းေပးႏုိင္ပါတယ္။
ဥပမာ
http_port 3177
LAN ကိုခ်ိတ္ထားတဲ့ network card ရဲ႔အုိင္ပီက 192.168.0.1 ဆိုရင္
http_port 192.168.0.1:3177 ဆိုျပီးထားတာ ပုိေကာင္းပါတယ္။ security reson ေပါ့။
-----------------------------------------
@adding cache directory
-----------------------------------------
2. cache directory ေနရာကို ညြွန္ျပ။ cache_dir ufs /usr/local/squid/var/cache 100 16 256 ကဲ့သုိ႔ေသာ line ကို မိမိကြန္ပ်ဳတာရွိ သက္ဆုိင္ေသာ
ေနရာကို ေျပာင္းေပး။100 ေနရာသည္ file system တြင္ 100 mega bytes ယူေၾကာင္းေၾကေျငာျခင္းျဖစ္တယ္။ 16 ဖိုဒါေဆာက္။ 256 sub folder ထပ္ေဆာက္ေၾကာင္းေျပာထားျခင္းျဖစ္တယ္။
\ ကို မသုံးပါနဲ႔။ / ကို သုံးပါ။
ဥပမာ။
cache_dir C:/squid/var/cache သုိ႔ေျပာင္း။
--------------------------------------------------
@making access control lists (acl)
--------------------------------------------
3. acl (access contorl lists)ကို လုပ္ေပးရန္လိုလာျပီ။
format က
acl aclname acltype argument ...
acl aclname acltype "file" ...
ဥပမာ
acl mylan src 127.0.0.1/255.255.255.255
mylan သည္ acl နာမည္ျဖစ္ပါတယ္။ src ဆိုတဲ့ type ဟာ source ကို ေျပာတာပါ။
argument ကေတာ့ 127.0.0.1 ကေန netmask 255.255.255.255 အထိလုိ႔ ေျပာျခင္းျဖစ္ပါတယ္။
type မ်ား
ACL name Refers to
src source IP address any client connection
dst destination IP address in any con nection
srcdomain reverse lookup client IP
dstdomain destination domain from URL
time time component of the request
proxy_auth used for proxy authentication
ဥပမာ ပုံစံမ်ား
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 localnet src 192.168.10.0/255.255.255.0
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network (or )
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network (or)
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
#
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
တစ္ကယ္လို႔သာ proxy server ကို username နဲ႔စကား၀ွက္ခ်ထားမယ္ဆုိရင္ေတာ့ authentication type တစ္ခုခုကို သုံးရပါတယ္။
squid ဟာ authentication လုပ္ဖုိ႔ ျပင္ပ program တစ္ခုခုကိုအသုံးခ်ပါတယ္။
NCSA: NCSA style flat file containing username and encrypted password
PAM: Use the password authentication module on the machine
SAMBA: Authenticate against a Windows NT or a Samba server
LDAP: Authenticate against information from an LDAP tree
NTLM: Multidomain NTLM authentication
YP: Authenticate using NIS
configuration ကိုလည္းေျပာင္းေပးဖုိ႔လိုအပ္ပါတယ္။
ဥပမာ ncsa အတြက္ c:/squid/etc/squid.pass က username and pasword ထည့္ထားတဲ့ဖုိင္ပါ။ဒီဖုိင္ကို apache မွာပါတဲ့ htpasswd.exe နဲ႔လုပ္ထားရပါတယ္။ လုပ္နည္းက apache/bin မွာရွိတဲ့ htpasswd.exe ကို
c:\squid\sbin\ ေအာက္ကို ေကာ္ပီပြားထားပါ။
ျပီးရင္ command line ကေန sbin ေအာက္ကုိ cd c:\squid\sbin နဲ႔ေျပာင္းပါ။ ပထမဆုံးအၾကိမ္ squid.pass ဖုိင္ကို create ဖုိ႔အတြက္ -c ကို သုံးပါတယ္။
--------------------------------------------------------------------------------------
cmd> htpasswd -c "C:\squid\etc\squid.pass username userpassword
-----------------------------------------------------------------------------------------
ေနာက္တစ္ၾကိမ္ တစ္ျခားသူကို ေပါင္းခ်င္ရင္
-----------------------------------------------------------------------------------------------
cmd> cmd> htpasswd "C:\squid\etc\squid.pass next_username next_userpassword
----------------------------------------------------------------------------------------------
ဒါဆုိရင္ squid.pass ဆိုတဲ့ etc ေအာက္မွာ password ဖုိင္တစ္ခုရပါျပီ။ ဒါကုိ configuration file မွာ အသုံးျပဳရပါမယ္။ program က ncsa_auth ကိုသုံးျပီး password ဖုိင္က squid.pass ျဖစ္ေၾကာင္း
ေအာက္ပါစာေၾကာင္းက ေၾကျငာပါတယ္။
-------------------------------------------------------------------------------------
auth_param basic program c:/squid/libexec/ncsa_auth c:/squid/etc/squid.pass
-----------------------------------------------------------------------------------------------
အေပၚကလို ဘယ္ဖုိင္ကို အသုံးျပုမယ္ဆုိတာလုပ္ျပီးရင္ အဲဒီလူေတြရေအာင္ ထပ္လုပ္ေပးရပါတယ္။
ေအာက္က စာသားေတြကေတာ့ proxy_auth လိုတဲ့ေၾကာင္းကို ေျပာတာပါ။ ျပီးေတာ့ password နဲ႔ ၀င္လာတဲ့သူကိုပဲ http_access allow password ကလက္ခံပါတယ္။
http_access deny all နဲ႔ က်န္တာကို deny လုပ္ထားေပးပါတယ္။
-----------------------------------------------------------------------------------------------------
ဥပမာ ပုံစံ acl ကို အရင္လုပ္ရပါတယ္။ ျပီး access လုပ္ရပါတယ္။
acl password proxy_auth REQUIRED
acl localnet src 192.168.1.0/255.255.255.0 or acl localnet src 10.0.0.0/255.255.255.0
http_access deny !localnet
http_access allow password
http_access deny all
------------------------------------------------------------------------------------------------------
[user name တစ္ခုခ်င္းဆီဆိုရင္လည္း ေအာက္မွာပါတဲ့အတုိင္း username ေတြကိုေရးထားရပါမယ္။
#acl aclname proxy_auth]
------------------------------------------
@Authorizing access to group
--------------------------------------------
4. acl ကို လုပ္ျပီးျပီ ဆုိရင္ ဘယ္ protocol ကုိ ဘယ္ acl_name ေတြက သုံးခြင့္ရွိလဲဆိုျပီး ေၾကျငာေပးဖုိ႔လုိအပ္ပါတယ္။
http ကို allowed_hosts ဆိုတဲ့ ACL Name က သုံးမယ္ က်န္တဲ့ အုိင္ပီေတြကို ခြင့္မျပဳဘူးဆုိရင္ ဒီလိုေရး ။ခြင့္ျပဳခ်င္တဲ့ အုိင္ပီကို အရင္ေရးဖုိရေတာ့
လိုပါတယ္။
http_access allow manager localhost
http_access deny manager all
http_access allow localnet
http_access deny all
user name and password နဲ႔သုံးမယ္ဆိုရင္ေတာ့ acl တစ္ခု ထပ္ထည့္ျပီး ေအာက္ကဟာကို သုံးပါ။ထပ္ထည့္ရမယ့္ acl ကေေတာ့
acl password proxy_auth REQUIRED ျဖစ္ပါတယ္။
http_access allow manager localhost
http_access deny manager all
auth_param basic program c:/squid/libexec/ncsa_auth.exe c:/squid/etc/squid.pass
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
http_access deny !localnet
http_access allow localhost
http_access allow password
http_access deny all
------------------------------
@declaration of host name
-------------------------------
5. မိမိ run ေနတဲ့ host နာမည္ကို visible_hostname မွာ ထည့္ပါ။ visible_hostname ကိုရွာျပီး ေျပာင္းပါ။
ဥပမာ
visible_hostname myanmarengineer.org
-----------------------------
adding email address
-----------------------------
6. cache_mgr မွာ မိမိအသုံးျပဳမယ့္ အီးေမးကို ထည့္ပါ။ cache_mgr ကို ရွာျပီး ေျပာင္းပါ။ဥပမာ
cache_mgr [EMAIL="yeakharr@myanmarengineer.org"]yeakharr@myanmarengineer.org[/EMAIL]
------------------------------------
@setting dns namesserver
------------------------------------
7. dns_nameservers ကို ထည့္ထားေပးပါ။mpt ADSL က တစ္မ်ုိး။ ipstar ဆိုတစ္မ်ဳိးျဖစ္မွာပါ။ ဥပမာ
dns_nameservers 10.1.0.1
or
dns_nameserver 203.70.72.200
************************************
@Running Squid services
************************************
9. minimum configuration ျပီးျပီ ဆုိရင္ေတာ့ squid ကို run ရပါမယ္။ ပထမဆုံးအၾကိမ္ run ျခင္းဆုိပါက cache ေနရာကို ဖန္တီးရမွာျဖစ္လို႔
windows logo+R နွိပ္ျပီး run ကို ေခၚပါ။ cmd လို႔ရိုက္ျပီး command prompt ကုိ လွမ္းေခၚလုိက္ပါ။ ျပီးရင္ cd c:\squid\
command line ကေန squid ရွိတဲ့ေနရာကိုေရာက္ျပီဆုိရင္ ပထမဆုံးအၾကိမ္ run ျခင္းဆုိပါက cache ေနရာကို ဖန္တီးရမွာျဖစ္လို႔ -z ဆိုတဲ့ option သုံးရပါမယ္။
cmd> squid -z
အဲဒီအခ်ိန္မွာ နည္းနည္းေတာ့ ၾကာတတ္ပါတယ္။ folder ေတြကို create လုပ္ေနတဲ့အတြက္ပါ။ျပီးရင္ squid ကုိ ရုိက္ျပီး အင္တာေခါက္ပါ။
cmd> squid
squid ေသေသခ်ာခ်ာအလုပ္မလုပ္ကို logs ဖိုဒါထဲက Logs ကုိၾကည့္နုိင္ပါတယ္။ ပထမဆုံးအၾကိမ္ မဟုတ္ေတာ့ ဘူးဆုိရင္ေတာ့
cmd line ကေန squid လို႔တန္းရုိက္ျပီး run ရုံပါပဲ။ တစ္ကယ္လို႔ windows စတုိင္း squid ကို အလိုလို run ျပီးသားျဖစ္ခ်င္ရင္ေတာ့ windows services lists မွာ
ထည့္ေပးဖို႔လိုအပ္ပါတယ္။ တစ္ကယ္လုိ႔ DNS lookup fail ဆိုရင္ ေအာက္ကပုံးစံအတုိင္း သုံးပါ။
cmd> squid -D
---------------------------------------------
-----------------------------------------------
@ windows service အျဖစ္ install နည္း
------------------------------------------------
-------------------------------------------------
command line ကေနျပီး squid -i -n "Squid" ဆုိျပီးရုိက္ျပီး enter ေခၚပါ။ vista/windows7 မွာဆုိရင္ေတာ့ c:\squid\sbin\squid.exe ကို right click ေထာက္ျပီး comatiblity မွာ run as administrator ကို အမွန္ျခစ္ထားဖုိ႔ေတာ့လိုပါမယ္။
-i က အင္စေတာ option ပါ။ -n က service name ပါ။ -n "Squid" ဆိုရင္ Squid ဆုိတဲ့နာမည္နဲ႔ windows service မွာ ေပါင္းထည့္မွာျဖစ္ပါတယ္။ -n မပါဘဲလည္းရပါတယ္။ squid -i ဆိုရင္ default အေနနဲ႔ Squid ဆိုတဲ့အမည္နဲ႔ပဲ ေပါင္းထည့္မွာပါ။
cmd> squid- i
သို႔မဟုတ္
cmd> squid- i -n "Squid"
Uninstall: မယ္ဆုိရင္ ဒီတုိင္းရုိက္။
squid -r
************************************ေရးတဲ့လူကေရးခါးတဲ့
No comments:
Post a Comment