1、配置ssh免密登陆:客户端主机通过redhat用户基于秘钥验证方式进行远程连接服务器的root用户。
2、综合练习:请给openlab搭建web网站
网站需求: 1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!! 2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料,www.openlab.com/money网站访问缴费网站。
3、配置dns服务的正向解析
1
[root@localhost ~]# su -test
[yaohui@localhost ~]$ ssh-keygen
Generating public/private rsa key pair
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in hui.
Your public key has been saved in hui.pub.
The key fingerprint is:
SHA256:GDSz79UdNErUkI09pFEQevTMiDxpWCLKIQV53Ci1J9c yaohui@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
| o*+o= . ..O%= |
| oo+=.* = *oX=. |
| o= = E B = =. |
| + + . + . . |
| . S . . . |
| . . |
| . |
| |
| |
+----[SHA256]-----+
[yaohui@localhost ~]$ su -
密码:
[redhat@localhost ~]$ ssh-copy-id root@192.168.32.141
[redhat@localhost ~]$ ssh 'root@192.168.32.141'
2.
[root@localhost /]# vim /etc/httpd/conf.d/vhosts.conf
<virtualhost 192.168.122.1:80>
servername www.openlab.com
documentroot /var/www/openlab
</virtualhost>
<directory /var/www/openlab>
allowoverride none
require all granted
</directory>
[root@localhost /]# systemctl restart httpd
[root@localhost /]# setenforce 0
[root@localhost /]# systemctl stop firewalld
[root@localhost /]# mkdir /var/www/openlab
[root@localhost /]# echo welcome to openlab > /var/www/openlab/index.html
[root@localhost /]#
[root@localhost /]# vim /etc/hosts
0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.122.1 www.openlab.com
[root@localhost /]# curl www.openlab.com
welcome to openlab
@localhost /]# mkdir /var/www/openlab/{student,data,money}
[root@localhost /]# echo 这是学生信息网站 > /var/www/openlab/student/index.html
[root@localhost /]# echo 这是教学资料网站 > /var/www/openlab/data/index.html
[root@localhost /]# echo 这是缴费网站 > /var/www/openlab/money/index.html
[root@localhost /]# curl www.openlab.com/data/
这是教学资料网站
3.