Linux ???? - PowerPoint PPT Presentation

Loading...

PPT – Linux ???? PowerPoint presentation | free to download - id: 3ebea0-OTNmN



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

Linux ????

Description:

Linux Linux Linux Linux RedHat Linux RedHat Linux / / ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 165
Provided by: Jas197
Learn more at: http://linux.vbird.org
Category:
Tags: linux

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: Linux ????


1
Linux ????
2
????
  • ??? Linux ??
  • ??
  • ??Linux
  • Linux ????
  • RedHat Linux????
  • ??
  • RedHat Linux ?? / ??? / ????????????????

3
????
  • ??? Server ??
  • ??
  • DNS?DHCP?FTP server
  • ????
  • ??
  • WWW?MAIL?PROXY
  • ????

4
????
  • ??? Linux ???? / ????
  • ???????
  • RedHat Errata ?up2date??
  • ????

5
??Linux
  • ???Free Software?
  • Shareware/Freeware
  • ???Source Code
  • ?????????????

6
??Linux
  • ???????(Opensource)?
  • Freedom(??)/Open(??)
  • Source Code????
  • ???????????????????

7
GNU??
  • 1983 ? Richard Stallman(??????????) ?? GNU(GNUs
    not Unix)??
  • ???1984?,?????? ?-Unix ?? ???? ???????
  • http//www.gnu.org/

8
???????
  • GNU???????
  • FSF(Free Software Fundation)??????
  • FSF??????????
  • ?????GNU???
  • ????????
  • ????????????,???????????

9
GNU Genel Public License
  • ??????/??????
  • ???????????
  • Copyleft
  • http//www.linux.org.tw/CLDP/GNU/licences/fdl.zh.h
    tml
  • http//www.gnu.org/copyleft/gpl.html

10
LINUX??
  • 1991 ? 8 ?
  • ????????comp.os.minix ???????????
  • ???,???? minix ?? -???? 386 ( 486 ) AT ??????????
    ( ?????? ),??? GNU ?????????

11
GNU?Linux
  • GNU
  • ?????Hurd Kernel
  • ?????GPL????????????
  • Linux(Linuss Unix)
  • ?????????????Linux Kernel
  • ??GNU??????????????
  • ????GNU/Linux

12
Linux??
  • RedHat Linux
  • SuSE Linux
  • Mandrake Linux
  • Caldera Linux
  • Turbolinux
  • Debian GNU/Linux
  • Gentoo Linux
  • Linpus Linux

13
Linux Kernel?????
  • Kerenl ?? http//www.kernel.org
  • ????-2.5.70
  • ????-2.4.20
  • Linux??
  • RedHat RHCE
  • http//www.redhat.com/
  • LPI Level one/two/three
  • http//www.lpi.org

14
RedHat Linux 9??
  • ??????????
  • ???????

15
?????
  • Kickstart ????
  • ????
  • ??????
  • ????
  • ?????
  • ??????

16
????
  • ??Diskdruid
  • ???????
  • ?????,?? / ?/home?/var
  • ??swap ???
  • ??????,ext2?ext3?msdosetc
  • ?????

17
??????
  • ??????
  • GRUB
  • LILO
  • ???????
  • ??????????
  • MBR
  • /boot ??????
  • ??????

18
??????
  • ??????
  • ?????
  • DHCP??
  • IP???????????
  • Hostname
  • Gateway
  • DNS

19
???????
  • ??iptables
  • ???
  • ???
  • ??
  • ????

20
??/??/root????
  • ????????
  • ????
  • ?? root ??

21
??????
  • Shadow/MD5????
  • ????NIS/LDAP???????

22
????????
  • ??????
  • ???????

23
??????
  • ????
  • ??????????

24
xwindow????
  • ????????????? xwindows
  • ???????
  • ?????
  • ????

25
????
  • ?????
  • ??????
  • ???

