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

RHCE自测练习题

[日期:2012-06-07] 来源:Linux社区  作者:Linux [字体:大 中 小]

以下仅为RHCE自测练习题

192.168.0.0/24属于example.com这个域

ip:192.168.0.7

hostname:server7.example.com

1. SELinux 设置为开机自动 enforcing

# vi /etc/sysconfig/selinux

  SELINUX=enforcing

2. 启用内核IP转发

# /etc/sysctl.conf

  net.ipv4.ip_forward = 1

# sysctl -p


3. 禁用student用户使用crontab

# vi /etc/cron.deny

  student

4. ftp服务器仅允许example.com域用户匿名登录

# vi /etc/hosts.deny

  vsftpd:ALL

# vi /etc/hosts.allow

  vsftpd:192.168.0.

5. mail服务器可以接收本机和远程邮件,student用户可以从远程接收邮件,邮件存放到指定目录/var/spool/mail/username

# chkconfig postfix on

# chkconfig dovecot on

# postconf -d | grep inet

# postconf -e inet_interfaces=all

# vi /etc/dovecot/conf.d/10-mail.conf

# mail_location = mbox:~/mail:INBOX=/var/mail/%u

# su - student

$ mkdir -p mail/.imap/INBOX

6. 配置mail别名,使发送给admin的邮件发给student

# vi /etc/alias

  admin: student

# postalias /etc/alias

7. 配置apache服务器,下载页面:ftp://instructor.example.com/pub/materials/station.html 到 /var/www/html 作为首页,可以访问http://serverX.example.com

8. 建立apache虚拟主机,下载页面:ftp://instructor.example.com/pub/materials/www.html 到 /www/virtual 作为首页,可以访问http://wwwX.example.com

# chkconfig httpd on

# vi /etc/httpd/conf/httpd.conf

  NameVirtualHost *:80

  <VirtualHost *:80>

      DocumentRoot /var/www/html

      ServerName server7.example.com

      ErrorLog logs/server7.example.com-error_log

      CustomLog logs/server7.example.com-access_log common

  </VirtualHost>

  <VirtualHost *:80>

      DocumentRoot /www/virtual

      ServerName www7.example.com

      ErrorLog logs/www7.example.com-error_log

      CustomLog logs/www7.example.com-access_log common

  </VirtualHost>

# mkdir -p /www/virtual

# chcon -R --reference=/var/www/html /www/

# 在/var/www/html,/www/virtual分别下载所需页面,并改名为index.html

# vi /etc/hosts

  192.168.0.7    www7.example.com

  192.168.0.7    server7.example.com

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

       

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