Basic Linux

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

  • + jza Alexandro Colorado 2 years ago
    would be nice to have an english version, seems you did quite a good job explaining the instalation process.
Post a comment
Embed Video
Edit your comment Cancel

Favorites, Groups & Events

Basic Linux - Presentation Transcript

  1. Training Basic Linux Mr.Kriangsak Namkot [email_address] [email_address] http://www.jodoi.com http://www.doi.in.th
  2. การติดตั้ง Linux
  3. การติดตั้ง Linux
  4. การติดตั้ง Linux
  5. การติดตั้ง Linux
  6. การติดตั้ง Linux
  7. การติดตั้ง Linux
  8. การติดตั้ง Linux
  9. การติดตั้ง Linux
  10. การติดตั้ง Linux
  11. การติดตั้ง Linux
  12. การติดตั้ง Linux
  13. การติดตั้ง Linux
  14. การติดตั้ง Linux
  15. การติดตั้ง Linux
  16. การติดตั้ง Linux
  17. การติดตั้ง Linux
  18. การติดตั้ง Linux
  19. การติดตั้ง Linux
  20. การติดตั้ง Linux
  21. การติดตั้ง Linux
  22. การติดตั้ง Linux
  23. การติดตั้ง Linux
  24. Linux Kernel
    • Kernel เป็นส่วนที่ทำหน้าที่ควบคุมการทำงานในระดับล่างคือส่วนที่เป็น Hardware ทั้งหมด รวมถึงการจัดสรรทรัพยากรด้วย
    Kernel Hardware Kernel
  25. Linux Shell
    • เป็นตัวเชื่อมระหว่างผู้ใช้งานกับส่วนของ kernel เมื่อเทียบกับ dos แล้วก็คือ command.com โดย shell จะทำหน้าที่รับคำสั่งจากผู้ใช้มาตีความหมาย
    Kernel Kernel Hardware Kernel Shell
  26. หลักการทำงานของ Linux
    • อุปกรณ์ทุกอย่าง Linux จะมองเป็นไฟล์
    • Config ของระบบและของโปรแกรมต่างๆ ก็จะมองเป็นไฟล์
    • ข้อมูลทุกอย่างมีลักษณะ Case Sensitive
  27. โครงสร้าง File ใน Linux
    • / Root Partition
      • /bin เก็บ Binary File ในการ Run คำสั่งต่างๆ
      • /boot เก็บไฟล์สำคัญในการ Boot ระบบ
      • /dev เก็บข้อมูลอุปกรณ์ต่างๆ
      • /mnt เก็บข้อมูลอุปกรณ์ที่ Mount ไว้
      • /etc เก็บ Config ของ Application ต่างๆ
      • /home เก็บข้อมูลของ User แต่ละคน
      • /lib เก็บ Libraries Files ต่างๆ ของระบบ
      • /root เก็บข้อมูลของ Root
      • /var เก็บ System Log, Application log, เก็บ Mail ฯลฯ
  28. การรู้จัก Hardware ของ Linux
    • /dev/fd0 ฟลอปปีไดรฟ์ตัวแรก ( ไดรฟ์ A: )
    • /dev/fd1 ฟลอปปีไดรฟ์ตัวที่สอง ( ไดรฟ์ B: )
    • /dev/hda1/ พาร์ติชันที่ 1 ของฮาร์ดิสก์ตัวแรกชนิด IDE
    • /dev/hda2/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวแรกชนิด IDE
    • /dev/hda3/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวแรกชนิด IDE
    • /dev/hda4/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวแรกชนิด IDE
    • /dev/hda5 / logical พาร์ติชันที่ 1 ของฮาร์ดิสก์ตัวแรกชนิด IDE
  29. การรู้จัก Hardware ของ Linux ( ต่อ )
    • /dev/hdb1/ พาร์ติชันที่ 1 ของฮาร์ดิสก์ตัวที่สองชนิด IDE
    • /dev/hdb2/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวที่สองชนิด IDE
    • /dev/hdb3/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวที่สองชนิด IDE
    • /dev/hdb4/ พาร์ติชันที่ 2 ของฮาร์ดิสก์ตัวที่สองชนิด IDE
    • /dev/hdb5 / logical พาร์ติชันที่ 1 ของฮาร์ดิสก์ตัวที่สองชนิด IDE
  30. การรู้จัก Hardware ของ Linux ( ต่อ )
    • /dev/cdrom CD-ROM Drive
    • หรือ /dev/hdc, /dev/hdd แล้วแต่ Disk Partition
    • /dev/sda/ SCSI Primary Master
    • /dev/sdb/ SCSI Primary Slave
    • /dev/sdc/ SCSI Secondary master
    • /dev/sdd/ SCSI Secondary Slave
  31. Linux basic command
    • การเข้าใช้งานระบบ (login) ต้องใส่ Username และ Password ซึ่งขณะที่เราพิมพ์ password จะไม่เห็นข้อความ
    • Shell $ สำหรับบุคคลทั่วไปที่ Login เข้ามา
    • Shell # สำหรับผู้ Login เป็น Root ซึ่งเป็นผู้ดูแลระบบ
    • คำสั่ง “ pwd” ใช้เพื่อแสดง directory ปัจจุบัน
    • ** ไม่ควรปิดเครื่องโดยไม่ทำการ Shutdown
  32. การปิดเครื่องอย่างถูกวิธี
    • การ shutdown
    • #shutdown –h now
    • การ restart
    • #shutdown –r now
    • #shutdown –r +5 ( เครื่องจะ restart ในอีก 5 นาที )
    • #reboot
    • ** ไม่ควรปิดเครื่องโดยไม่ทำการ Shutdown **
  33. การเปลี่ยน Directory
    • การเปลี่ยน Directory
    • # cd <Directory>
    • Directory
    • . หมายถึง Current Directory
    • .. หมายถึง Parent Directory
    • / หมายถึง Directory ราก (Root Directory)
    • ~ หมายถึง Home Directory (/home/)
  34. การดูไฟล์ข้อมูล
    • ดูไฟล์ข้อมูล # ls ( ใช้ * เป็น Wildcard ได้ )
    • ดูไฟล์ข้อมูลพร้อมรายละเอียด # ls -al
    • rwxr-xr-x 1 jodoi user 37 45 Apr 19 21:12 wut.txt
      • Permission ของไฟล์ -rwxr-xr-x
      • จำนวน link 1
      • Owner jodoi
      • Group user
      • ขนาด 37 bytes
      • วันที่ๆ แก้ไขล่าสุด 45 Apr 19 21:12
      • ชื่อไฟล์ wut.txt
  35. การดูไฟล์ข้อมูล ( ต่อ )
    • ดูประเภทไฟล์ข้อมูล # file < ชื่อไฟล์ >
    • ดูเนื้อหาของไฟล์ # cat < ชื่อไฟล์ >
    • ดูเนื้อหาของไฟล์เป็นหน้า # more < ชื่อไฟล์ >
    • ดูการเปลี่ยนแปลงของไฟล์ # tail –f < ชื่อไฟล์ >
  36. การกำหนดสิทธิของไฟล์ข้อมูล
    • chmod ใช้ในการกำหนด Permission ของไฟล์
    • -rwx r-x r-x หมายถึง
      • rwx สำหรับ Owner ( อ่านได้ , เขียนได้ , Execute ได้ ) -> 1 1 1
      • r-x สำหรับ Group ( อ่านได้ , เขียนไม่ได้ , Execute ได้ ) -> 1 0 1
      • r-x สำหรับ Other ( อ่านได้ , เขียนไม่ได้ , Execute ได้ ) -> 1 0 1
    • แปลงเป็นเลขฐานสิบ rwxr-xr-x -> 111 101 101 -> 755
    • ในการสั่งให้ไฟล์มี Permission เป็น rwxr-xr-x สามารถทำได้โดยใช้คำสั่ง chmod 755 < ชื่อไฟล์ >
  37. การกำหนดความเป็นเจ้าของไฟล์ข้อมูล
    • เปลี่ยน Owner ของไฟล์ ด้วยคำสั่ง chown ตัวอย่างเช่น
      • chown samart file1.txt
    • เปลี่ยน Group ของไฟล์ ด้วยคำสั่ง chgrp ตัวอย่างเช่น
      • chgrp samart file1.txt
    • เปลี่ยนทั้ง Owner และ Group ในคราวเดียว ด้วยคำสั่ง chown
      • chown root.root file1.txt
  38. การทำสำเนาไฟล์ข้อมูล
    • cp [option] <source file1> [source file2] […] <destination file/dir>
    • Options
      • -p Preserve permission, owner
      • -r Recursive
      • -v แสดงชื่อไฟล์ขณะที่ copy ด้วย
      • -f force overwriting
    • ตัวอย่าง cp xxx.txt yyy.txt
  39. การทำ Link ถึงไฟล์ข้อมูล
    • คล้าย การสร้าง shortcut ของ Microsoft Windows
    • มีสองประเภทคือ Hard link และ Soft link
      • Hard link: ln file1 file2 ไฟล์ 2 จะอ้างไปยัง physical address ของไฟล์ 1 เลย
      • Softlink: ln -s file1 file2 ไฟล์ 2 จะอ้างไปยังชื่อของไฟล์ 1 ถ้าเปลี่ยนชื่อของไฟล์ 1 ไฟล์ 2 ก็จะกลายเป็น link ที่ผิดพลาดไป
    • ลอง ln -s /usr/bin/X11/xpaint /bin/xpaint
    • จากนั้นลอง ls -l /bin/xpaint จะพบ xpaint อยู่ใน bin
  40. การย้ายไฟล์ข้อมูล
    • mv [option] <source1> [source2] […] <destination>
    • ตัวอย่าง mv file1.txt file2.txt
    • ลองใช้คำสั่ง mv เพื่อย้ายไดเรกทอรี /tmp มายัง Home directory ของท่าน และลองใช้คำสั่ง mv เพื่อย้ายกลับ
  41. การลบไฟล์ข้อมูล
    • rm [options] <files>… เช่น rm file1.txt
    • Options:
      • -f ลบเลยโดยไม่ต้องถามยืนยัน
      • -i ให้ถามยืนยันอีกครั้งว่า y หรือ n
      • -r ลบทั้งไฟล์และไดเรอทอรี่ย่อยที่อยู่ภายใน
    • คำถาม คำสั่ง rm -rf / หมายความว่าอย่างไร
    • ลบ Directory # rmdir < ชื่อ Directory>
    • ลบ Directory รวมทั้งไฟล์และ Directory ย่อยทั้งหมด
    • rm –rf < ชื่อ Directory>
  42. การส่งต่อคำสั่ง
    • Linux สามารถให้เราส่งต่อผลของคำสั่งได้ โดยใช้ ไปป์ (|)
    • เช่นให้ทดลองใช้คำสั่ง # ls –al |more
    • ส่วนใหญ่จะใช้กับคำสั่ง grep ซึ่งช่วยในการค้นหาข้อความ
    • เช่นให้ทดลองใช้คำสั่ง # ls –al |grep in จาก root dir (/)
  43. การค้นหาข้อความ
    • หากต้องการหาบรรทัดที่มีคำว่า telnet ในไฟล์ /etc/inetd.conf
      • cat /etc/inetd.conf |grep telnet หรือ grep telnet /etc/inetd.conf
    • ต้องการให้แสดงทุกบรรทัด ยกเว้นบรรทัดที่มีคำว่า telnet
      • cat /etc/inetd.conf |grep -v telnet หรือ
      • grep -v telnet /etc/inetd.conf
    • ต้องการให้แสดงบรรทัดที่ขึ้นต้นด้วย root ในไฟล์ /etc/passwd
      • cat /etc/passwd |grep “^root” หรือ
      • grep “^root” /etc/passwd
  44. การค้นหาไฟล์ข้อมูล
    • คำสั่ง locate (Package ชื่อ slocate)
    • ก่อนจะใช้คำสั่ง locate ต้องมีการ Update Files Database โดยใช้คำสั่ง
    • # updatedb
    • เสร็จแล้วลองใช้คำสั่ง #locate httpd
  45. การใช้คำสั่ง tar รวบรวมข้อมูล
    • รูปแบบ # tar [options] files
    • คำสั่งที่มีการใช้งานกันบ่อยคือ
      • tar xvfz < ไฟล์ .tar.gz> [destination] ใช้แตกไฟล์ .tar.gz
      • tar xvf < ไฟล์ .tar> [destination] ใช้แตกไฟล์ .tar
      • tar cvfz < ชื่อไฟล์ที่จะเก็บ > [destination]
        • เช่น tar cvfz backup.tar.gz /var/log/
  46. การ Add/Delete User , สลับใช้งาน
    • Add User ( ข้อมูลจะอยู่ใน /etc/passwd)
    • #useradd < ชื่อ User> เช่น #useradd samart
    • หมายเหตุ ใน Debian Linux ควรใช้ adduser เช่น # adduser test1
    • Delete User
    • #userdel < ชื่อ User> เช่น #userdel samart
    • หมายเหตุ ใน Debian Linux ควรใช้ deluser เช่น # deluser test1
    • สลับการใช้งานระหว่าง User
    • #su - < ชื่อ User>
    • สลับการใช้งานระหว่างหน้าจอ
    • กด ALT+F2…F12 เพื่อเรียกใช้ Virtual Console
  47. การเปลี่ยนรหัสผ่าน และการตั้งรหัสผ่าน
    • เปลี่ยน Root Password ( ข้อมูลจะอยู่ใน /etc/shadow)
    • # passwd enter old password :
    • enter new password :
    • reenter new password หมายเหตุ จะไม่แสดงผลเมื่อทำการพิมพ์
    • เปลี่ยน User Password
    • # passwd < ชื่อ User>
  48. การตั้งค่าวัน , เวลา
    • ดูค่าวัน , เวลาของระบบ
    • # date
    • รูปแบบคำสั่ง # date MMDDhhmmYYYY
    • เช่น วันนี้วันที่ 16/02/2004 เวลา 15 : 43
    • ใช้คำสั่ง # date 021615432004 เป็นต้น
    • - ใช้ ntpdate ช่วยในการ set time
    • #ntpdate -b clock.nectec.or.th
  49. การ Monitor ระบบ
    • ดู Process # ps –ef
    • Kill Process # kill -9 <ps no.>
    • Restart Process # kill -1 <PID>
    • ดู User ที่ Login อยู่ในระบบ # w
    • ดูการใช้งาน Resources ต่างๆ # top
    • ดูขนาด Partion ทุก Partition # df –kh
    • ดูขนาด Folder # du –kh
    • ดูเวอร์ชั่นของ Kernel # uname -a
  50. ขอความช่วยเหลือด้วยคำสั่ง man
    • ลองใช้คำสั่ง man ls จะแสดงรายละเอียดวิธีการใช้คำสั่ง ls
    • หากทราบแค่ keyword ยังไม่ทราบกระทั่งชื่อคำสั่ง เช่น อยากรู้คำสั่งที่ใช้ในการทำการ copy ให้พิมพ์ว่า man -k copy จะแสดงรายชื่อของคำสั่งที่เกี่ยวข้องกับการ copy
    • update ฐานข้อมูลของ man -k โดยการใช้คำสั่ง makewhatis ( ต้องเป็น root)
    • หรือหากทราบคำสั่ง แต่ไม่ทราบ syntax ให้ลองพิมพ์ คำสั่ง แล้วตามด้วย -- help ก็จะมีตัวช่วยอย่างย่อขึ้นมาให้ เช่น # ls --help
  51. Basic text mode editor (vi)
    • ใช้ Editor vi เป็นพื้นฐานของการใช้งาน สำคัญมาก
    • ใช้ vi ตามด้วยชื่อไฟล์ ที่ต้องการแก้ไข หรือต้องการสร้าง
    • เช่น vi helloworld.c
    • จะมีเครื่องหมาย ~ ในแต่ละบรรทัด
  52. การใช้ vi จัดการไฟล์ ( ต่อ )
    • การเพิ่มข้อความ
    Esc a A i O o “ a” แทรกข้อความหลังเคอร์เซอร์ “ A” ใส่ข้อความใหม่ ท้ายของ บรรทัด “ i” ใส่ข้อความใหม่หน้าเคอร์เซอร์ “ O” แทรกบรรทัด 1 บรรทัดบนตำแหน่งเคอร์เซอร์ “ o” แทรกบรรทัด 1 บรรทัดใต้ตำแหน่งเคอร์เซอร์
  53. การใช้ vi จัดการไฟล์ ( ต่อ )
    • การลบ
    • dw ลบข้อความ 1 คำ
    • dd ลบข้อความทั้งบรรทัด
    • x ลบตัวอักษรที่เคอร์เซอร์
    • D ลบตัวอักษรตั้งแต่เคอร์เซอร์อยู่จนสุดบรรทัด
    • การค้นหาคำ
    • พิมพ์ / แล้วตามด้วยคำที่ต้องการค้นหา เช่น /system
    • ให้ค้นหาต่อไป กด n ไปเรื่อยๆ
  54. การใช้ vi จัดการไฟล์ ( ต่อ )
    • การควบคุมเคอร์เซอร์ ที่ Mode คำสั่ง
    • h เลือนไปทางซ้าย ( หรือปุ่มลูกศรชี้ซ้าย )
    • J เลือนลงล่าง ( หรือปุ่มลูกศรชี้ลงล่าง )
    • K เลือนขึ้นบน ( หรือปุ่มลูกศรชี้ขึ้นบน )
    • l เลือนไปทางขวา ( หรือปุ่มลูกศรชี้ขวา )
  55. การใช้ vi จัดการไฟล์ ( ต่อ )
    • การเก็บข้อมูลและออกจาก vi
    • :w การเขียนไฟล์
    • :w new_files การ Save เป็นชื่อใหม่
    • :wq การ Save ไฟล์แล้วออกจาก vi
    • :wq! การ Save ไฟล์แล้วออกจาก vi โดยไม่มี
    • เงื่อนไข
    • :q! ออกจาก vi โดยไม่มีการ save ไฟล์
  56. Well-Known Port
    • ECHO Server ---> TCP/7
    • DISCARD Server ---> TCP/9
    • DAYTIME Server ---> TCP/13
    • CHARGET Server ---> TCP/19
    • FTP Server ---> TCP/21
    • SSH Server ---> TCP/22
    • Telnet Server ---> TCP/23
    • SMTP Server ---> TCP/25
    • DNS Server ---> TCP/53 and UDP/53
    • DHCP Server ---> UDP/68
    • Web Server ---> TCP/80 (HTTP)
    • Secure Web Server ---> TCP/443 (HTTPS)
    • POP3 Server ---> TCP/110
    • IMAP Server ---> TCP/143
    • SNMP Server ---> UDP/161
    • LDAP Server ---> TCP/389
    • Web Proxy Server ---> TCP/3128 or TCP/8080
  57. iptables Firewall
    • # iptables -L –n
    • Chain INPUT (policy ACCEPT)
    • target prot opt source destination
    • Chain FORWARD (policy ACCEPT)
    • target prot opt source destination
    • Chain OUTPUT (policy ACCEPT)
    • target prot opt source destination
    • TABLES in IPTABLES
    • [1] filter
    • [2] nat
    • # iptables -t filter -L -n
    • # iptables -t nat -L –n
    • ERASE existing ruleset
    • # iptables -F INPUT
    • # iptables -F OUTPUT
    • set defaut policy
    • # iptables -P INPUT DROP
    • # iptables -P OUTPUT ACCEPT
    • set stateful connection tracking (allow REPLY to come back)
    • # iptables -P INPUT DROP
    • # iptables -P OUTPUT ACCEPT
    • # ping 192.168.100.254
    • # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    • # ping 192.168.100.254
    iptables Firewall
    • Ex SELECTIVELY PERMIT some connection
    • e.g. TCP/22 from 192.168.1.0/24
    • LIST the following information
    • [0] FROM WHAT INTERFACE?
    • [1] FROM WHAT IP?
    • [2] TO WHICH PROTOCOL?
    • [3] TO WHICH PORT?
    • LIST the following information
    • [0] FROM WHAT INTERFACE? eth0
    • [1] FROM WHAT IP? 192.168.1.0/24
    • [2] TO WHICH PROTOCOL? TCP
    • [3] TO WHICH PORT? 22
    • # iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --dport 22 -j ACCEPT
    iptables Firewall
    • Ex SELECTIVELY PERMIT some connection
    • e.g. TCP/80 from 192.168.1.0/24
    • LIST the following information
    • [0] FROM WHAT INTERFACE?
    • [1] FROM WHAT IP?
    • [2] TO WHICH PROTOCOL?
    • [3] TO WHICH PORT?
    • LIST the following information
    • [0] FROM WHAT INTERFACE? eth0
    • [1] FROM WHAT IP? any
    • [2] TO WHICH PROTOCOL? TCP
    • [3] TO WHICH PORT? 80,443
    • # iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
    • # iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT
    iptables Firewall
    • RESET iptables ruleset
    • # iptables -F INPUT
    • # iptables -F OUTPUT
    • # iptables -P INPUT ACCEPT
    • # iptables -P OUTPUT ACCEPT
    • # iptables -t nat -F POSTROUTING
    • Reading iptables rules
    • # iptables -L –n
    • # iptables-save
    iptables Firewall
    • Transparent Proxy
    • Squid = TCP/3128 or TCP/8080
    • # vi /etc/squid/squid.conf
    • ...
    • httpd_accel_host virtual
    • httpd_accel_port 80
    • httpd_accel_with_proxy on
    • httpd_accel_uses_host_header on
    • ...
    • # /etc/init.d/squid restart
    • # iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
    iptables Firewall
  58. Internet Gateway Server
    • 1. เปิด IP Forward
    • [ root@doiserver root ] # vi / etc / sysctl . conf
    • ~
    • # Controls IP packet forwarding
    • net.ipv4.ip_forward = 0 ( แก้จาก 0 เป็น 1 )
    • ~
    • :wq!
    • [root@doiserver root]# service network restart
    • [ root@doiserver root ] # cat / proc / sys / net / ipv4 / ip_forward
    • 1 ( ผลที่ได้ต้องเท่ากับ 1 )
    • 2. ปิด Firewall ของระบบ
    • [ root@doiserver root ] # setup
    Internet Gateway Server
    • 3. Set กลุ่ม IP ที่ให้ Forward Packet ได้
    • [root@doiserver root]# iptables -A FORWARD -s 192.168.200.240/28 -j ACCEPT
    • [root@doiserver root]# iptables -A FORWARD -d 192.168.200.240/28 -j ACCEPT
    • [root@doiserver root]# iptables -A FORWARD -j DROP
    • [ root@doiserver root ] # service iptables save
    • [root@doiserver root]# service iptables restart
    • [root@doiserver root]# iptables -L
    • Chain FORWARD (policy ACCEPT)
    • target prot opt source destination
    • ACCEPT all -- 192.168.200.240/28 anywhere
    • ACCEPT all -- anywhere 192.168.200.240/28
    • DROP all -- anywhere anywhere
    Internet Gateway Server
  59. Squid Proxy
    • [ root@doiserver root ] # vi / etc / squid / squid . conf
    • ~
    • # http_port 3128 ( กำหนด port ให้ proxy )
    • http_port 8080
    • # cache_mem 8 MB ( กำหนดให้ squid ใช้ mem สูงสุดตามต้องการ )
    • cache_mem 100 MB
    • # cache_dir ufs / var / spool / squid 100 16 256 ( ให้ squid เก็บข้อมูลแบบ ufs โดยเก็บไว้ที่ /var/spool/squid ใช้พื้นที่ 100 MB แบ่งเป็น 16 Dir หลัก และ 256 Dir ย่อย )
    • cache_dir ufs / var / spool / squid 1000 128 256
    • # cache_access_log / var / log / squid / access . log ( เก็บ log ไว้ที่ใด )
    • cache_access_log / var / log / squid / access . log
    • #acl our_networks src 192.168.1.0/24 192.168.2.0/24
    • ( กำหนด IP ให้ our_networks )
    • acl our_networks src 192.168.200.240/28
    • #http_access allow our_networks ( อนุญาตให้ ip ใน our_networks ใช้งาน squid ได้ )
    • http_access allow our_networks
    • # TAG : visible_hostname ( กำหนดชื่อ proxy )
    • visible_hostname doiserver
    • ~
    • [root@doiserver root]# squid -z
    • 2007/05/21 14:52:19| Creating Swap Directories
    Squid Proxy
    • [root@doiserver root]# service squid start
    • [ root@doiserver root ] # netstat - tanp |grep 8080
    • tcp 0 0 0.0.0.0:8080 0.0.0.0 :* LISTEN 15382 /
    • [ root@doiserver root ] # tail - f / var / log / squid / access . log
    • 1179734358.606 2334 192.168.200.246 TCP_MISS / 200 15520 GEThttp :// www . jodoi . com / - DIRECT / 72.29.87.198 text / html
    • 1179734359.100 842 192.168.200.246 TCP_MISS / 200 1770 GET http :// www . jodoi . com / pic / new . gif - DIRECT / 72.29.87.198 image / gif
    • 1179734359.407 793 192.168.200.246 TCP_MISS / 200 14528 GET http :// www . jodoi . com / pic / puket57_1 . jpg - DIRECT / 72.29.87.198 image / jpeg
    • 1179734359.742 1124 192.168.200.246 TCP_MISS / 200 3100 GET http :// www . jodoi . com / pic / more . bmp - DIRECT / 72.29.87.198 image / bmp
    Squid Proxy
  60. Web Server
    • [root@doiserver root]# vi /etc/httpd/conf/httpd.conf
    • ~
    • Listen 80
    • DocumentRoot &quot;/var/www/html“
    • ~
    • [root@doiserver root]# service httpd start
    • [ root@doiserver root ] # netstat - tanp |grep 80
    • tcp 0 0 0.0.0.0:80 0.0.0.0 :* LISTEN 15599 / httpd
    • http :// 192.168.200.249 /
    Web Server

+ minafaw2minafaw2, 2 years ago

custom

1017 views, 0 favs, 0 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 1017
    • 1017 on SlideShare
    • 0 from embeds
  • Comments 1
  • Favorites 0
  • Downloads 21
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories