一.要求
二.做实验
2.1配置百度网站
1在虚拟机上建库,进入/etc/yum.repos.d/目录,编辑 baser.repo 配置文件
[baseos]
name=baseos
baseurl=/mnt/BaseOS
gpgcheck=0
[appstream]
name=appTream
baseurl=/mnt/AppStream
gpgcheck=0
2 在虚拟机上安装 httpd 包.
mount /dev/sr0 /mnt
dnf install httpd -y #安装 httpd 包
3 配置host.conf 配置文件
<directory /www>
allowoverride none
require all granted
</directory /www>
<virtualhost 192.168.118.136:443>
servername www.baidu.com
documentroot /www/baidu
ErrorLog “logs/error_baidu_log”
CustomLog “logs/error_baidu_log” combined
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/baidu.crt
SSLCertificateKeyFile /etc/pki/tls/private/baidu.key
4自定义网站内容
mkdir /www/baidu -p
echo “It’s this www.baidu.com” > /www/baidu/index.html
5.证书加密
cd /etc/pki/tls/certs #进入其配置文件
rz #使用 rz 命令将 MakeFile 文件放在此路径下,若没有 MakeFile 文件可使用wget http://www.kittod.com/Makefile命令即可下载
dnf install make -y #下载make包
make baidu.crt #使用 make 命令制作证书
dnf install mod_ssl -y #安装 https 模块
mv baidu.key …/private/ #把钥匙移到默认路径
6.将本地ip改为百度ip
192.168.223.133 www.baidu.com #本地主机IP地址
192.168.223.133 www2.baidu.com
7.关闭防火墙
setenforce 0 #关闭权限
systemctl stop httpd #关闭防火墙
systemctl restart httpd #重启服务
8.查看是否创建成功
curl -k https://www.baidu.com
curl -k https://www2.baidu.com
三.创建百度邮件服务器
3.1 安装邮件服务器相关软件,并编辑 postfix 服务的主配置文件
dnf install postfix mailx -y #安装 postfix、mailx包
vim /etc/postfix/main.cf #编辑 postfix 服务的主配置文件
(1)
92 # other configuration parameters.
93 #
94 #myhostname = virtual.domain.