2021-07-27

搭建一个基于https://www.zuoye.com:22222访问的web网站,网站首页在/www/https/,内容为zuoye,可以根据https://www.zuoye.com:22222/mimi访问到的信息为mimi,该网站的实际内容在/usr/local/secret,该网站的内容只有用户xiaoming能够查看。

步骤:
1.首先挂载光盘,写yum源
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /mnt: /dev/sr0 already mounted on /run/media/root/RHEL-8-0-0-BaseOS-x86_64

[root@localhost ~]# cat /etc/yum.repos.d/base.repo
[BaseOS]
name=BaseOS
baseurl=file:///mnt/BaseOS
gpgcheck=0
[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0

2、安装httpd 、mod_ssl包
yum install httpd -y
yum install mod_ssl -y

3、切换到/etc/pki/tls/certs/目录下
[root@localhost ~]# cd /etc/pki/tls/certs/
在这里插入图片描述

利用rz安装Makefile
先安装rz包
[root@localhost certs]# yum install lrzsz -y

使用make命令给自己颁发证书
若无make 先安装make包
[root@localhost certs]# rpm -q make

[root@localhost certs]# make zhengshu.crt
e is 65537 (0x010001)
Enter pass phrase:
Verifying - Enter pass phrase:
umask 77 ;
/usr/bin/openssl req -utf8 -new -key zhengshu.key -x509 -days 365 -out zhengshu.crt -set_serial 0
Enter pass phrase for zhengshu.key:
Country Name (2 letter code) [XX]:cn
State or Province Name (full name) []:sx
Locality Name (eg, city) [Default City]:xian
Organization Name (eg, company) [Default Company Ltd]:open
Organizational Unit Name (eg, section) []:ce
Common Name (eg, your name or your server’s hostname) []:www.zuoye.com
Email Address []:admin@open.com

4、编辑配置文件
cd /etc/httpd/conf.d/
vim host-zhengshu.conf

5、在Linux的/etc/hosts 下写域名解析

在windows的C:\Windows\System32\drivers\etc\hosts下写域名解析

6、创建目录 ,写网页内容
[root@localhost conf.d]# mkdir /www/https
[root@localhost conf.d]# echo zuoye > /www/https/index.html

7、新建用户
8、创建目录,写网页内容

9、关闭防火墙,selinux,重启httpd服务
systemctl stop firewalld
systemctl restart httpd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值