手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

RHCE认证培训+考试七天实录(七)

[日期:2012-12-04] 来源:80821.blog.51cto.com  作者:yttitan [字体:大 中 小]

8、只向192.168.0.0/24网络通过NFS输出您的/common共享目录。
 
nfs服务默认已经安装,启动服务:
 
# service nfs start
 
# chkconfig nfs on
 
修改配置文件:
 
# vim /etc/exports
 
/common 192.168.0.0/24(sync,ro)
 
保存退出,重启服务:
 
# service nfs restrat
 

在真机上验证:
 
# showmount –e 192.168.0.114
 
或
 
# cd /net/192.168.0.114/common
 
9、按以下要求配置SSH访问:
 
(1)用户harry能够从网络192.168.0.0/24访问你的机器。
 
(2)在网络172.16.0.0/24网络内的机器不能访问你的机器。
 
# service sshd start
 
# chkconfig sshd on
 
 (这道题纯粹是投机取巧,呵呵)
 
10、为主机192.168.0.114创建一个web服务器,然后执行下述步骤:
 
(1)从ftp://192.168.0.254/pub/rhce/station.html下载文件,并且将文件重命名为index.html。
 
(2)将文件index.html拷贝到您的web服务器的DocumentRoot目录下。
 
(3)不要对文件index.html的内容进行任何修改。
 
操作步骤:
 
httpd服务默认已经安装,启动服务:
 
# service httpd start
 
# chkconfig httpd on
 
从服务器下载文件:
 
# wget ftp://192.168.0.254/pub/rhel6/station.html
 
# cp station.html /var/www/html/index.html(注意,这里一定是cp复制,而不能用mv移动,否则还要修改selinux上下文。)
 
11、扩展您的web服务器,为站点http://www.domain170.example.com创建一个虚拟主机,然后执行下述步骤:
 
(1)设置DocumentRoot为/var/www/virtual
 
(2)从ftp://192.168.0.254/pub/rhce/www.html下载文件,并且将文件重命名为index.html。
 
(3)将文件index.html放到虚拟主机的DocumentRoot目录下。
 
(4)不要对文件index.html的内容进行任何修改。
 
(5)确保harry用户能够在/var/www/virtual目录下创建文件。
 
操作步骤:
 
首先创建虚拟主机的主目录:
 
# mkdir /var/www/virtual
 
从服务器下载文件:
 
[root@server14 ~]# wget ftp://192.168.0.254/pub/rehl6/www.html
 
将文件改名并移动到主目录中:
 
[root@server14 ~]# cp www.html /var/www/virtual/index.html
 
修改配置文件httpd.conf:
 
[root@server14 ~]# vim /etc/httpd/conf/httpd.conf
 
按G将光标移动到文件末尾,增加如下内容:
 
NameVirtualHost 192.168.0.114
 
<VirtualHost 192.168.0.114>
 
    DocumentRoot /var/www/html/
 
    ServerName station.domain170.example.com
 
</VirtualHost>
 
<VirtualHost 192.168.0.114>
 
    DocumentRoot /var/www/virtual/
 
    ServerName www.domain170.example.com
 
</VirtualHost>
 
保存退出,重启服务:
 
# service httpd restart
 
最后将/var/www/virtual的属主改为harry。
 
# chown harry /var/www/virtual

linux
相关资讯      
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款