26
Linux ????
  • BIOS ?????????? 0 ???? 0 ?????????????
  • ?????? (boot loader ,? LILO?Grub)????
  • ?? kernel ????,???????????????
  • ?? kernel ????,???????????? (initialization)
  • ????????????? (mount) root filesystem
  • ?? root filesystem ??????,????????
  • VFS Mounted root (ext3 filesystem) readonly

27
Linux ????
  • ?????? root filesystem ??? init ?? ( ? /bin or
    /sbin) ???
  • init ????????? (configuration file) /etc/inittab
    ,?????? sysinit ???,???????script??? sysinit
    script ???? /etc/rc ? /etc/init.d/boot ???????
    script ???????????? shell ??,??
  • ??????? fsck
  • ????????? (modules)
  • ?? swapping
  • ???????
  • ???? fstab ??????

28
Linux ????
  • ? sysinit script ???,????? init ?,???????runlevel
  • ??? runlevel ? initdefault ????????? /etc/inittab
    ?

29
runlevel ??
  • 0 ?? halt (??? initdefault ????)
  • 1 ???? Single user mode
  • 2 ?????????? Multiuser, without NFS (?
    runlevel 3 ??, ?????????)
  • 3 ????????? Full multiuser mode
  • 4 ??? unused
  • 5 xwindow ?? X11
  • 6 ??? reboot (??? initdefault ????)

30
man ???
  • ???? man page
  • man ls
  • man 1 ls
  • info ls
  • /etc/man.conf
  • whatis filename

31
vi
  • ????? vi
  • ??????????????
  • vi ???
  • ???????????????
  • ???????????
  • ??????????????????

32
vi help
  • h,j,k,l ??
  • yy ??
  • dd ??
  • p ??
  • o,i,a ??
  • R,r ??
  • u ??
  • / ??
  • s/x/y/g ????
  • w ??
  • q ??
  • wq! ??????

33
Linux ??
touch test ls al test
34
Linux ????
  • ????( regular file )
  • ?????? -
  • ????(ascii)
  • ????(binary)
  • ?? (directory)
  • ?????? d
  • ??? (link)
  • ?????? l
  • ??? (device)
  • ?? (block) ???,?????? b
  • ?? (character) ???,?????? c ?

35
Linux ????
36
?? Linux ??????
  • owner  rwx  421 7
  • group  rwx  421 7
  • others ---  000 0
  • r4,w2,x1
  • chmod 770 test
  • u
  • g
  • o
  • a
  • (??)
  • -(??)
  • (??)

r w x
  • ?????
  • chmod

37
?? Linux ???????
  • ?? chown -R ???? ????? chown -R
    ???????? ????? ??
  • root_at_test root chown games test root_at_test
    root ls -l test
  • drw-r--r--    1 games     root        0 Jun 20
    1436 test
  • root_at_test root chown R rootroot tmp

38
?? Linux ??????
  • ?? chgrp ????????? ??
  • root_at_test root chgrp users test root_at_test
    root ls -l
  • drw-r--r--    1 root     users        1 Jun 20
    1436 test

39
Linux ????
  • /bin????????
  • /boot?????,???????? vmlinuz ???
  • /dev?????????????
  • /etc??????????????,?? passwd, shadow
  • /etc/rc.d/init.d???????????? scripts ?????
  • /home?????????

40
Linux ????
  • /libLinux ????????????
  • /mnt??????????????
  • /proc??????????????
  • /root?????????
  • /usr/bin, /bin??????????
  • /usr/sbin, /sbin??????????
  • /var???????????
  • /lostfount?????????????????

41
(No Transcript)
42
Linux ??????
  • ???????
  • ???????
  • ???????
  • RPM???
  • ???????

43
???????
  • ?????
  • ?????????
  • .     ?????? ..    ??????      ????????
    user ??? user ???????

44
???????
  • cd
  • ????
  • cd /root
  • pwd
  • ???????
  • mkdir
  • ???????
  • mkdir p /root/abc/123
  • rmdir
  • ????????????
  • rmdir p abc/123
  • ????PATH
  • echo PATH
  • PATHPATH/root

