RHCE_3

实验要求

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访问。
一.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!

首先恢复快照,关闭安全软件
1.安装所需软件
 yum install nginx httpd-tools -y
2.进行Linux下的域名解析
vim /etc/hosts
打开后添加内容 192.168.87.131 www.openlab.com
3.创建www.openlab.com 网站及网页目录
mkdir -p /www/openlab
echo 'welcom to openlab...' > /www/openlab/index.html
4.打开/etc/nginx/nginx.conf
vim /etc/nginx/nginx.conf
然后定位server段改参数如下所示5.重启服务
 systemctl start nginx

6、在Windows端打开浏览器输入网址测试

二.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料www.openlab.com/money网站访问缴费网站

(一)1.创建教学资料子网站www.openlab.com/data并在data网页中显示data
mkdir /www/openlab/data  #创建data文件夹
echo 'data' > /www/openlab/data/index.html  #在网页中显示data
2.打开/etc/nginx/nginx.conf  接着之前的往下写3.重启服务
systemctl restart nginx
然后打开浏览器输入www.openlab.com、data测试

(二)

1.创建教学资料子网站www.openlab.com/student
mkdir /www/openlab/student   #创建student目录
echo 'student' > /www/openlab/student/index.html #在student网页中显示student
2.创建用户song和tian
useradd song      #创建用户song和tian
 
passwd song         #输入密码123456
useradd tian
 
passwd tian         #输入密码654321
 
htpasswd -c /etc/nginx/passwd song # 密码123456
 
htpasswd /etc/nginx/passwd tian     #密码654321
3.打开vim /etc/nginx.conf
vim /etc/nginx.conf

4.重启服务
systemctl restart nginx

(三)

1.创建教学资料子网站www.openlab.com/money
mkdir /www/openlab/money
echo 'money' > /www/openlab/money/index.html
2在/etc/nginx目录下制作整数所用的私钥文件zy.key 
openssl genrsa -aes128 2048 > /etc/nginx/money.key
[root@server ~]# openssl req -utf8 -new -key /etc/nginx/money.key -x509 -days 365 -out /etc/nginx/money.crt         # 制作证书
Enter pass phrase for /etc/nginx/money.key:                 #需要输入加密私钥的密码
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:86     # 国家代码
State or Province Name (full name) [Some-State]:chongqing                    # 省份
Locality Name (eg, city) []:chongqing                # 城市
Organization Name (eg, company) [Internet Widgits Pty Ltd]:openlab        # 公司
Organizational Unit Name (eg, section) []:RHCE           # 部门
Common Name (e.g. server FQDN or YOUR name) []:server         # 主机名
Email Address []:money@qq.com           # 邮箱
[root@server ~]# cd /etc/nginx    #切换目录
[root@server nginx]# cp money.key money.key.org    #copy秘钥
[root@server nginx]# openssl rsa -in money.key.org -out money.key
Enter pass phrase for money.key.org:                # 输 入私钥密码
3.进入/etc/nginx/nginx.conf
vim /etc/nginx/nginx.conf

4.重启服务
systemctl restart nginx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值