(RHCE)Linux第二次作业+第三作业

1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!!

1.安装

[root@redhot ~]# mount /dev/sr0 /mnt
mount: /mnt: WARNING: source write-protected, mounted read-only.

[root@redhot ~]# vim /etc/yum.repos.d/bsae.repo

使用“i”指令进入插入模式

输入 yum install httpd -y

按esc返回,指令“:wq”保存并返回
ps:出现以下错误 httpd安装错误问题

原因:没有配置yum仓库

0.1.创建并打开yum.repos.d/redhat.repo文件
[root@redhot ~]# vim /etc/yum.repos.d/redhat.repo
0.2.写入内容
0.3.安装httpd软件包
[root@redhot ~]# yum install httpd -y

此时yum仓库已配置及httpd已安装

2.关闭防火墙

在操作台输入

systemctl stop firewalld.service

setenforce 0

3.安装nginx

yum stall nginx -y
安装完毕后如下图

#重启nginx
[root@redhot ~]# systemctl restart nginx

4.修改配置文件

#进入修改界面
vim /etc/nginx/conf.d/test_name.conf

5.创建网页目录

6.进入网页编写界面,写入“ welcome to openlab!!!”


vim /www/name/node1/index.html

welcome to openlab!!!

7.使用域名登录

#在C:\Windows\System32\drivers\etc\hosts中写入域名

192.168.36.128 www.openlab.com

#重启网络服务
systemctl restart nginx

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

#创建目录并写入内容
mkdir /www/openlab/student -pv
mkdir /www/openlab/data -pv
mkdir /www/openlab/momey -pv
echo this is student > /www/openlab/student/index.html
echo this is data > /www/openlab/data/index.html
echo this is money > /www/openlab/money/index.html

#创建用户
htpasswd -c /etc/nginx/user song
htpasswd -c /etc/nginx/user tian


3.要求 (1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。

​ (2)访问缴费网站实现数据加密基于https访问。

#下载mod_ssl
yum install mod_ssl -y
 
cd /etc/pki/tls/private/
openssl genrsa -aes128 2048 > money.key

#在/etc/pki/tls/certs目录新建证书
cd /etc/pki/tls/certs/

Enter PEM pass phrase:
802BE9F8B47F0000:error:14000065:UI routines:UI_set_result_ex:result too small:crypto/ui/ui_lib.c:884:You must type in 4 to 1024 characters
802BE9F8B47F0000:error:1400006B:UI routines:UI_process:processing error:crypto/ui/ui_lib.c:544:while reading strings
802BE9F8B47F0000:error:0480006D:PEM routines:PEM_def_callback:problems getting password:crypto/pem/pem_lib.c:62:
802BE9F8B47F0000:error:07880109:common libcrypto routines:do_ui_passphrase:interrupted or cancelled:crypto/passphrase.c:184:
802BE9F8B47F0000:error:1C80009F:Provider routines:p8info_to_encp8:unable to get passphrase:providers/implementations/encode_decode/encode_key2any.c:116:


4.架设一台NFS服务器,并按照以下要求配置
1、开放/nfs/shared目录,供所有用户查询资料
2、开放/nfs/upload目录,为192.168.xxx.0/24网段主机可以上传目录,
并将所有用户及所属的组映射为nfs-upload,其UID和GID均为210
3、将/home/tom目录仅共享给192.168.xxx.xxx这台主机,并只有用户tom可以完全访问该目录

1.关闭防火墙

systemctl stop firewalld.service

setenforce 0

2.安装服务程序并重启

[root@localhost ~]# yum install nfs-utils rpcbind -y    

[root@redhot ~]# systemctl restart nfs-utils rpcbind

3.按要求创建目录

4.配置题目内容

至此配置完成

  • 12
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值