45
???????
  • ls -ailS ???? -a       ????????(?????)
    -i       ?? inode ?? -l      
    ????,??????????? -S       ???????

46
???????
  • cp -drsu ??? ??? ???? -d??? copy
    ???,??? copy ? link ??,???????,???????? link
    ??????copy ????,?? -d ?,? link ????????? link
    ???????????
  • -r??????? copy -s?????,?? copy ??!? ln
    ??????! -u, --update????????,????????,??????
    copy ???

47
???????
  • rm -fir ?? ???? -i     ???????(?????)
    -r     ???? -f     ????

48
???????
  • mv -u ??? ??? ???? -u   ???,? update
    ???,?????????????????

49
??????
  • cat  ????????????
  • tac  ?????????,???? tac ? cat ????
  • more ???????????
  • less ? more ??,??????
  • head ?????
  • tail ??????
  • nl   ?????,???? ??
  • od   ?????????????

50
??????
  • ?????? ??? inode
  • Block ??????????????,?inode ?????????????????????
    ? Block ??????
  • ln
  • hard link
  • ??? filesystem/?? link ??
  • symbolic link
  • ln -s ??? ???

51
???????
  • chown ????????
  • chgrp ?????????
  • chmod ?????????????????
  • umask ????????????????
  • chattr ?????????
  • lsattr ?????????

52
???????
  • which ?????????? which ls
  • whereis ??????? whereis b/-m ls
  • locate ??????????? locate ls
    updatedb
  • find ????
    find / -name ls

53
???????
  • ??????????df, du
  • ????????fdisk, mke2fs, e2label, mknod
  • ??????????????fsck, sync
  • ??????? mkbootdisk, fdformat
  • ???????mount, umount
  • ???????????/etc/fstab
  • ????? Swapmkswap, swapon, swapoff
  • ????hdparm

54
???????
  • ??????
  • ???????????,??????? process ID ?????????,?? PID
    ????
  • ?????,???????????????!???????????????????

55
???????
  • ???????
  • top
  • ps
  • ????????(daemon, ??)
  • ??????
  • ????????????(syslog,cron)
  • ????????????(www, mail..)

56
???????
  • ??????????
  • Priority
  • nice value
  • nice ?? PID
  • renice ???? PID

57
???????
  • ???????, signal?
  • kill -signal PID
  • -1 ???????
  • -9 ??????????
  • -15 ??????? PID

58
???????
  • ???????syslog
  • ????????????????????????? syslog ???? (daemon)
    ???
  • /etc/syslog.conf
  • /var/log/messages
  • /var/log/secure ...

59
???????
  • ??????????
  • ? ctrl z
  • jobs
  • fg, bg, kill number

60
???????
  • ????
  • ???????
  • crontab
  • /etc/crontab
  • ??????
  • at

61
Linux ????
  • Tarball
  • ???? (open source)
  • ???? tarball ??????
  • ?????????make, kernel source, gcc ??
  • ????????????

62
Linux ????
  • RPM
  • ???????????????
  • ?????????????
  • ????????
  • ????????????(???????????)

63
RPM???
  • ??
  • rpm ivh bash.rpm
  • ??
  • rpm uvh bash.rpm
  • ??
  • Rpm V bash

64
RPM???
  • ??
  • rpm e bash
  • ??
  • rpm qa bash
  • ??rpm???
  • rpm --rebuilddb

65
???????
  • ????
  • groupadd
  • groupdel
  • useradd
  • userdel
  • chsh
  • chfn
  • userconf

66
???????
  • ???????
  • passwd
  • ???????
  • su
  • sudo
  • visudo

67
???????
  • ?????
  • id
  • finger
  • groups

68
RedHat Linux ????
  • setup
  • Authentication configuration??????????????
  • Firewall configuration ????? ipchains ????????
  • Mouse configuration ???????
  • Network configuration ??????
  • System services ????????
  • Printer configuration ??????
  • Timezone configuration ????

