2010年下半年全国软考考试试题及答案
2010-12-16 17:25
375 查看
1.创建个人用户和站点
[root@localhost ~]# useradd baidu
[root@localhost ~]# passwd baidu
Changing password for user baidu
[root@localhost ~]# su - baidu
[baidu@localhost ~]$ mkdir public_html
[baidu@localhost ~]$ cd public_html/
[baidu@localhost public_html]$ vim index.html
hello baidu~
~
2.配置个人站点的文档
--安装密文访问
[root@localhost ~]# yum install mod_ssl
[root@localhost ~]# service httpd start
Starting httpd: [ OK ]
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
134 Listen 80—明文访问
349 <IfModule mod_userdir.c>
--存放发布个人站点的模块
--一般是禁用的
355 #UserDir disable—默认是禁用的
362 # UserDir public_html
364 UserDir public_html—取消禁用,目录要与个人站点的一致
365 </IfModule>
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@localhost ~]#
[root@localhost ~]# netstat -tupln |grep http
tcp 0 0 :::80 :::* LISTEN 2272/httpd
tcp 0 0 :::443 :::* LISTEN 2272/httpd
[root@localhost ~]#
3.权限被拒绝
22-1
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
[baidu@localhost ~]$ cd ..
[baidu@localhost home]$ ll
total 12
drwx------ 4 baidu baidu 4096 Aug 23 23:22 baidu
drwx------ 3 redhat redhat 4096 Aug 12 13:32 redhat
[baidu@localhost home]$ chmod o+rx baidu
[baidu@localhost home]$ pwd
/home
3.访问个人站点
22-2
4.去掉~访问个人站点
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
alias /baidu "/home/baidu/public_html"
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
22-3
5.在baidu用户上实现身份验证,只允许其定义的用户可以访问个人网站
--定义身份验证
--在站点的总目录里
[baidu@localhost public_html]$ pwd
/home/baidu/public_html
[baidu@localhost public_html]$
[baidu@localhost public_html]$ vim .htaccess
authuserfile /home/baidu/public_html/.passwd
authtype basic
authname "please input your name and your password:"
require valid-user
--创建登陆验证用户
[baidu@localhost public_html]$ htpasswd -c .passwd zhangsan
New password:
Re-type new password:
Adding password for user zhangsan
[baidu@localhost public_html]$ htpasswd .passwd lisi
New password:
Re-type new password:
Adding password for user lisi
[baidu@localhost public_html]$ cat .passwd
zhangsan:cHgZASaOvpzgA
lisi:aCb52rQLOeTJg
[baidu@localhost public_html]$ ~
6.打开目录安全性
--指定目录安全性的目录
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
[root@localhost ~]#
372 <Directory /home/*/public_html>
373 AllowOverride all
374 # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
375 # <Limit GET POST OPTIONS>
376 # Order allow,deny
377# Allow from all
378 # </Limit>
379 # <LimitExcept GET POST OPTIONS>
380 # Order deny,allow
381 # Deny from all
382 # </LimitExcept>
383 </Directory>
400 AccessFileName .htaccess
-- Web保护某些文件
406 <Files ~ "^\.ht">
407 Order allow,deny
408 Deny from all
409 </Files>
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
7.验证身份的用户登陆测试
22-4本文出自 “一抹茶色阳光” 博客,请务必保留此出处http://sweetsingle.blog.51cto.com/3429592/741819
[root@localhost ~]# useradd baidu
[root@localhost ~]# passwd baidu
Changing password for user baidu
[root@localhost ~]# su - baidu
[baidu@localhost ~]$ mkdir public_html
[baidu@localhost ~]$ cd public_html/
[baidu@localhost public_html]$ vim index.html
hello baidu~
~
2.配置个人站点的文档
--安装密文访问
[root@localhost ~]# yum install mod_ssl
[root@localhost ~]# service httpd start
Starting httpd: [ OK ]
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
134 Listen 80—明文访问
349 <IfModule mod_userdir.c>
--存放发布个人站点的模块
--一般是禁用的
355 #UserDir disable—默认是禁用的
362 # UserDir public_html
364 UserDir public_html—取消禁用,目录要与个人站点的一致
365 </IfModule>
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@localhost ~]#
[root@localhost ~]# netstat -tupln |grep http
tcp 0 0 :::80 :::* LISTEN 2272/httpd
tcp 0 0 :::443 :::* LISTEN 2272/httpd
[root@localhost ~]#
3.权限被拒绝
22-1
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" />
[baidu@localhost ~]$ cd ..
[baidu@localhost home]$ ll
total 12
drwx------ 4 baidu baidu 4096 Aug 23 23:22 baidu
drwx------ 3 redhat redhat 4096 Aug 12 13:32 redhat
[baidu@localhost home]$ chmod o+rx baidu
[baidu@localhost home]$ pwd
/home
3.访问个人站点
22-2
4.去掉~访问个人站点
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
alias /baidu "/home/baidu/public_html"
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
22-3
5.在baidu用户上实现身份验证,只允许其定义的用户可以访问个人网站
--定义身份验证
--在站点的总目录里
[baidu@localhost public_html]$ pwd
/home/baidu/public_html
[baidu@localhost public_html]$
[baidu@localhost public_html]$ vim .htaccess
authuserfile /home/baidu/public_html/.passwd
authtype basic
authname "please input your name and your password:"
require valid-user
--创建登陆验证用户
[baidu@localhost public_html]$ htpasswd -c .passwd zhangsan
New password:
Re-type new password:
Adding password for user zhangsan
[baidu@localhost public_html]$ htpasswd .passwd lisi
New password:
Re-type new password:
Adding password for user lisi
[baidu@localhost public_html]$ cat .passwd
zhangsan:cHgZASaOvpzgA
lisi:aCb52rQLOeTJg
[baidu@localhost public_html]$ ~
6.打开目录安全性
--指定目录安全性的目录
[root@localhost ~]# vim /etc/httpd/conf/httpd.conf
[root@localhost ~]#
372 <Directory /home/*/public_html>
373 AllowOverride all
374 # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
375 # <Limit GET POST OPTIONS>
376 # Order allow,deny
377# Allow from all
378 # </Limit>
379 # <LimitExcept GET POST OPTIONS>
380 # Order deny,allow
381 # Deny from all
382 # </LimitExcept>
383 </Directory>
400 AccessFileName .htaccess
-- Web保护某些文件
406 <Files ~ "^\.ht">
407 Order allow,deny
408 Deny from all
409 </Files>
[root@localhost ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
7.验证身份的用户登陆测试
22-4本文出自 “一抹茶色阳光” 博客,请务必保留此出处http://sweetsingle.blog.51cto.com/3429592/741819
相关文章推荐
- 2009年5月全国计算机软考网络工程师考试试题答案
- 2009年上半年软考网络工程师考试试题(上午答案)
- 2016年下半年软考网络工程师考试上午题试题答案发布
- 全国计算机等级考试今日举行 51CTO独家提供最新试题答案
- 51CTO独家发布全国计算机等级考试最新试题与答案
- 2005年4月全国计算机等级考试二级JAVA笔试试题及答案
- 2006年全国硕士研究生入学统一考试西医综合科目试题及其答案
- 2007年全国硕士研究生入学统一考试西医综合科目试题及其答案
- 2009年3月全国计算机等级考试二级Java笔试试题及答案
- 全国软考网络工程师考试备考资料
- 2017年上半年软考网络工程师考试真题参考答案
- 51CTO第一时间公布软考试题及答案
- 软考新思维--2017年上半年信息系统项目管理师上午试题分析与答案(试题41-45题)
- 9月20日等级考试试题答案实时追踪中
- 软考网络管理员-考试练习题及答案(2)
- 软考信息技术处理员-模拟试题及答案【第十一章】
- 2010年下半年11月份系统架构设计师上午试题以及参考答案之七
- 嵌入式助理工程师(软件+硬件)考试试题及答案