CE配置练习

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

作业1
[root@localhost ~]# at now + 5 hours 
warning: commands will be executed using /bin/sh
at> echo"This is a at task">/root/at_test
at> <EOT>
[root@localhost ~]# atq
4	Sat Nov 27 11:17:00 2021 a root

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

作业2:
[root@localhost etc]# crontab -e
30 9 * * 6-7 root ehco"记得上RHCE课">>/root/cron_test
0 14 * * 6-7 root echo"记得上RHCE课">>/root/cron_test

3.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello" 

第三题
[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 intall httpd -y
[root@localhost yum.repos.d]# rpm -ql httpd
[root@localhost yum.repos.d]# systemctl stop firewalld
[root@localhost yum.repos.d]# setenforce 0
[root@localhost yum.repos.d]# cd /var/www/html
[root@localhost html]# vim hello.html 
     "My Home Page is hello"
[root@localhost html]# cd /etc/httpd/conf.d
[root@localhost conf.d]# ls
autoindex.conf  host.conf  README  userdir.conf  welcome.conf
[root@localhost conf.d]# vim welcome.conf 
修改为Alias /.noindex.html /usr/share/httpd/noindex/hello.html
[root@localhost html]# cd /etc/httpd/conf
[root@localhost conf]# vim httpd.conf 
    DirectoryIndex hello.html
[root@localhost conf]# systemctl restart httpd

 4.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200,并创建首页文件index.html 

[root@localhost ~]#nmcli connection modify eno160 +ipv4.addresses 192.168.126.100/24 ipv4.gateway 192.168.126.1 ipv4.method manual connection.autoconnect yes
[root@localhost ~]# nmcli connection modify eno160 +ipv4.addresses 192.168.126.200/24
[root@localhost ~]# nmcli connection up eno160
[root@localhost ~]# mkdir -pv /www/ip/{100,200}
[root@localhost ~]# echo this is 100 > /www/ip/100/index.html
[root@localhost ~]# echo this is 200 > /www/ip/200/index.html
[root@server html]# setenforce 0
[root@server html]# getenforce 
[root@localhost ~]# vim /etc/httpd/conf.d/host.conf
    <Directory "/www/ip">
    AllowOverride None
    Require all granted
    </Directory>

    #Listen 80
    <VirtualHost 192.168.220.100:80>
    DocumentRoot /www/ip/100
    ServerName 192.168.220.100
    </VirtualHost>

    #Listen 80
    <VirtualHost 192.168.220.200:80>
    DocumentRoot /www/ip/200
    ServerName 192.168.220.200
    </VirtualHost>
[root@localhost conf.d]# systemctl restart httpd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值