以下仅为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