69
RedHat Linux ???
  • /etc/sysconfig/ ???????
  • ????????
  • ntsysv
  • ntsysv --level run-level
  • service
  • service service name startstoprestart
  • chkconfig
  • chkconfig --level levels --listadddel
    service name
  • init
  • init 0-6

70
Shell
  • ?????
  • ?????? Enter ??????????,???? \ ????
  • ???????(Options)?????????
  • ?????????
  • ???????????????

71
Shell
  • ?????
  • ????,?????????
  • HOME ???
  • MAIL ? mail ???? mailbox
  • PS1 ?????!
  • PATH ????????
  • ? ????????????

72
Shell
  • ?????
  • ???????? scripts
  • ???????????
  • ????????.
  • Shell scripts ???????(???)

73
Shell
  • ??????--??????
  • ??????,?????????????????????
  • ls /home gtgt right 2gtgt error
  • ???????????!?????????????(syslogd)

74
Shell
  • ??????--???? pipe
  • ????????????

75
Shell
  • ??????--???? pipe
  • last grep root wc -l
  • cat /etc/passwd cut -d -f1 gt accout

76
????
  • ??
  • shutdown h now
  • halt
  • poweroff
  • init 0
  • ????
  • shutdown r now
  • reboot
  • init 6

77
????
  • ???????????????
  • ???????
  • ????Server?????

78
????
  • ????????
  • ping, ifconfig, ifup, ifdown, netstat, route,
    traceroute, host, dig, nslookup
  • ????????
  • telnet, ssh, ftp, ncftp, lftp, wget
  • ????????
  • lynx, links

79
RedHat Linux ????
  • ???????Gateway???
  • /etc/sysconfig/network
  • ???????
  • /etc/sysconfig/network-script/ifcfg-eth0
  • ??DNS?Hosts??
  • /etc/resolv.conf
  • /etc/hosts

80
DNS Server
  • ??DNS?
  • Domain Name Server
  • ????
  • ??
  • ?domain name, ??ip
  • ??
  • ?ip, ??domain name

81
DNS Server????
82
DNS Server??-BIND
  • ??bind-9.2.1-16, bind-utils-9.2.1-16
  • ??named
  • ???named
  • ???53 upd, 53 tcp
  • ???/etc/named.conf , /var/namd/

83
?? BIND
  • ??????? /etc/named.conf
  • ????,?????options??
  • options
  • directory /var/named
  • fowrarders 168.95.1.1
  • allow-query 192.100.100/24
  • allow-transfer 192.100.100/24

84
  • Master??
  • zone example.com
  • type master
  • file db.example.com
  • Slave??
  • zone example.com
  • type slave
  • masters 192.100.30.1
  • file db.example.com

85
  • Reverse lookup(????)??
  • zone 30.168.192.in-addr.arpa
  • type slave
  • masters 192.168.30.1
  • file db.30.168.192
  • Root ??
  • zone .
  • type hint
  • file named.ca

86
SOA (Start of Authority)
  • ??ZONE?????????
  • exmaple.com. IN SOA example.com. root.example.com
    (
  • 2003053001 serial number
  • 300 refresh
  • 60 retry
  • 1209600 expire
  • 43200 minimum TTL for negative answers
  • )

87
NS (name server)
  • ???master ? slave DNS ?????NS ??
  • ?
  • example.com. IN NS ns.redhat.com.
  • ns.example.com. IN A 192.168.30.1

88
???????
  • A????hostname?IP??
  • mail.example.com. IN A 192.168.30.3
  • www.example.com. IN A 192.168.30.4
  • CNAME???????
  • mx IN CNAME mail
  • www2 IN CNAME www.redhat.com.
  • PTR??IP?????hostname
  • 3 IN PTR mail.redhat.com.

89
MX ??
  • MX ?? domain name????????
  • example.com. IN MX 5 mail.example.com
  • exmaple.com. IN MX 10 mail2.example.com

90
??
  • ?? /etc/named.conf
  • ?????? /var/named
  • ???? root ? zone ??
  • ???? example.com ? zone ??
  • ???? 192.168.30 ??? zone ??

