Linux网络管理实验汇总(5)

来源:Linux认证    发布时间:2012-11-10    Linux认证视频    评论

 
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

视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答