Professional Documents
Culture Documents
Ubuntu710 Xxxkung Hadyai Demo
Ubuntu710 Xxxkung Hadyai Demo
บทนํา
ขอขอบคุณทุกทานที่ใหการสนับสนุน
หาดใหญอินเตอรเน็ต
3. อินเตอรเน็ต (Internet)
ควรเลือกระบบอินเตอรเน็ตใหเหมาะสมกับ บริการ ที่เราตองการใชงาน เชน ADSL เหมาะสําหรับทองเวป ftp
โหลดขอมูล เนนการ Download มากกวา Upload เปนตน สวน G.SHDSL หรือ Leased Line เปนระบบทีต่ อ งการคา
Upload เทากับคา Download เหมาะสําหรับ การเลนเกมส หรือ บริการที่ตองการเสถียรภาพสูง และการเลือกบริการ
อินเตอรเน็ตแบบ Fixed IP เหมาะสําหรับเกมสออนไลนที่มีบริการเสริมพวก IP Bonus หรือ iCafe เปนตน
4. วางแผนการติดตั้ง (Planning)
จะตองเตรียม ขอมูลการตั้งคาโมเด็ม คา VPI/VCI และคา Username / Password ของอินเตอรเน็ตแตละเสน
รายชื่อ เกมสออนไลนตาง ๆ ที่มีใหบริการภายในราน เมื่อครบเรียบรอยแลว ก็เตรียมดําเนินการขั้นตอไป
เลือก English
เลือก other
เลือก No
เลือก Thailand
รอสักครู
ทําการติดตั้ง Network
กําหนด IP Address
กําหนด Netmask
กําหนด Gateway
กําหนด DNS
ใสชื่อเครื่อง Server
ตอบ Yes
รอสักครู
ตอบ Yes
ใสชื่อเต็มของผูดูแลระบบ
รอสักครู
รออีกแลว
(อาจจะนานหนอยถาหาก Server ไมเชื่อมตอ Internet)
รอสักครู
โปรแกรม putty
เปนโปรแกรมใชสําหรับการ Remote เขาสู Server ผานโปรโตคอล SSH ซึ่งมีการเขารหัสความปลอดภัย
วิธีการใชงานก็ ดับเบิ้ลคลิ๊กโปรแกรมขึ้นมา
พิมพพาสที่ตั้งไว (จะไมสามารถมองเห็นตัวอักษรที่พิมพไป)
เลือก Next
เลือก Next
เลือก Next
เลือก Install
โปรแกรมกําลังติดตั้งลงสูเครื่องคอมพิวเตอร
โปรแกรมจะแจงคียการเขารหัสในครั้งแรกที่มีการเชื่อมตอเพื่อบันทึกลงในเครื่อง
ใหตอบ Yes
เมื่อทําการโอนไฟลเสร็จเรียบรอยแลวจะได
เมื่อ User เปลี่ยนเปน admin แลวจะมีปุม SpeedTouch เพิม่ ขึ้นมา กดทีป่ ุม SpeedTouch
เลือก Setup
รอสักครู
กดปุม Finish
ขั้นตอนแรกจะตองทําการตรวจเช็ค วา LAN Card หรือ Interface eth0, eth1, eth2 มีครบหรือไม
ใหใชโปรแกรม putty เพื่อทําการ Remote เขาไปยังเครื่อง Server และทําการ Login ดวย user/password ที่กําหนดไว
เมื่อสามารถ Remote เขาไปไดแลว ใหใชคาํ สั่ง ifconfig –a เพื่อทําการตรวจสอบ interface ทั้งหมดทีม่ ีอยู
จะไดผลลัพธออกมาวา
xxxkung@netcafe:~$ ifconfig –a
ถาไมมีอะไรผิดพลาด จะมองเห็น Interface ทั้งหมดดวยกัน 4 Interface ไดแก lo, eth0, eth1 และ eth2 แสดงวา
Ubuntu สามารถมองเห็น LAN Card ทั้งหมด 3 Interface แตถาหาก ทําการ ifconfig –a แลว แตมองเห็น Interface ไม
ครบ ขาดอันใดอันหนึ่งไป จะตองทําการตรวจเช็คหาสาเหตุ อาจจะเปน LAN Card หลวม หรือ Ubuntu ไมสามารถ
Detect LAN Card ชนิดนั้น ได วิธีแกปญหาก็คือ ใหตรวจสอบชนิดของ LAN Card และทําการติดตั้ง Driver เอง หรือไม
ก็ทําการเปลี่ยน LAN Card เปนชนิดที่ Ubuntu สามารถ Detect เองได
เมื่อ Interface ครบแลว ใหทาํ การใชคําสั่ง sudo pppoeconf eth1 เพื่อทําการเชื่อมตอ PPPoE ผาน eth1
ตอบ Yes
รอสักครู
ตอบ Yes
ใส Password
ตอบ Yes
ตอบ Yes
ตอบ Yes
ตอบ Yes
ตอบ Ok
เสร็จสิ้นการ Config
xxxkung@netcafe:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E4:38:8D
inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee4:388d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:404 errors:0 dropped:0 overruns:0 frame:0
TX packets:333 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:31845 (31.0 KB) TX bytes:35943 (35.1 KB)
Interrupt:17 Base address:0x1400
ใหลองทําการพิมพคําสั่ง sudo –s
ระบบจะถามรหัสผาน ใหทําการพิมพรหัสผานเดียวกันกับ รหัสผานที่ใช Login User เขามา จะไดผลลัพธวา
xxxkung@netcafe:~$ sudo -s
[sudo] password for xxxkung:
root@netcafe:~#
จากตัวอยางจะเห็นวา User xxxkung เมื่อทําการ sudo –s จะเปลี่ยนเปน User root แลว ตอไปในการพิมพคําสั่ง
ก็ไมจําเปนตองมีคําวา sudo นําหนา
เมื่อทําการ update รายชื่อ package เปนที่เรียบรอยแลว ขั้นตอนตอไป ก็คือ เราจะตอง download package ที่
จําเปนตองใช มาเก็บไวในเครื่อง Server
จะไดผลลัพธดังนี้
Suggested packages:
binutils-doc cpp-doc gcc-4.1-locales debian-keyring g++-multilib g++-4.1-multilib gcc-4.1-doc gcc-
multilib manpages-dev autoconf automake1.9 libtool flex
bison gdb gcc-doc gcc-4.1-multilib glibc-doc libstdc++6-4.1-doc make-doc diff-doc
Recommended packages:
libmudflap0-dev
The following NEW packages will be installed:
binutils build-essential cpp cpp-4.1 dpkg-dev g++ g++-4.1 gcc gcc-4.1 gcc-4.1-base libc6-dev libstdc++6-
4.1-dev linux-libc-dev make patch
The following packages will be upgraded:
libc6 libc6-i686
2 upgraded, 15 newly installed, 0 to remove and 55 not upgraded.
Need to get 9272kB/18.0MB of archives.
After unpacking 47.9MB of additional disk space will be used.
Do you want to continue [Y/n]? Y <ใหตอบ Y หรือกด Enter เพื่อยืนยัน>
Get:1 http://th.archive.ubuntu.com gutsy-updates/main libc6 2.6.1-1ubuntu10 [4184kB]
Get:2 http://th.archive.ubuntu.com gutsy-updates/main libc6-i686 2.6.1-1ubuntu10 [1148kB]
Get:3 http://th.archive.ubuntu.com gutsy-updates/main linux-libc-dev 2.6.22-15.54 [654kB]
Get:4 http://th.archive.ubuntu.com gutsy-updates/main libc6-dev 2.6.1-1ubuntu10 [3287kB]
Fetched 9272kB in 3m8s (49.1kB/s)
(Reading database ... 17961 files and directories currently installed.)
Preparing to replace libc6 2.6.1-1ubuntu9 (using .../libc6_2.6.1-1ubuntu10_i386.deb) ...
Unpacking replacement libc6 ...
Setting up libc6 (2.6.1-1ubuntu10) ...
ตอไปเปนคําสั่งพื้นฐาน
ls –l แสดงไฟลที่อยูใน folder ปจจุบัน
cd สั่งเปลี่ยน folder
rm คําสั่งลบไฟล
mv คําสั่งเปลี่ยนชื่อไฟล
cp คําสั่ง copy ไฟล
tar xvjf คําสั่งแตกไฟลนามสกุล .tar.bz2
tar xvzf คําสั่งแตกไฟลนามสกุล .tar.gz
ซึ่งคําสั่งเหลานี้จะไดใชในตอนตอไป
root@netcafe:~# ls -l
total 16
drwxr-xr-x 2 xxxkung xxxkung 4096 2008-07-08 02:34 710layer7
drwxr-xr-x 2 xxxkung xxxkung 4096 2008-07-08 02:34 Manual
drwxr-xr-x 2 xxxkung xxxkung 4096 2008-07-08 02:34 Script
drwxr-xr-x 2 xxxkung xxxkung 4096 2008-07-08 02:34 Software
root@netcafe:~#
root@netcafe:~# cd 710layer7/
root@netcafe:~/710layer7# ls -l
total 274032
-rwxr-xr-x 1 xxxkung xxxkung 633 2008-07-08 11:53 install.sh
-rw-r--r-- 1 xxxkung xxxkung 172584 2007-06-25 06:37 iptables-1.3.8.tar.bz2
-rw-r--r-- 1 xxxkung xxxkung 127674 2008-04-24 09:54 l7-protocols-2008-04-23.tar.gz
-rw-r--r-- 1 xxxkung xxxkung 56932772 2007-11-22 00:45 linux-2.6.22.14.tar.gz
-rw-r--r-- 1 xxxkung xxxkung 8740700 2008-06-12 18:03 linux-headers-2.6.22.14-l7support_2.6.22.14-
l7support-10.00.Custom_i386.deb
ใน folder 710layer7 จะมีไฟลอยู 8 ไฟล โดยจะมี script ชื่อ install.sh ใหทําการรัน script install.sh โดยใช
คําสั่ง chmod +x install.sh และ ./install.sh
จะมีใหตอบคําถามอยู คือ
xxxkung@netcafe:~$ uname -a
Linux netcafe 2.6.22.14-l7support #1 SMP Thu Jun 12 16:46:34 ICT 2008 i686 GNU/Linux
xxxkung@netcafe:~$
ถาหากไดผลลัพธเปน
Linux netcafe 2.6.22.14-l7support #1 SMP Thu Jun 12 16:46:34 ICT 2008 i686 GNU/Linux
ใหทําการ Remote เขา Server แลว sudo –s เพื่อทําการเปลี่ยนเปน User root ทําการ cd /usr/src/iptables
root@netcafe:~# cd /usr/src/iptables
root@netcafe:/usr/src/iptables# make install
cc -O2 -Wall -Wunused -I"/lib/modules/2.6.22.14-l7support/build"/include -Iinclude/ -
DIPTABLES_VERSION=\"1.3.8\" -D_UNKNOWN_KERNEL_POINTER_SIZE -fPIC -o
extensions/libipt_ah_sh.o -c extensions/libipt_ah.c
cc -shared -o extensions/libipt_ah.so extensions/libipt_ah_sh.o
cc -O2 -Wall -Wunused -I"/lib/modules/2.6.22.14-l7support/build"/include -Iinclude/ -
DIPTABLES_VERSION=\"1.3.8\" -D_UNKNOWN_KERNEL_POINTER_SIZE -fPIC -o
extensions/libipt_addrtype_sh.o -c extensions/libipt_addrtype.c
<… ยอผลลัพธไว ...>
cp extensions/libip6t_rt.so /lib/iptables/libip6t_rt.so
cp extensions/libip6t_sctp.so /lib/iptables/libip6t_sctp.so
rm libiptc/libip6tc.o libipq/libipq.o libiptc/libip4tc.o
root@netcafe:/usr/src/iptables#
ใชคําสั่ง iptables –V
ใชคําสั่ง iptables -m layer7 --l7proto bittorrent -h
ใชคําสั่ง iptables -m ipp2p -h
ใชคําสั่ง iptables -m time -h
root@netcafe:/usr/src/iptables# iptables -V
iptables v1.3.8
root@netcafe:/usr/src/iptables# iptables -m layer7 --l7proto bittorrent -h
<..ยอผลลัพธไว ..>
LAYER7 match v1.3.8 options:
--l7dir <directory> : Look for patterns here instead of /etc/l7-protocols/
(--l7dir must be specified before --l7proto if used!)
--l7proto [!] <name> : Match the protocol defined in /etc/l7-protocols/name.pat
เปนอันวาเสร็จสิ้น
การติดตั้ง Squid Proxy สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install squid เพียงแคนกี้ ็เปนการ
ติดตั้ง Squid Proxy เสร็จเรียบรอยแลวครับ
root@netcafe:~#
การติดตั้ง frox สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install frox เพียงแคนี้ก็เปนการติดตั้ง frox
เสร็จเรียบรอยแลวครับ ^_^
root@netcafe:~#
เปนอันเสร็จสิน้ การติดตั้ง frox ไมตองไปสนใจกับ Error ที่เกิดขึ้น เนือ่ งจากวายังไมมีการ Config ใด ๆ ลงไป
ซึ่งในตอนที่ 17 จะเปนเรื่องของ Script ที่ทําการสราง Config File ใหอัตโนมัติ โดยเหมาะสมกับเครื่องของ Server โดย
Config File ของ frox จะอยูใ น /etc/frox.conf และ /etc/default/frox
การติดตั้ง dnsmasq และ nscd สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install dnsmasq nscd
เพียงแคนี้ก็เปนการติดตั้ง dnsmasq และ nscd เสร็จเรียบรอยแลวครับ ^_^
root@netcafe:~#
การติดตั้ง dhcp3-server สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install dhcp3-server เพียงแคนกี้ ็เปน
การติดตั้ง dhcp3-server เสร็จเรียบรอยแลวครับ ^_^
root@netcafe:~#
การติดตั้ง snmpd สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install snmpd เพียงแคนี้ก็เปนการติดตั้ง
snmpd เสร็จเรียบรอยแลวครับ ^_^
root@netcafe:~/Software# ls -l
total 15640
-rw-r--r-- 1 xxxkung xxxkung 454656 2008-07-08 01:53 putty.exe
-rw-r--r-- 1 xxxkung xxxkung 13510516 2008-05-26 11:18 webmin_1.420_all.deb
-rw-r--r-- 1 xxxkung xxxkung 2019269 2008-07-08 01:44 winscp407setup.exe
root@netcafe:~/Software#
เราก็สามารถติดตั้งไดโดยใชคําสั่ง
root@netcafe:~/Software#
https://<server ip>:10000/
เชน
https://192.168.1.99:10000/
สามารถ Login เขาไปใชงานได โดยใช User/Pass ที่ทําการสรางไวครั้งแรก (ไมใช admin และ root นะครับ)
การติดตั้ง cacti สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install cacti
Suggested packages:
defoma-doc psfontmgr x-ttcidfont-conf dfontmgr php-pear libfreetype6-dev librrds-perl
Recommended packages:
libft-perl
The following NEW packages will be installed:
cacti dbconfig-common defoma libart-2.0-2 libfreetype6 libphp-adodb libpng12-0 librrd2 php5-cli php5-
snmp rrdtool snmp ttf-dejavu ttf-dejavu-core
ttf-dejavu-extra
The following packages will be upgraded:
libapache2-mod-php5 php5-common php5-mysql
3 upgraded, 15 newly installed, 0 to remove and 52 not upgraded.
Need to get 8974kB/13.7MB of archives.
After unpacking 26.1MB of additional disk space will be used.
Do you want to continue [Y/n]? <ใหตอบ Y หรือกด Enter เพื่อยืนยัน>
Get:1 http://th.archive.ubuntu.com gutsy/universe dbconfig-common 1.8.35 [466kB]
Get:2 http://th.archive.ubuntu.com gutsy-updates/main php5-cli 5.2.3-1ubuntu6.3 [2531kB]
Get:3 http://th.archive.ubuntu.com gutsy-updates/main php5-mysql 5.2.3-1ubuntu6.3 [65.3kB]
Get:4 http://th.archive.ubuntu.com gutsy-updates/main libapache2-mod-php5 5.2.3-1ubuntu6.3 [2543kB]
Get:5 http://th.archive.ubuntu.com gutsy-updates/main php5-common 5.2.3-1ubuntu6.3 [219kB]
Get:6 http://th.archive.ubuntu.com gutsy/universe libphp-adodb 4.94-1 [476kB]
Get:7 http://th.archive.ubuntu.com gutsy-updates/main libpng12-0 1.2.15~beta5-2ubuntu0.1 [188kB]
Get:8 http://th.archive.ubuntu.com gutsy-updates/main php5-snmp 5.2.3-1ubuntu6.3 [11.6kB]
Get:9 http://th.archive.ubuntu.com gutsy-updates/main snmp 5.3.1-6ubuntu2.1 [991kB]
Get:10 http://th.archive.ubuntu.com gutsy/universe rrdtool 1.2.19-1ubuntu1 [523kB]
Get:11 http://th.archive.ubuntu.com gutsy-updates/universe cacti 0.8.6j-1.1ubuntu0.3 [960kB]
Fetched 8974kB in 28s (315kB/s)
Preconfiguring packages ...
Selecting previously deselected package dbconfig-common.
(Reading database ... 53858 files and directories currently installed.)
Unpacking dbconfig-common (from .../dbconfig-common_1.8.35_all.deb) ...
Selecting previously deselected package defoma.
Unpacking defoma (from .../defoma_0.11.10-0.1_all.deb) ...
Package Configuration
ตอบ OK
เลือก Apache2
ตอบ Yes
เลือก Finish
ใส Default User Name และ Password เขาไป นั่นคือ admin / admin
การติดตั้ง no-ip สําหรับ Ubuntu นั้น งายมาก โดยใชคําสั่ง apt-get install no-ip เพียงแคนี้ก็เปนการติดตั้ง no-ip
เสร็จเรียบรอยแลวครับ ^_^
root@netcafe:~# apt-get install no-ip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
no-ip
0 upgraded, 1 newly installed, 0 to remove and 57 not upgraded.
Need to get 21.4kB of archives.
After unpacking 135kB of additional disk space will be used.
Get:1 http://th.archive.ubuntu.com gutsy/universe no-ip 2.1.3-3build1 [21.4kB]
Fetched 21.4kB in 0s (363kB/s)
Selecting previously deselected package no-ip.
(Reading database ... 17961 files and directories currently installed.)
Unpacking no-ip (from .../no-ip_2.1.3-3build1_i386.deb) ...
Setting up no-ip (2.1.3-3build1) ...
Starting dynamic address update: Can't locate configuration file /etc/no-ip.conf. (Try -c). Ending!
no-ip.
root@netcafe:~#
กอนใชงานโปรแกรม no-ip นั้น จะตองไปสมัคร Username / Password ในเวป www.no-ip.com กอน ซึ่ง
สามารถสมัครและใชงานไดฟรี โดยทําตามขั้นตอนดังนี้
กรอกรายละเอียดใหครบ
ใหทําการตรวจเช็คเมล จะมีเมลแจงมา
ทําการ Activate ดวยการกด Link ที่มากับเมล ตามตัวอยาง
จะไดตามรูปตัวอยาง
root@netcafe:~#
จาก config เราจะให Server ทําการ Update IP hostname netcafe00.no-ip.biz ทุก ๆ 5 นาที สวน hostname อีก
2 ตัวนั้น คือ netcafe01.no-ip.biz และ netcafe02.no-ip.biz นั้น เราจะใหทําการ Update IP ของ ppp101 และ ppp102
ตามลําดับ โดยสามารถทําการ Config ดังนี้
root@netcafe:~#
ตัวอยางการใชงาน netstat-nat
เชนตองการเช็ควา เครื่องคอมพิวเตอรลูกขาย ip 192.168.1.101 ทําการติดตอไปยังทีไ่ หนบาง
ก็สามารถใชคําสั่ง watch netstat-nat –n –s 192.168.200.101 ก็จะไดผลออกมาวา
root@netcafe:~# watch netstat-nat –n –s 192.168.1.101
ตัวอยางโปรแกรม phpsysinfo
เมื่อเราทําการติดตั้งโปรแกรม phpsysinfo เรียบรอยแลว ใหทําการเรียกใชโดย เขาหนาเวป
http://192.168.1.99/phpsysinfo
ก็จะไดผลลัพธออกมาเปน
เปนตน
ตัวอยางโปรแกรม iptraf
root@netcafe:~# iptraf
ก็เอาไวเช็ความเร็วของเน็ตแตละเสนได วาใชงานอยูเทาไหร
ตัวอยางโปรแกรม bwm-ng
โปรแกรมตัวนี้ก็คลายกับ iptraf แตจะมี option นอยกวา ดูงายกวา แลวแตถนัดวาชอบตัวไหน
root@netcafe:~# cd Script
root@netcafe:~/Script#
11. เปลี่ยน mode file ใน folder Script ทั้งหมดใหสามารถ execute ได
root@netcafe:~/Script# chmod –R +x *
12. ทําการแกไขพารามิเตอร ในไฟล config.sh
root@netcafe:~/Script# pico config.sh
13. เมื่อเสร็จแลว ทําการรันไฟล ./config.sh
root@netcafe:~/Script# ./config.sh
14. เสร็จแลวทําการ Reboot อีกครั้ง
root@netcafe:~/Script# reboot
15. เปนอันเสร็จสิน้ การติดตั้ง MultiWAN Server
export LAN_INTERFACE=eth0
export LAN_IP_ADDRESS=192.168.200.1
export LAN_NETWORK=192.168.200.0
export LAN_NETWORK2=192.168.200.
export LAN_NETMASK=255.255.255.0
export LAN_BROADCAST=192.168.200.255
# WAN1
export WAN1_INTERFACE=eth1
export WAN1_PPPOE_USERNAME=username1
export WAN1_PPPOE_PASSWORD=password1
export WAN1_PPPOE_MTU=1492
export WAN1_DNS1=202.69.137.83
export WAN1_DNS2=202.69.137.94
# WAN2
export WAN2_INTERFACE=eth2
export WAN2_PPPOE_USERNAME=username2
export WAN2_PPPOE_PASSWORD=password2
export WAN2_PPPOE_MTU=1492
export WAN2_DNS1=203.146.237.237
export WAN2_DNS2=203.146.237.222
# SERVER
export SERVER_NAME=netcafe
export SERVER_MEMORY_SIZE=1024
export SERVER_HDD_SIZE=80000
export FROX_CACHE_SIZE=10240
export SQUID_CACHE_SIZE=20480
export SQUID_CACHE_MEM=960
export SQUID_MEM_POOLS=384
export SQUID_MAX_OBJ_SIZE=256
export SQUID_MAX_OBJ_SIZE_MEM=1024
# DHCP
export DHCP_START_IP=100
export DHCP_END_IP=250
# DOTA PORT
export DOTA_START_IP=100
export DOTA_START_PORT=6100
export DOTA_CLIENT_COUNT=50
#================================#
# End of Config Parameter #
#================================#
# 1. /etc/network/interfaces
# 2. /etc/ppp/pap-secrets
# 3. /etc/ppp/chap-secrets
# 4. /etc/ppp/peers/dsl-link1.sh
# 5. /etc/ppp/peers/dsl-link2.sh
# 6. /etc/rc.local
# 7. /etc/resolv.conf
# 13. /etc/init.d/tablenat.sh
# 14. /etc/init.d/dota.sh
# 17. /etc/init.d/firewall.sh
# 18. /etc/init.d/tableroute.sh
# 19. /etc/init.d/checklink.sh
# 20. /etc/ppp/ip-up.d/0route
# 21. /etc/ppp/ip-up.d/0nat
ในกรณีที่มีเกมสใหมเขามาใหเพิ่มเติมแกไขไฟล ดังนี้
# 18. /etc/init.d/tableroute.sh
เปนตน
(ยังมีรายละเอียดเพิ่มเติม)
/var/log/messages
/var/log/frox.log
/var/log/squid/access.log
/var/log/squid/cache.log
คําสั่งในการตรวจสอบ logfile
(ยังมีรายละเอียดเพิ่มเติม)
ตอนที่ 20 การดูแลรักษาและแกปญหาเบื้องตน
การดูแลรักษาเบื้องตน แบงไดดังนี้
การจัดวาง Server / Modem / และเชื่อมตอสายแลนที่มั่นคง ไมหลุดหลวม
(ยังมีรายละเอียดเพิ่มเติม)
การจัดระบบไฟฟาที่มีประสิทธิภาพ การสํารองไฟ การตอสายกราวน และการใชปลัก๊ พวงที่มีคณ
ุ ภาพ
(ยังมีรายละเอียดเพิ่มเติม)
การ Shutdown และ Restart ที่ถูกตอง
(ยังมีรายละเอียดเพิ่มเติม)
การตรวจสอบความผิดปกติจากกราฟ cacti
(ยังมีรายละเอียดเพิ่มเติม)
1. ตรวจเช็คคา IP / SUBNET / GATEWAY และ DNS ของเครื่องลูกขาย (ตัวอยาง Server จะเปน ip 192.168.200.1)
ใหตรวจสอบสายที่เชื่อมตอ วามีการหลุดหรือหลวมหรือไม
4. ตรวจสอบสัญญาณอินเตอรเน็ตของแตละเสน
ทดสอบเสน ppp101
root@netcafe:~# ping -c 5 -I ppp101 203.144.244.1
PING 203.144.244.1 (203.144.244.1) from 61.7.167.170 ppp101: 56(84) bytes of data.
64 bytes from 203.144.244.1: icmp_seq=1 ttl=249 time=26.5 ms
64 bytes from 203.144.244.1: icmp_seq=2 ttl=249 time=24.8 ms
64 bytes from 203.144.244.1: icmp_seq=3 ttl=249 time=31.3 ms
64 bytes from 203.144.244.1: icmp_seq=4 ttl=249 time=25.9 ms
ทดสอบเสน ppp102
root@netcafe:~# ping -c 5 -I ppp102 203.144.244.1
PING 203.144.244.1 (203.144.244.1) from 58.147.54.130 ppp102: 56(84) bytes of data.
64 bytes from 203.144.244.1: icmp_seq=1 ttl=245 time=49.4 ms
64 bytes from 203.144.244.1: icmp_seq=2 ttl=245 time=44.2 ms
64 bytes from 203.144.244.1: icmp_seq=3 ttl=245 time=60.5 ms
64 bytes from 203.144.244.1: icmp_seq=4 ttl=245 time=75.6 ms
64 bytes from 203.144.244.1: icmp_seq=5 ttl=245 time=43.2 ms
ถามี timeout หรือ unreachable หรือคาอื่น ๆ ใหตรวจสอบกับ ISP ดูวา user/pass มีปญหาหรือไม
Address: 127.0.0.1#53
Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 64.233.189.104
Name: www.l.google.com
Address: 64.233.189.99
Name: www.l.google.com
Address: 64.233.189.147
root@netcafe:~#
แตถาไมสามารถตอบคามาได เชน
root@netcafe:~#
nameserver 127.0.0.1
nameserver 202.69.137.83
nameserver 202.69.137.84
เปนตน
Non-authoritative answer:
Name: www.l.google.com
Addresses: 64.233.189.104, 64.233.189.99, 64.233.189.147
Aliases: www.google.com
ทําการทดสอบแบบเดียวกับ Server
แตถาไมสามารถตอบคาไดเชน
Server: netcafe
Address: 192.168.200.1
แสดงวา DNS Server ของตัว Server มีปญหา ใหลองทําการเปลี่ยน DNS ในขอ 1 ดู เปน DNS ของ ISP
ถาหากเปลี่ยนแลวสามารถเขาเวปได แสดงวา DNS Service ของ Server มีปญหา ใหทําการตรวจสอบตามขอ 5 ใหม
แลวทดสอบขอ 6 ใหมอีกครัง้
root@netcafe:~# /etc/init.d/clearproxy.sh
Disable Transparent Proxy
* Stopping Squid HTTP proxy squid
* Waiting...
* ...
...done.
...done.
Remove Cache Files
* Starting Squid HTTP proxy squid
* Creating squid spool directory structure
2008/06/29 18:30:52| Creating Swap Directories
...done.
Enable Transparent Proxy
root@netcafe:~#
root@netcafe:~# /etc/init.d/clearfrox.sh
Disable Transparent FROX
Stopping frox: caching ftp proxy server: done
Remove Cache Files
Starting frox: caching ftp proxy server: done
Enable Transparent FROX
root@netcafe:~#