91
??
  • ?? example.com.zone ?
  • ?? ns server ? 192.168.30.1
  • ?? A ??
  • ?? MX ??
  • ?? CNAME ??
  • ?? example.com.rev ?
  • ?? PTR ??

92
DNS Server ?????
  • /etc/init.d/named start ??
  • tail f /var/log/messages ?? log ??
  • /etc/init.d/named stop ??
  • killall named or kill -9 PID

93
DNS Server ??
  • nslookup www.example.com
  • nslookup 192.168.30.3
  • dig exmaple.com mx
  • host www.exmaple.com

94
DNS Server Lab
  • ?????? exmaple.com ????????????DNS Server

95
DNS Server Lab
  • ???? 1
  • host www.example.com
  • www.example.com has address 192.168.30.3
  • ???? 2
  • nslookup 192.168.30.1
  • 1.30.168.192.in-addr.arpa name
    ns.example.com.

96
DHCP server ??
  • DHCP ?????, ??/??/??
  • ?????????????IP
  • ????DHCP Server????? IP ?????
  • ????????IP????????
  • ????????IP??
  • DHCP Server????IP??, ????????, ??????
  • IP?????????????
  • ???IP?MAC???????, ????????????????IP

97
DHCP Server ??
  • ????????IP??
  • IP???????????
  • ????IP???????, ????????????????, ??IP??????????

98
DHCP ????
  • ???, ???????????
  • (1)????????? DHCP Server
  • DHCP Client gt DHCP DISCOVER gt DHCP Server
  • (2)???? DCHP Server ????IP??
  • DHCP Server gt DHCP_OFFER gt DHCP Client
  • (3)DHCP Client ?? DHCP Server ?? IP ??, ?????
  • DHCP Client gt DHCP_REQUEST gt DHCP Server
  • (4)DHCP Server ?????, ????, DHCP Client???? IP
  • DHCP Server gt DHCP_ACK gt DCHP Client

99
DHCP ????
  • ????, ??????(??????????????)
  • (1)DHCP Client ? DHCP Server ??????????
  • DHCP Client gt DHCP_REQUEST gt DHCP Server
  • (2)DHCP Server ???, ?? DCHP Client ??????
  • DHCP Server gt DHCP_ACK gt DHCP Client

100
DHCP ????
  • ????? DHCP Server ??? DHCP Client ????, ? DHCP
    Client ??????, ??????, ???????????????IP??.

101
DHCP Server ??
  • ??
  • dhcp-3.0p11-23.i386.rpm
  • dhcp-devel-3.0p11-23.i386.rpm
  • ?????
  • /usr/share/doc/dhcp-3.0p11/dhcpd.conf.sample
  • Copy ? /etc/dhcpd.conf
  • ???? /etc/sysconfig/dhcpd /var/lib/dhcp/dhcpd.
    leases

102
dhcp.conf
  • ????(Global)??????????? DNS IP ? router ???
  • ?? IP ???? subnet ???? range ???????????? IP
  • ?? IP ???? host ?????,?? MAC ???
  • ???????
  • ?????????,???????????? ?????

103
dhcp.conf Example
  • option domain-name   example.com"
  • ?????????????? example.com
  • option domain-name-servers 168.95.1.1,
    192.168.30.1
  • ??DNS IP
  • ?? IP ?????
  • subnet 192.168.30.0 netmask 255.255.255.0
    range 192.168.30.100 192.168.30.200 option
    broadcast-address 192.168.30.255 option
    routers 192.168.30.254

104
dhcp.conf Example
  • ?? IP ???
  • host server1 hardware ethernet 
    0040953043B4 fixed-address
    192.168.30.90 option broadcast-address
    192.168.30.255 option routers
    192.168.30.254
  • default-lease-time 259200  
  • ???????,??????????
  • max-lease-time     518400  
  • ??????,??? 518400 ?

105
DHCP Server ?? ? ??
  • /etc/init.d/dhcpd start
  • tail -f /var/log/messages

