4. 在apache处事器中设置系统用户宿主目录的访谒体例,假定用户名为test:
1 ~# P5 @3 {2 [3 L" k! o: h. A 1.设置用户宿主目录的映射userdir 为 public + M! i9 Q1 {8 F7 j: e6 ~
2.只许可192.168.1.11主机能够访谒该主页 . R* P# K& j; ?- R( d' V" B
3.并在用户宿主目录下建树一个测试用的index.html文档 : I, U3 Q1 I F4 E
4.经由过程 http://ip/~test 进行测试,能够显示index.html的内容 + b2 W; n' t$ d& v
谜底:1.编纂/etc/httpd/conf/httpd.conf
: ]( m5 n! ?; E- q5 ]userdir public - ~4 W- e# y# a" Q* l
: U3 V' K( X. k% j
allowoverride fileinfo authconfig limit
" u9 B, c# m- G- ooptions indexes symlinksifownermatch ' y6 w" a" |% q& E
5 v) V ~2 `2 E1 _
order allow,deny ; l0 u$ N! ]7 [" x }
allow from 192.168.1.11
) a. s1 {# R) p4 [+ f( r- \, A, T5 \
2.cd /home/test
9 v/ G: S3 ^/ E: d I9 mmkdir public;cd public + ^% W/ {+ P" S! o) q
echo "hello 192.168.1.11">index.html . K6 r7 ^) f! W3 | w- |( w, W4 ~
3.打开浏览器进行测试,注重该浏览地址的ip必需为192.168.1.11 8 K, B: \" n, g; d
5. 设置装备摆设linux下的apache处事器:
' S. h! I1 T$ Q2 O0 i" k% W 1.设置apche文档根路径为/var/www/html
; U3 I/ y' z) Y' D; R" R- ^ 2.设置处事器监听端口为8080 5 r2 H& p; n( A) I- ]0 w, p& J
3.设置缺省主页文件为index.htm,并在文档主目录下写一个测试用的index.htm文件
$ j) F3 U! n% q 4.设置打点员的email地址为你的邮件地址
0 y5 Y7 z8 A& ~/ n 5.启动apache处事器并进行验证 0 V* V( }2 v) t$ a5 v% R' a9 M
谜底:1.编纂/etc/httpd/conf/httpd.conf
' F$ a4 P9 ~' T6 _) K6 e4 idocumentroot "/var/www/html" + n% Y2 r6 e3 Q, |" A
port 8080 4 }) z5 V; g8 @7 i. b
directoryindex index.htm $ P' J/ J/ A4 n1 y8 f( b$ e* m- K
serveradmin wujispace@126.com
3 F" B! H4 t7 Z$ \8 Y i2.service httpd start
6 ^5 }) l7 C' |! D2 u3.在浏览器中输入 http://serverip:8080 7 W( F2 V$ j+ Z9 {! E4 p
6. 在mysql中,成立一个用户test,口令为123456;授权他只能发芽mysql库中的db表,可以发芽、更新、添加、删除user表,并许可该用户从当地或者远程都可以登录mysql数据库处事器. 请进行测试.
: ], z) _, J; B8 ^- Y+ X+ U( |谜底:1.在mysql处事器上登录mysql 3 h0 l$ O. ]1 p. s
2.grant select on mysql.db to test@localhost identified by "123456";
2 @! \; k0 \% ]; x* s8 y; Mgrant select on mysql.db to test@"%" identified by "123456"; ' l* J- H4 g( I$ {
3.grant select,delete,update,insert on mysql.user to test@localhost identified by "123456"; 8 D! \$ K0 H" G5 {: v: r
grant select,delete,update,insert on mysql.user to test@"%" identified by "123456"; ; w" S) B" D9 H3 l
4.当地 mysql -u test
# ]6 N$ d0 X4 I! T( z$ w8 F远程 mysql -h mysql地址ip -u test |