综合练习:请给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访问。
1.关闭防火墙和selinux
[root@localhost~ ]# systemctl disable --now firewalld
[root@localhost~ ]# setenforce 0
2.创建目录和index.html文件
3.创建用户
[root@localhost ~]# htpasswd -c /etc/httpd/users song
New password:
Re-type new password:
[root@localhost ~]# htpasswd /etc/httpd/users tian
New password:
Re-type new password:
Adding password for user tian
4.安装ssl,生成证书
root@localhost ~]# yum install mod_ssl
vim /etc/httpd/conf.d/vhosts.conf
openssl req -newkey rsa:4096 -keyout /etc/pki/tls/private/openlab.key -x509 -days 365 -out /etc/pki/tls/certs/openlab.crt
5. 写配置文件(在/etc/httpd/conf.d/)
6.手动建立连接
vim /etc/hosts
重启:[root@localhost ~]#systemctl restart httpd
7.开始测试