106
DHCP Client ??
  • ? Client ??TCP/IP????????IP
  • Windows ??
  • Ipconfig /all
  • winipcfg
  • Linux ??
  • Ifconfig -a

107
DHCP Server Lab
  • ???? IP ?? 192.168.30.100192.168.30.200
  • ????????? server
  • ??IP?192.168.30.90
  • ??Mac Address? 0040953043B4
  • ????? 192.168.30.255
  • ????? 192.168.30.254

108
FTP server
  • vsFTPD (Very Secure FTP Daemon)
  • ??vsftpd-1.1.3-8.i386.rpm
  • TCP 20???
  • TCP 21???????
  • ????????
  • anonymous
  • real user

109
vsFTPD ???
  • /etc/vsftpd.ftpusers
  • ????????
  • /etc/hosts.deny
  • ???????
  • /etc/vsftpd/vsftpd.conf
  • ?????

110
vsFTPD ?????
  • /etc/init.d/vsftpd start
  • ??vsftpd
  • lftp localhost
  • ncftp localhost

111
FTP Server Lab
  • ?? vsFTPD ???? FTP Server
  • ?????? banner_file
  • ?????????????

112
WWW Server
  • ?? httpd , -devel, -manual
  • ????httpd
  • ???script httpd
  • ???80/tcp (http), 443/tcp (https)
  • ???/etc/httpd/, /var/www/
  • ?? redhat-config-httpd,mod_ssl,????

113
WWW Server ???
  • ?????
  • /etc/httpd/conf/httpd.conf
  • ????
  • /etc/httpd/conf.d/
  • ??????????
  • /var/www/html/

114
httpd.conf
  • ?????????
  • UserDir public_html
  • MIME ????
  • AddType application/x-httpd-php .phtml
  • AddType text/html .htm
  • ??index???
  • DirectoryIndex index.html default.html

115
httpd.conf
  • ???????
  • ltDirectory /var/www/html/internalgt
  • order allow, deny
  • allow from .example.com
  • lt/Directorygt
  • ?? .htaccess ??
  • sample authentication .htaccess file
  • AuthName Jacks home
  • AuthType basic
  • AuthUserFile /home/jack
  • require user jack

116
Virtual Host ????
  • ???????, ???????, ??? IP/Name/Port ??????
  • (1)IP Base
  • ??IP?????????????????, ??????????????IP??
  • (2)Name Base
  • ????IP??, ?????????????????????, ??? Name Base
    ???????????????, ???????? SSL ??,
    ?????HTTP/1.1?????????.
  • (3)Port Base
  • ????? port ??, ?????????.

117
SSL ????
  1. Client ? ? Web Server SSL port ??.(https)
  2. Web Server???????? Client ?
  3. Client ??????????, ????? Web Server ?
  4. Web Server???? Client ???????, ????????????????,
    ????Web Server????.
  5. Client ?? Web Server ??????????, ? Web Server
    ????? Symmetric Key, ??? Symmetric Key ?? Web
    Server ?.
  6. ????? Symmetric Key ???????

118
WWW Server ?????
  • /etc/init.d/httpd start
  • tail f /var/log/httpd/access_log
  • tail f /var/log/httpd/error_log

119
WWW Server Lab
  • ??????Name Base?????
  • www.example.com
  • www2.example.com
  • ???????????

120
Mail Server
  • MTA
  • sendmail,postfix,qmail,exim
  • MDA
  • procmail
  • MUA
  • Outlook Express
  • Becky

121
Mail Server ??
122
Mail Server
  • ???? - Sendmail
  • Sendmail ???
  • ???????emial????
  • ?????domains?users
  • ???????????
  • ??????????????????????

123
Mail Server??-sendmail
  • ????System V-launched daemon
  • ??sendmail ,-cf, -doc ?IMAP
  • ????sendmail
  • ???scriptsendmail
  • ???25(smtp)
  • ?????/etc/mail/sendmail.cf, /etc/aliases,
    /etc/mail/
  • ??procmail?/var/mail/maillog ?/var/spool/mail

