任务描述:请采用 Apache 搭建企业网站。
(1)配置 linux1 为 Apache2 服务器,使用 skills.lan 或any.skills.lan(any 代表任意网址前缀,用 Linux1.skills.lan 和web.skills.lan 测试)访问时,自动跳转到 www.skills.lan。禁止使用 IP 地址访问,默认首页文档/var/www/html/index.html 的内容为"apache"。
(3)客户端访问 Apache 服务时,必需有 ssl 证书。
[root@linux1 ~]# yum install -y httpd mod_ssl
[root@linux1 ~]# vim /etc/httpd/conf/httpd.conf
# 在末尾添加
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
<virtualhost *:80>
DocumentRoot "/var/www/html"
Servername linux1.skills.lan
RewriteEngine On
RewriteRule ^/(.*)$ https://www.skills.lan/$1 [R=301]
<Directory "/">
Require all granted
</Directory>
</virtualhost>
<virtualhost *:80>
servername 10.10.220.101
redirect 403 /
</virtualhost&g