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
