1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!
systemctl stop firewalld
setenforce 0
cd /etc/httpd/conf.d/
vim openlab.conf
**
<VirtualHost 192.168.170.100:80>
DocumentRoot /www/openlab
ServerName 192.168.170.100
</VirtualHost>
<Directory /www>
AllowOverride none
Require all granted
</Directory>
**
vim /etc/hosts
**
192.168.170.100 www.openlab.com
**
实现的结果:
2.给该公司创建三个网站目录分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料
www.openlab.com/money网站访问缴费网站。
修改 cd /etc/httpd/conf.d/配置文件即可
具体步骤:
vim openlab.conf
**
<VirtualHost 192.168.170.100:80>
DocumentRoot /www/openlab
ServerName 192.168.170.100
</VirtualHost>
<Directory /www>
AllowOverride none
Require all granted
</Directory>
<Directory /www/openlab/data>
allowOverride none
Require all granted
</Directory>
<Directory /www/openlab/student>
allowOverride none
Require all granted
</Directory>
<Directory /www/openlab/money>
allowOverride none
Require all granted
</Directory>
**
mkdir -p /www/student
mkdir -p /www/data
mkdir -p /www/money
echo this is student > /www/student/index.html
echo this is ziliao > /www/data/index.html
echo this is money > /www/money/index.html
实现结果:
3.要求(1)学生信息网站只有song和tian两人可以访问,其他网站所有用户用能访问。(2)访问缴费网站实现数据加密基于https访问。
(1)
(2)