综合练习:请给openlab搭建web网站
网站需求:
1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!!
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于[www.openlab.com/student](http://www.openlab.com/student) 网站访问学生信息,[www.openlab.com/data](http://www.openlab.com/data)网站访问教学资料
[www.openlab.com/money网站访问缴费网站](http://www.openlab.com/money网站访问缴费网站)。
3.要求
(1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。
第一步:关闭防火墙和selinux
第二步:安装对应的服务软件
mount /dev/sr0 /mnt
yum install httpd
第三步:更改配置文件实现自定义设置
vim /etc/htttpd/conf.d/vhosts.conf
第四步:更改host文件以访问本地域名
vim /etc/hosts
第五步:根据配置创建资源文件
mkdir /openlab
echo welcome to openlab > /openlab/index.html
systemctl restart httpd
第六步:测试是否成功后继续修改配置文件
vim /etc/htttpd/conf.d/vhosts.conf\n\n!
会弹出
(https://img-blog.csdnimg.cn/27b237c8bdf94020824eb17ed2584a91.png![](https://img-blog.csdnimg.cn/13d40776a1d84207b2051346023a007f.png
的提示。
第七步:根据配置创建资源文件
第八步:https部分
yum install mod_ssl
#制作秘钥及证书
openssl req -newkey rsa:4096 -nodes -sha256 -keyout /etc/pki/tls/private/openlab.key -x509 -days 365 -out /etc/pki/tls/certs/openlab.crt
#更改配置文件
vim /etc/httpd/conf.d/vshots.conf
systemctl restart httpd
curl --insecure https://www.openlab.com/money/\n\nthis is openlab money
更改配置文件: