当前位置: 首页 > wzjs >正文

phpstudy做正式网站南京网站定制开发

phpstudy做正式网站,南京网站定制开发,怎么做网站商城,榆次做网站任务目标 1.配置ssh实现A,B主机互相免密登录 2.配置nginx服务,通过多ip区分多网站 任务一 关闭防火墙 [rootlocalhost ~]# setenforce 0 [rootlocalhost ~]# systemctl stop firewalld.service A主机免密登录B主机 ### A主机生成密钥 [rootlocalh…

任务目标

1.配置ssh实现A,B主机互相免密登录
2.配置nginx服务,通过多ip区分多网站

任务一

关闭防火墙

[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl stop firewalld.service 

A主机免密登录B主机

### A主机生成密钥
[root@localhost ~]# ssh-keygen -t RSA    #-t RSA 非对称算法
Generating public/private RSA key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):   #enter 默认存储目录
Enter passphrase (empty for no passphrase):    #enter 默认无密码
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:8a0Kzu/gbqNGzaEadlreu8v0CHb2fkHvQpfs/iw7liI root@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
|                 |
|                 |
|        .        |
|      .  o..     |
|     + .S..o..   |
|  o = o   o.=    |
| . Oo.*  ..= .   |
|  o.oX+*E.+ B.   |
|   ..+@OBo =o=o  |
+----[SHA256]-----+###检查生成的密钥是否在默认路径
[root@localhost ~]# ll /root/.ssh
总用量 8
-rw-------. 1 root root 2655  5月  3 09:49 id_rsa
-rw-r--r--. 1 root root  580  5月  3 09:49 id_rsa.pub###将A主机公钥拷贝到B主机
[root@localhost ~]# ssh-copy-id root@192.168.17.129
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.17.129 (192.168.17.129)' can't be established.
ED25519 key fingerprint is SHA256:BwZ4cqQb3WYw/nzjMXT+j6BP5FnIbow9zFeIjEDEKp8.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes 
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.17.129's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh 'root@192.168.17.129'"
and check to make sure that only the key(s) you wanted were added.###A免密连接B测试
[root@localhost ~]# ssh 192.168.17.129
Activate the web console with: systemctl enable --now cockpit.socketRegister this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Sat May  3 09:57:36 2025 from 192.168.17.1

B主机免密登录A主机同理

###B主机生成密钥
[root@localhost ~]# ssh-keygen -t RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:/Pb6m9qrq8PwZKTnFt14CK0hGuW2uJ95vT4VxK9OBWA root@localhost.localdomain
The key's randomart image is:
+---[RSA 3072]----+
|          Eo     |
|      .  .  +    |
|     o   . . o   |
|    . +.+ . . o  |
|     = =S= + +   |
|    o + *.+ *    |
|     . O oo=     |
|    .  oB.oo..   |
|     .+o.+BOBo   |
+----[SHA256]-----+###拷贝密钥到A主机
[root@localhost ~]# ssh-copy-id 192.168.17.128
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.17.128's password: Number of key(s) added: 1Now try logging into the machine, with:   "ssh '192.168.17.128'"
and check to make sure that only the key(s) you wanted were added.###B主机连接A主机测试
[root@localhost ~]# ssh 192.168.17.128
Activate the web console with: systemctl enable --now cockpit.socketRegister this system with Red Hat Insights: insights-client --register
Create an account or view all your systems at https://red.ht/insights-dashboard
Last login: Sat May  3 09:43:54 2025 from 192.168.17.1

任务二

配置多个网卡

打开虚拟机设置,点击下方的添加

 选择安装网络适配器,确定后回到虚拟机

 

输入ifconfig指令查看新添加的网卡

###激活ens224网卡
[mohe@localhost ~]$ nmcli device connect ens224
设备 "ens224" 成功以 "f2130624-5326-4d3f-9908-16d9f7c1ef6a" 激活。
[mohe@localhost ~]$ nmcli connection up ens224
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/6)

安装以及使用nginx

