a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 124|回复: 0

[综合辅导] Linux网络管理实验辅导分析(六)

[复制链接]
发表于 2012-8-4 12:07:07 | 显示全部楼层 |阅读模式
7. 使用mysql  
; K& r: s- L  c1 L 1.查看当前的数据库  
% ~+ A* F, S8 ` 2.添加一个数据库week,在库中插手一个表today,字段搜罗:id 整数,name 10个可变字符  
$ i% q" D9 R" T  P; I. ~ 3.显示week数据库的所有表  
) A: Z+ V" {/ ?, J  x: h 4.经由过程文件将today表需要的数据输入  
4 X  z2 B1 `" f: i- ?6 q 5.显示today表中所有的数据  
1 u8 U9 ?" K' g9 D谜底:1.service mysql start  
& y3 L1 c( D2 k# |2.show databases;  
8 C; I# ?# U' h9 p2 \7 U4 q: s; f4 [3.create database week;  
  J5 }# v3 o& x& F7 O4.use week;  
+ _) }1 `( g8 |; P9 u5.create table today(id int,name varchar(10);  2 y/ v' s6 I" s  p% Q
6.show tables;  
1 I4 a3 o& o( J( F! u9 q/ t. _3 [7.load data local infile "data.txt" into table today;  ( s3 l* q: x$ ]6 d
8.select * from today;  
" ]8 e  O; u0 x8. 经由过程ntp实现收集时刻同步  
+ w0 r/ Q8 R; {! n- n1.经由过程ntpdate指按时刻处事器为time.mit.edu  
) V. d) h# e* _5 D: @. c2.将linux主机设置装备摆设成时刻处事器,经由过程客户历程xntpdc进行测试  
% U, \  E! B' j: ]0 Q' j9 F: @谜底:1.ntpdate time.mit.edu    H0 t5 f6 \5 k: k
2.编纂/etc/ntp.conf  ' s' ?) b8 G  }
server time.mit.edu  - I1 S0 N% M/ h2 x) ], s, R
driftfile /etc/ntp.drift    Z" d/ _  d& [# [6 [, C
3.service ntpd start  1 Q% \2 a, G3 [* @( V- V
4.xntpdc ntp处事器ip  
. K% q0 t) [6 ?8 {9. 在linux下不雅察看收集情形,然后编写一个剧本,实现如下功能:  4 w/ y2 i6 `/ w( R0 i+ r8 ]
设置可用的ip地址,设置默认网关,设置可用的dns  5 x( s/ U4 M. L; f! a( G; k
设置该剧本运行权限,然后放入系统的启动剧本中,以便开机后能够自动设置装备摆设收集。  
6 [( I' Y- e. L; \谜底:1.操作vi编纂localnetcfg文件  ) v" ~5 j% V: x
ifconfig eth0 218.193.118.xx  8 E3 E  M# D% s( T& @. t
route add default gw 218.193.118.254  
* A7 U& a3 Y7 ^1 R; u; G. p& ~echo "nameserver 210.34.48.34">/etc/resolv.conf  
5 g& C' F* w" o2 {7 j2.chmod u+x localnetcfg  - M0 D$ H) q. ~& g9 c. [
3.将该剧本放入/etc/rc.d/init.d目录下  2 b8 `6 Z/ m+ c* p0 ?  e% f2 X# g# {
然后在/etc/rc.d/rc3.d或者rc5.d目录下设置sxxlocalnetcfg符号链接文件链接上述的localnetcfg文件。  : |0 A# C8 @+ I; ^" w7 \
10. 操作linux中的squid将linux主机设置成上网代办代庖机,并用windows的ie浏览器进行验证。请将上述代办代庖3128酿成80,做成斗劲透明的代办代庖。  
4 ^$ t# o0 g/ P" Z6 _+ |8 S9 g4 }谜底:1. squid的设置装备摆设文件/etc/squid/squid.conf,改削  
$ _! Q/ G6 a, C( Rhttp_port 3128  
" b/ _; v  m3 wcache_dir ufs /var/spool/squid 100 16 256  4 {* F! z8 r! o' `+ u
httpd_accel_host virtual   ! M% {, v# D2 K! d7 H
httpd_accel_port 80   / A# _/ J5 a! y/ x  o
httpd_accel_with_proxy on   + c' ^9 k8 i3 |% z8 U7 X$ @
httpd_accel_uses_host_header on  6 l: D) }% J. J% W
cache_effective_user nobody   
5 m' L& |. b: l& {cache_effective_group nobody  
$ P1 a3 c, D$ i& [http_access allow all  
5 M6 i; N2 {" f2 h2 Q. ]* w; e2.确定/var/spool/squid目录的存在  
: m& R- A, h3 M7 a" r( H  f. W3.启动squid,service squid start  $ T9 |$ C# o! I$ B! O1 {( M
4.设置ie浏览器  + G+ n3 |8 Q4 P7 T' K5 Q$ O
工具菜单--〉internet选项à局域网设置à  5 ]5 \" l2 y9 O/ x- C/ o7 @; _9 \$ A
ipadd: 192.168.1.1 port: 3128  1 P3 |7 ~6 K% `
5.iptables -t nat -a prerouting -p tcp -s 192.168.1.0/24 --dport 80   
3 C; G- \8 O5 P* M0 y' W4 n& `-j dnat --to 192.168.1.1:3128
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-5-21 12:20 , Processed in 0.159508 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表