综合练习:请给openlab搭建web网站
网站需求:
1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!
2.给该公司创建三个虚拟网站目录分别显示学生信息,教学资料和缴费网站,
基于www.openlab.com/student 网站访问学生信息,
www.openlab.com/data 网站访问教学资料
www.openlab.com/money 网站访问缴费网站。
3.要求
(1)学生信息网站只有song和tian两人可以访问,其他网站所有用户用能访问。
(2)访问缴费网站实现数据加密基于https访问。
1、挂载
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
mount: /dev/sr0 is already mounted or /mnt busy/dev/sr0 is already mounted on /run/media/zhangwen/RHEL-7.2 Server.x86_64/dev/sr0 is already mounted on /mnt
2、
[root@localhost ~]# systemctl stop firewalld ------ 关闭防火墙[root@localhost ~]# setenforce 0-------关闭selinux修改主配置文件httpd.conf
ServerName 0.0.0.0:80
3、 安装http、 安装ssl认证服务
[root@localhost ~]# yum install httpd
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package httpd-2.4.6-40.el7.x86_64 already installed and latest version
Nothing to do[root@localhost ~]# yum install mod_ssl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:mod_ssl-2.4.6-40.el7.x86_64 already installed and latest version
Nothing to do
4、本地源配置文件
5、将ssl.conf配置文件中的以下内容复制到辅助配置文件中 : /ssl.conf
6、编辑辅助配置文件
7、创建目录
8、编辑index.html文件
9、编辑hosts文件
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.44.131 www.openlab.com
10、创建用户
11、添加证书文件
12、编辑windows中hosts文件
13、重启httpd服务
14、查看httpd状态
15 、 测试
[root@localhost ~]# curl http://192.168.44.131
welcome to openlab!
关注我的微信公众号:hello521day ,大量网络,渗透、编程资料以及ppt等模板等你来取!