Linux网络管理实验汇总(7)
来源:优易学  2011-12-29 16:59:28   【优易学:中国教育考试门户网】   资料下载   IT书店
4. 在apache服务器中设置系统用户宿主目录的访问方式,假定用户名为test:
 1.设置用户宿主目录的映射userdir 为 public
 2.只允许192.168.1.11主机能够访问该主页
 3.并在用户宿主目录下创建一个测试用的index.html文档
 4.通过 http://ip/~test 进行测试,能够显示index.html的内容
答案:1.编辑/etc/httpd/conf/httpd.conf
userdir public

allowoverride fileinfo authconfig limit
options indexes symlinksifownermatch

order allow,deny
allow from 192.168.1.11

2.cd /home/test
mkdir public;cd public
echo "hello 192.168.1.11">index.html
3.打开浏览器进行测试,注意该浏览所在的ip必须为192.168.1.11
5. 配置linux下的apache服务器:
 1.设置apche文档根路径为/var/www/html
 2.设置服务器监听端口为8080
 3.设置缺省主页文件为index.htm,并在文档主目录下写一个测试用的index.htm文件
 4.设置管理员的email地址为你的邮件地址
 5.启动apache服务器并进行验证
答案:1.编辑/etc/httpd/conf/httpd.conf
documentroot "/var/www/html"
port 8080
directoryindex index.htm
serveradmin wujispace@126.com
2.service httpd start
3.在浏览器中输入 http://serverip:8080
6. 在mysql中,建立一个用户test,口令为123456;授权他只能查询mysql库中的db表,可以查询、更新、添加、删除user表,并允许该用户从本地或者远程都可以登录mysql数据库服务器. 请进行测试.
答案:1.在mysql服务器上登录mysql
2.grant select on mysql.db to test@localhost identified by "123456";
grant select on mysql.db to test@"%" identified by "123456";
3.grant select,delete,update,insert on mysql.user to test@localhost identified by "123456";
grant select,delete,update,insert on mysql.user to test@"%" identified by "123456";
4.本地 mysql -u test
远程 mysql -h mysql所在ip -u test

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训