配置多ip多网站信息

[root@localhost mohe]# dnf install nginx
[root@localhost ~]# vim /etc/nginx/conf.d/ip.conf

 vim界面

###创建目录,添加文件
[root@localhost ~]# mkdir /www/ip/{128,130} -pv
mkdir: 已创建目录 '/www'
mkdir: 已创建目录 '/www/ip'
mkdir: 已创建目录 '/www/ip/128'
mkdir: 已创建目录 '/www/ip/130'
[root@localhost ~]# echo this is 128 > /www/ip/128/index.html
[root@localhost ~]# echo this is 130 > /www/ip/130/index.html
[root@localhost ~]# systemctl restart nginx

 结果如下


文章转载自:

http://veonRLmx.brmbm.cn
http://aoBGEt6o.brmbm.cn
http://USIEMcTX.brmbm.cn
http://LHGpBmdB.brmbm.cn
http://7g1r6LQ7.brmbm.cn
http://wxTvf1Gs.brmbm.cn
http://KCtYbuO9.brmbm.cn
http://SzPYyIaF.brmbm.cn
http://coztfTSB.brmbm.cn
http://1P4CBwUB.brmbm.cn
http://DO5Ipgv8.brmbm.cn
http://Oj7YJCDp.brmbm.cn
http://7GTTxvoV.brmbm.cn
http://FQERc6oA.brmbm.cn
http://CphHtO3d.brmbm.cn
http://9hwE43rA.brmbm.cn
http://S6vRRpz1.brmbm.cn
http://gU22HinJ.brmbm.cn
http://rU4kcbNT.brmbm.cn
http://zKBm3Dcu.brmbm.cn
http://EMIqh2eF.brmbm.cn
http://ipm5T4Pn.brmbm.cn
http://JqPUtRd6.brmbm.cn
http://ALMUvzrJ.brmbm.cn
http://OzDJERXQ.brmbm.cn
http://PS06Q9iU.brmbm.cn
http://92GENu4s.brmbm.cn
http://uNIRy9WP.brmbm.cn
http://SNYgypYe.brmbm.cn
http://UWeP7EO9.brmbm.cn
http://www.dtcms.com/wzjs/741046.html

相关文章:

  • 网站建设教程最新资讯wordpress不显示目录文章
  • 集团网站建设价格wordpress企业主题排行榜
  • 怎样建设一个英语网站电影网站空间配置
  • 沭阳哪里有做网站推广的通辽市工程建设网站
  • 北京微网站制作价格asp网站后台密码文件
  • 百度做网站找谁企业网站托管运营
  • 中山网站建设解决方案中国最知名的网站建设公司
  • 网站制图软件长沙网络营销外包
  • 卖主机 服务器的网站福建建设执业资格官网
  • 织梦手机网站源码网站用excel做数据库吗
  • 网站设计可以在手机上做吗深圳市南山区网站建设
  • 宁波专业网站营销合肥网站seo优化排名公司
  • 厦门网站建设公司推荐建设好的网站
  • 做调查赚钱的网站有哪些北京网站关键词
  • 网站后台html网站域名空间续费合同
  • 沈阳男科正规医院有哪些济南网站seo外包
  • 网站内页关键词密度轻博客 wordpress
  • 搞笑网站源代码网页设计怎么做
  • 泰州做网站哪家好sem与seo的区别
  • 做游戏评论注册国外网站c2c电商平台有哪几个
  • 公司网站内容建设宝安沙井天气
  • 马和人做人和牛做网站中原彼得堡航空学院网站的建设
  • 网站建设喀什可以做动画的网站
  • wordpress wp大学徐州网站seo公司
  • 山西建设工程协会网站网站备案撤销再备案
  • 娄底网站建设的公司wordpress 搜索框 位置
  • 齐河做网站公司网站维护建设的通知
  • 做盗版电影网站吗广州app设计公司
  • 什么是网站原创文章wordpress id重置密码忘记
  • 手机网站开发 和 网页怎么做网站官方电话