124
m4
  • ? m4 ??? sendmail.cf
  • m4 ???????sendmail.cf ?????
  • Red Hat ?? sendmail ?????? /etc/mail/sendmail.mc
    ????
  • Red Hat ??? m4 ? sendmai.mc ?????sendmail
  • ??? README.cf ?? /usr/share/doc/sendmail ?

125
sendmail.cf
  • ?????
  • sendmail.cf
  • ??domain???(alias)?????????
  • ????????????????

126
/etc/mail/sendmail.cf
  • ??????
  • SMTP daemon options
  • O DaemonPortOptionsPortsmtp,Addr127.0.0.1,
    NameMTA
  • 127.0.0.1 ?? 0.0.0.0
  • ??????
  • maximum message size
  • O MaxMessageSize1000000

127
/etc/mail/access
  • RELAY
  • ??????
  • REJECT
  • ????
  • DISCARD
  • ????
  • ?????? /etc/mail ??? make

128
/etc/aliase
  • ??????
  • MAILER-DAEMON postmaster
  • postmaster root
  • root admin_at_example.com
  • sales jack,john,mary
  • newaliases

129
??????? log
  • mailq
  • tail f /var/log/maillog

130
sendmail ?????
  • /etc/init.d/sendmail start
  • telnet localhost 25
  • mail from root_at_server.example.com
  • rcpt to root_at_example.com
  • data
  • This is a test Mail
  • .
  • quit

131
Mail Server Lab
  • ?? sendmail ???????? 192.168.30.1 ??? Server
    ???????.

132
Proxy Server
  • ?????????
  • Proxy ?? Client ????????????????????
  • ?????????

133
Proxy Server
134
Proxy Server ????
135
Proxy Server ???
  • ??
  • ???????
  • ???????
  • ????
  • ???????????? Internet
  • ?????? ( ??????? )
  • ??
  • ??? Intranet ???????
  • ???????????????
  • ???????????

136
??Proxy Server
  • SeedNet ??????(http//service.seed.net.tw/dial/ser
    ver.shtml)
  • Hinet ??????(http//www.hinet.net/support/new_adsl
    04.htm)

137
?????????????
  • CPU ???? P III 550 ????
  • RAM ?????? 512 MB
  • Hard Disk ???? SCSI ???
  • ???????????? GBytes ????

138
Proxy Server??-squid
  • ??Proxy?? squid-2.5.STABLE1-2.i386.rpm
  • ????/etc/squid
  • ???/etc/squid/squid.conf
  • ???/var/log/squid/access.log
  • /var/log/squid/cache.log
  • /var/log/squid/store.log

139
squid.conf
  • http_port 3128
  • icp_port 3130
  • reference_age 1 month
  • cache_dir ufs /var/spool/squid 100 16 256
  • cache_access_log /var/log/squid/access.log
  • cache_log /var/log/squid/cache.log
  • cache_store_log /var/log/squid/store.log
  • pid_filename /var/run/squid.pid

140
squid.conf
  • auth_param basic children 5
  • auth_param basic realm Squid proxy-caching web
    server
  • auth_param basic credentialsttl 2 hours
  • http_access allow all
  • cache_mgr root
  • cache_effective_user squid
  • cache_effective_group squid

141
squid ????
  • http_port 3128 ????????proxy server??port
  • cache_mem 8 MB ??squid????????
  • cache_dir ufs /var/spool/squid 100 16 256
  • ??????????????????,100??100MB16???????????16?25
    6????????????????????256???
  • cache_access_log /var/log/squid/access.log
  • ?????????????,???????????
  • cache_log /var/spool/squid/cache.log
  • ???????????????

142
squid ????
  • cache_store_log /var/log/squid/store.log
  • ??store.log?????
  • store.log?cache.log?access.log????????,???????
  • reference_age 1 month
  • ???????????
  • cache_mgr root
  • squid???????????

