a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 55|回复: 0

[考试试题] Linux网络管理实验(7)

[复制链接]
发表于 2012-8-4 12:10:41 | 显示全部楼层 |阅读模式
4. 在apache服务器中设置系统用户宿主目录的访问方式,假定用户名为test: ( I0 `- {* @9 Y7 z# a8 Q
 1.设置用户宿主目录的映射userdir 为 public # T! P0 U  e  H2 ^
 2.只允许192.168.1.11主机能够访问该主页
/ [8 w$ K# N! R% A. g7 U4 ^" R$ w 3.并在用户宿主目录下创建一个测试用的index.html文档
: N. Y; q% ?* y+ R+ `: n 4.通过 http://ip/~test 进行测试,能够显示index.html的内容
- z( R1 Z& S0 K1 B& Q- X5 O答案:1.编辑/etc/httpd/conf/httpd.conf : f# o% S9 i( c
userdir public
  [' R  K: d# h+ |  @5 G" x+ R7 o' E9 u! l, e4 K2 S: r
allowoverride fileinfo authconfig limit $ r$ y/ h* L% E) P
options indexes symlinksifownermatch
( N; g0 [/ v9 I( `
& x) Y1 {- x6 y' Qorder allow,deny
$ ^0 w! \" w2 o& X. ?  m7 D6 Oallow from 192.168.1.11
; Y) Q% c8 c( @7 F$ A. r  C- i9 }9 ~( b' z
2.cd /home/test ! f- o, y! `. I# s, L$ n! \! ?+ }  ]
mkdir public;cd public , n9 z& O. w4 o* }7 W8 X. e1 Z
echo "hello 192.168.1.11">index.html
) v3 O) K8 e6 y+ Z3.打开浏览器进行测试,注意该浏览所在的ip必须为192.168.1.11
* r- H9 Y% z; b  i4 n) l5. 配置linux下的apache服务器:
) @2 t# B7 d# V9 h2 D 1.设置apche文档根路径为/var/www/html
, ?6 U4 m& D* [* u4 v$ O 2.设置服务器监听端口为8080 ! N  u' w* O8 ?6 r. r
 3.设置缺省主页文件为index.htm,并在文档主目录下写一个测试用的index.htm文件
& t! }- W( s/ {( v 4.设置管理员的email地址为你的邮件地址 # s$ ]6 `6 O( \  D6 C' s5 V
 5.启动apache服务器并进行验证
* k1 f7 t9 t5 [9 i答案:1.编辑/etc/httpd/conf/httpd.conf
  c4 W2 a/ h8 c( i' m' E; [4 H+ w" pdocumentroot "/var/www/html" 3 f! S. b  f: h7 b# q9 H& S
port 8080 , x8 _7 u/ y2 }* p1 i0 Y* G. l& \
directoryindex index.htm 5 _" D: c+ _$ X& t
serveradmin wujispace@126.com
0 ?  t& x2 ]2 u) s) ^7 D3 B' _2 [2.service httpd start
  i: d1 \& h, @' g( {3.在浏览器中输入 http://serverip:8080
# r. V# X9 B3 s6 w6 ]' R6. 在mysql中,建立一个用户test,口令为123456;授权他只能查询mysql库中的db表,可以查询、更新、添加、删除user表,并允许该用户从本地或者远程都可以登录mysql数据库服务器. 请进行测试. 7 W/ [; G- C% L5 ]  }) h
答案:1.在mysql服务器上登录mysql % J2 {1 i5 o  L# \
2.grant select on mysql.db to test@localhost identified by "123456"; , v8 W8 z9 E: S9 I" I$ o3 s
grant select on mysql.db to test@"%" identified by "123456";
. S6 k2 k2 F* X- x% R2 ?- w+ i3.grant select,delete,update,insert on mysql.user to test@localhost identified by "123456";
2 B' `7 b* T5 {: H2 m( x5 rgrant select,delete,update,insert on mysql.user to test@"%" identified by "123456"; ! z- E. M6 o: J% R5 g
4.本地 mysql -u test . Y( y! j' O( b% z& b9 f+ A
远程 mysql -h mysql所在ip -u test
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 18:37 , Processed in 0.220786 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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