a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 56|回复: 0

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

[复制链接]
发表于 2012-8-4 12:10:41 | 显示全部楼层 |阅读模式
4. 在apache服务器中设置系统用户宿主目录的访问方式,假定用户名为test: " b& N- N0 y! E; T, {. p
 1.设置用户宿主目录的映射userdir 为 public
2 ?+ P0 b+ d: D" k# \3 c( { 2.只允许192.168.1.11主机能够访问该主页
' c' d+ a) B4 z 3.并在用户宿主目录下创建一个测试用的index.html文档 ' l9 r" c, O& H9 r% W3 e2 L- y; {
 4.通过 http://ip/~test 进行测试,能够显示index.html的内容
) G. R8 y5 Q: L$ ?) n答案:1.编辑/etc/httpd/conf/httpd.conf 2 I3 s* s8 G3 y7 [0 m+ M
userdir public 6 t: [+ }# u9 E' B" W; P
5 O# W* L: M7 d1 c: e
allowoverride fileinfo authconfig limit
1 x' m0 _% V( |& koptions indexes symlinksifownermatch
! E( K5 K* o% C  w; [9 z; C
5 T- Z: L8 Z/ U1 P- `order allow,deny   P7 C" `, l9 a: h
allow from 192.168.1.11 6 {% U& @* w) N! |- o
* K6 \5 F0 W& B+ B
2.cd /home/test . F7 S4 y3 `+ c! ?3 j1 ~
mkdir public;cd public
4 u2 t! a) o" G4 p: Jecho "hello 192.168.1.11">index.html
6 H0 h  U6 k2 g7 h- X; v: G5 T3.打开浏览器进行测试,注意该浏览所在的ip必须为192.168.1.11
( _; _: q  m# T- i; m5. 配置linux下的apache服务器: , \4 O% B# u$ {$ F' A" Z# P" C0 K
 1.设置apche文档根路径为/var/www/html
1 E* ]; X" v. P7 ~ 2.设置服务器监听端口为8080
' H5 S& ?& N  @/ F+ _ 3.设置缺省主页文件为index.htm,并在文档主目录下写一个测试用的index.htm文件
, J8 g9 Q+ C- Q" A/ V# ^ 4.设置管理员的email地址为你的邮件地址
+ \6 |+ m& I4 Y& D 5.启动apache服务器并进行验证 3 i6 {0 t7 U' {
答案:1.编辑/etc/httpd/conf/httpd.conf
$ ~$ ?' @2 y7 I" Fdocumentroot "/var/www/html" 9 _7 f, H! @/ G4 I5 W
port 8080
) o& w# X! d9 T% g- ^  M2 `" udirectoryindex index.htm
3 f: R0 ~2 a, Q$ i& [6 S- `serveradmin wujispace@126.com
- A% g8 T( _6 _7 U$ J/ g2.service httpd start
9 D2 t- _6 q! t/ r- X. p3 ^3.在浏览器中输入 http://serverip:8080 4 n( y8 R: O/ A
6. 在mysql中,建立一个用户test,口令为123456;授权他只能查询mysql库中的db表,可以查询、更新、添加、删除user表,并允许该用户从本地或者远程都可以登录mysql数据库服务器. 请进行测试. , O$ y6 l* B' {6 _% N
答案:1.在mysql服务器上登录mysql
* A' j0 v* w4 _% O0 I2.grant select on mysql.db to test@localhost identified by "123456";
+ S+ G, i/ ]' ]3 \7 I% m* G+ r) [8 [grant select on mysql.db to test@"%" identified by "123456";
) P* P9 m3 ?9 |8 o% U3.grant select,delete,update,insert on mysql.user to test@localhost identified by "123456";
) x. Q! q3 E& {2 Y0 k1 P$ u7 ggrant select,delete,update,insert on mysql.user to test@"%" identified by "123456"; 2 F6 e6 \7 o- p+ ]4 u8 C$ \
4.本地 mysql -u test : w; y1 v2 K8 ~! {: z" ?# r* r, d0 O
远程 mysql -h mysql所在ip -u test
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-14 21:27 , Processed in 0.222105 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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