RHCE(2)

1.at 配置在5小时后,将 “This is a at task” 写入 root家目录中的at_test文件中

[root@localhost ~]# at now+1 minutes
warning: commands will be executed using /bin/sh
at> echo "This is a at task" >> at_test
at> <EOT>
job 3 at Thu Dec  2 08:31:00 2021
[root@localhost at]# date
Thu Dec  2 08:32:15 EST 2021
[root@localhost at]# more at_test

2.crontab配置,每周六,周日9点半,14点提醒我上RHCE课 写入root家目录中的cron_test文件中

[root@localhost ~]# crontab -u root -e   #编辑crontab的工作内容

在这里插入图片描述

[root@localhost ~]# crontab -u root -l   #查阅crontab的工作内容

在这里插入图片描述
3.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: “My Home Page is hello”

[root@localhost yum]# cd /etc/yum.repos.d   #配置yum源
[root@localhost yum.repos.d]# wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache 

[root@localhost yum.repos.d]# yum install httpd -y
[root@localhost html]# vim /var/www/html/index.html 
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl restart httpd   #重启服务

浏览器输入IP查看结果:
在这里插入图片描述
4.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200
并创建首页文件index.html

为ens160网卡增添两个IP
在这里插入图片描述
查看新加IP
在这里插入图片描述
编辑配置文件
在这里插入图片描述
重启服务未报错,进入浏览器查看
在这里插入图片描述


版权声明:本文为m0_51909023原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。