一、准备阶段
1.挂载
mount /dev/sr0 /mnt
2.安装httpd 和https要用到的mod_ssl
mod_ssl是一种以openssl 的工具箱为基础专门为apache webserver 提供密码保护的软件。
yum install httpd -y
yum install mod_ssl -y
3.关闭防火墙,关闭selinux
systemctl stop firewalld
setenforce 0
4.开启http服务
systemctl start httpd
二、搭建部分
1.配置http服务
根据需求更改配置文件
vim /etc/httpd/conf.d/vhosts.conf 进入配置文件
AuthType Basic #基本认证类型(账号)
AuthName “Please login:” #提示信息,双引号必须有,可以更换为其它提示信息
AuthUserFile /etc/httpd/userfile #用户认证文件的用户名和密码指定的文件所在位置
Require user song tian 指定这两个用户可以访问该服务器
2根据配置创建对应资源目录、文件
3.添加网站测