Linux网络管理实验汇总二)
来源:优易学  2011-11-30 19:44:55   【优易学:中国教育考试门户网】   资料下载   IT书店

1. 设置turbo linux中的proftpd服务:独立启动,允许根用户登录,加入欢迎信息显示(显示当前已经登录的用户数量,使用者的帐号等),加入目录切换的信息提示,限制尝试登录的次数为3次
答案:1.编辑/etc/proftpd/proftpd.conf加入
servertype standalone
rootlogin on
displaylogin /etc/proftpd/message.msg
displayfirstchdir /etc/proftpd/.message
maxloginattempts 3
 2.编辑message.msg文件,加入%u,%n
 3.启动服务 service proftpd start
 4.如果root用户还是不能登陆则在/etc/ftpusers中将root所在行注释掉

2. 在apache中设置基于ip的虚拟主机服务,假定ip分别为192.168.1.11,192.168.1.12,在每个虚拟主机中配置不同的 documentroot,serveradmin,servername等信息,然后设置每个虚拟主机的监听方式(在80还是8080端口监听)。
答案:1.在配置文件/etc/httpd/conf/httpd.conf中添加

documentroot "/var/www/x"
serveradmin admin@126.com
servername 192.168.1.x

listen 192.168.1.11:80
listen 192.168.1.12:8080
2.创建上述/var/www/x目录,加入相关测试文件*.html
3.通过浏览器进行测试访问 http://192.168.1.x

3. 在apache服务器中设置系统用户宿主目录的访问方式,假定用户名为test:
 1.加入用户身份验证,只允许test,test1,test2用户访问
 2.直接在httpd.conf文件中配置实现上述功能
 3.通过外部的.htaccess文件实现上述功能
答案:1.在配置文件中找到 加入
authtype basic
authname “input your name & pass"
authuserfile /etc/httpd/conf/users
require valid-user
2.利用命令添加用户 htpasswd -c /etc/httpd/conf/users test
htpasswd -c /etc/httpd/conf/users test1
htpasswd -c /etc/httpd/conf/users test2
3.登录测试
4.将1种的四行信息写入.htaccess文件中
通过allowoverride设置authconfig,以便允许使用.htaccess

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

[1] [2] [3] [4] [5] 下一页

责任编辑:小草

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