143
acl???
  • ltaclgt ltacl??gt ltacl??gt lt?????gt
  • acl??
  • ????src,srcdomain
  • ????dst,dstdomain
  • ??????url_regex -i http//
  • urlpath_regex -i
    \.gif
  • ?????
  • IP or Domain or String
  • acl example dstdomain .com

144
http_access ??
  • ?????? squid Server ???
  • ? acl ???????
  • http_access allow example
  • ?????example?acl????
  • http_access deny all
  • ???????,?? allow all

145
cache_peer ??
  • ltcache_peergt lt????gt lt??gt lthttp_portgt lticp_portgt
    lt????gt
  • ??parent(??),sibling(???)
  • http_port/icp_port3128/3130
  • ????
  • proxy-only,weightn,no-query,default,no-netdb-exc
    hange,no-digest
  • ?????proxy server???????????,???????parent?siblin
    g server.
  • cache_peer proxy.hinet.net parent 3128 3130
    proxy-only

146
cache_peer_access ??
  • ltcache_peer_accessgt lt?? Proxygt ltallowdenygt
    ltacl??gt
  • cache_peer_access proxy.hinet.net allow example

147
????cache????
  • ?????? cgi ????? cache
  • hierarchy_stoplist cgi-bin ?
  • acl QUERY urlpath_regex cgi-bin \?
  • no_cache deny QUERY

148
?????????
  • ltrefresh_patterngt ltregexgt lt????gt lt???gt
    lt????gt
  • refresh_pattern ftp 1440 20
    10080
  • refresh_pattern gopher 1440 0 1440
  • refresh_pattern . 0 20
    4320

149
?????????
  • connect_timeout 2 minutes
  • ???timeout??
  • peer_connect_timeout 30 seconds
  • ?????proxy?timeout??
  • request_timeout 5 minutes
  • ???,??? timeout ??
  • persistent_request_timeout 1 minutes
  • ???, ???? timeout ??

150
???????
  • ? FTP ???????,??????????
  • ftp_user Squid_at_
  • ftp_passive on
  • ??? DNS ??????,??????? Proxy ???,?????
    dns_children ??? 20 ??,?????? 32
  • dns_timeout 1 minutes
  • hosts_file /etc/hosts

151
transparent proxy
  • ?? squid.conf
  • httpd_accel_host proxy.example.com
    httpd_accel_port 80 httpd_access_with_proxy on
    httpd_accel_uses_host_header on
  • ?? NAT ??? port map
  • iptables -t nat -A PREROUTING -i eth0 -p tcp -s
    192.168.30.0/24 --dport 80 -j REDIRECT --to-ports
    3128

152
?? squid server
  • /etc/init.d/squid start
  • tail f /var/log/squid/access.log

153
Proxy Client???
  • ?Browser?????????????,????

154
?????? pwebstat
  • http//martin.gleeson.com/pwebstats/installation.h
    tml
  • ????????log??

155
(No Transcript)
156
Proxy Server Lab
  • ??????,???????Proxy Server
  • ?? client ? Internet ??,??? Proxy Server ?????????

157
????
  • ??/??/??
  • ?????
  • ?????????
  • ???????
  • ????????????/????/??????

158
???????
  • ??????
  • ???????
  • ??????
  • ??????

159
????
  • ????????????
  • ?? tar ?? gzip ? cpio ????????
  • ?? script ??????????

160
????
  • Cracker ???????
  • ????????????
  • ??????? ( Trojan horse )
  • DoS ??? ( Denial of Service )
  • IP ??
  • Port scan

161
????
  • ???????????
  • ??????????
  • ????????????
  • ???????????--???
  • iptables
  • http//projectfiles.com/firewall ??

162
????
  • ????????
  • ???????? port
  • netstat
  • nmap
  • ?? ssh ?????????
  • ssh
  • putty

163
??????
  • RedHat ????
  • up2date
  • ????? RedHat update Mirror
  • ftp//linux.sinica.edu.tw/redhat/updates

164
???????
  • ?????Linux??????
  • ?
  • Linux????
  • ????
About PowerShow.com