实验要求:
给openlab搭建网站:
1、基于域名www.openlab.com可以访问网站内容为welcome to openlab!!!
2、给该公司创建三个虚拟网站目录,分别显示学生信息、教学资料和缴费网站。
(基于www.openlab.com/student网站访问学生信息,www.openlab.com/data网站访问教学资料,基于www.openlab.com/money访问缴费网站)
3、学生信息网站只有song和tian两个人可以访问,其他网站所有用户能访问。
访问缴费网站实现数据加密基于https访问。
实验过程:
1、安装httpd包(http服务)和mod_ssl包(专门为Apache server提供密码保护)
[root@localhost conf.d]# yum install -y httpd
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:23:32 前,执行于 2020年11月03日 星期二 16时30分44秒。
Package httpd-2.4.37-10.module+el8+2764+7127e69e.x86_64 is already installed.
依赖关系解决。
无需任何处理。
完毕!
[root@localhost conf.d]# yum install -y mod_ssl
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:02:33 前,执行于 2020年11月03日 星期二 16时30分44秒。
Package mod_ssl-1:2.4.37-10.module+el8+2764+7127e69e.x86_64 is already installed.
依赖关系解决。
无需任何处理。
完毕!
2、写虚拟主机配置文件
[root@localhost ~]# cd /etc/httpd/conf.d/
[root@localhost conf.d]# vim vhost-openlab.conf
<VirtualHost 192.168.74.130:80> //虚拟主机模块(基于http访问)
DocumentRoot /www/http //网页文件主目录
ServerName www.openlab.com //主机名(此处为域名)
alias /student /openlab/student //别名
alias /data /openlab/data /