1.配置自签证书多域名的动态网站

1.1配置自签证书

1.1.1配置仓库

[root@apache ~]# vim /etc/yum.repos.d/epel.repo
[epel]
name=epel                  
baseurl=https://mirrors.aliyun.com/epel/9/Everything/x86_64/  
gpgcheck=0               

1.1.2安装easy-rsa工具(用于生成和管理SSL证书)

#安装easy-rsa用于生成和管理SSL证书
[root@apache ~]# yum install easy-rsa -y
#进入easy-rsa的工作目录
[root@apache ~]# cd /usr/share/easy-rsa/3.2.1/

1.1.3初始化证书目录结构

#创建pki目录及子目录,用于存放证书相关文件
[root@apache 3.2.1]# ./easyrsa init-pki

1.1.4查看初始化后的目录结构

#查看初始化后的目录结构
[root@apache 3.2.1]# tree pki/
pki/
├── inline       #存放内联格式的证书文件(证书+私钥合并文件)
├── issued       #存放已签发的服务器/客户端证书
├── private      #存放私钥文件(重要,需保密)
├── reqs         #存放证书请求文件(CSR)
└── vars.example #证书配置模板(可自定义证书默认信息)

1.1.5生成CA根证书

[root@apache 3.2.1]# ./easyrsa build-ca nopass
#输入CA的通用名称(Common Name),此处设置为jun.com(可自定义,用于标识CA)
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:jun.com

1.1.6为www.king.com生成私钥和证书请求文件

#为www.king.com生成私钥和证书请求文件
[root@apache 3.2.1]# ./easyrsa gen-req www.king.com nopass
Your files are:
* req: /usr/share/easy-rsa/3.2.1/pki/reqs/www.king.com.req  #www.king.com的证书请求
* key: /usr/share/easy-rsa/3.2.1/pki/private/www.king.com.key   #对应私钥

1.1.7为www.jeams.org生成私钥和证书请求文件

#为www.jeams.org生成私钥和证书请求文件
[root@apache 3.2.1]# ./easyrsa gen-req www.jeams.org nopass
Your files are:
* req: /usr/share/easy-rsa/3.2.1/pki/reqs/www.jeams.org.req  # www.jungle.org的证书请求
* key: /usr/share/easy-rsa/3.2.1/pki/private/www.jeams.org.key  # 对应私钥

1.1.8使用CA根证书签发www.king.com

[root@apache 3.2.1]# ./easyrsa sign-req server www.king.com
#确认证书信息,输入yes继续
Type the word 'yes' to continue, or any other input to abort.Confirm requested details: yes  #确认签发

1.1.9使用CA根证书签发www.jeams.org

[root@apache 3.2.1]# ./easyrsa sign-req server www.jeams.org
# 确认证书信息,输入yes继续
Type the word 'yes' to continue, or any other input to abort.Confirm requested details: yes  #确认签发

1.2配置虚拟主机

1.2.1安装所需软件

[root@apache ~]# yum install mod_ssl php httpd php-fpm -y

1.2.2编写配置文件

[root@apache ~]# vim  /etc/httpd/conf.d/name-php.conf
DocumentRoot /www/king
ServerName www.king.com
<directory /www/king>
DirectoryIndex index.html  #设置默认首页文件为index.html
allowoverride none         #禁止使用.htaccess文件覆盖当前配置
require all granted        #允许所有客户端访问该目录
</directory>
</virtualhost><virtualhost *:443>    #绑定443端口,HTTPS默认端口
SSLEngine on
#SSL证书相关配置
SSLCertificateFile /usr/share/easy-rsa/3.2.1/pki/issued/www.jeams.org.crt  #服务器证书文件(公钥)
SSLCertificateKeyFile /usr/share/easy-rsa/3.2.1/pki/private/www.jeams.org.key  #服务器私钥文件
SSLCACertificateFile /usr/share/easy-rsa/3.2.1/pki/ca.crt  #CA根证书(用于客户端验证服务器证书)
DocumentRoot /www/jeams
ServerName www.jeams.org
<directory /www/jeams>
DirectoryIndex index.html
allowoverride none
require all granted
</directory>
</virtualhost>

1.2.3创建目录并编写内容到文件里

[root@apache 3.2.1]# mkdir -p /www/{king,jeams}
[root@apache 3.2.1]# echo "king,this for you" > /www/king/index.html
[root@apache 3.2.1]# echo "jeams,this for you" > /www/jeams/index.html

1.2.4检测并重启

[root@apache ~]# httpd -t
Syntax OK
[root@apache ~]# systemctl restart httpd php-fpm

1.2.5测试

a.www.king.com(输入https:/www.king.com)

可以看到当前网站的上一层CA机构信息

b.www.jeams.org(输入https://www.jeams.org)

可以看到当前网站的上一层CA机构信息

2.部署http的repo仓库

2.1安装所需软件

[root@apache ~]# yum install httpd -y

2.2创建repo目录及子目录

[root@apache ~]# mkdir /repo/{rhel,centos,ubuntu,rocky,openEuler}
[root@apache ~]# tree /repo/
[root@apache ~]# mkdir /repo/rhel/{7.9,9.1}

2.3编辑配置文件

[root@apache ~]# vim /etc/httpd/conf.d/repo.conf
<directory /repo>
DirectoryIndex disabled  #禁用默认的索引文件index.html
5
options indexes followsymlinks  #indexes表示显示目录内容列表,followsymlinks表示追踪软链接
6
allowoverride none  #none表示不允许读取.htaccess文件中设置的options值,实践中不要使用.htaccess文件,会降低性能
7
require all granted  #允许所有主机通过
</directory>
<VirtualHost 192.168.75.184>  #绑定特定IP,默认使用80端口(http)DocumentRoot  /repo    #指定网站文件存放路径
</VirtualHost>

注意:做这个之前要将欢迎界面删除或改名使其失效

[root@apache ~]# mv /etc/httpd/conf.d/welcome.conf {,.bak}

2.4测试并重启

[root@apache ~]# httpd -t
Syntax OK
[root@apache ~]# systemctl restart httpd

2.5添加光盘

点击虚拟机并打开设置

点击添加光盘

点击确定

2.6挂载关盘到repo目录下所对应的文件

#将rhel9.1挂载到对应的目录
[root@apache ~]# mount /dev/sr0 /repo/rhel/9.1
#将rhel7.9挂载到对应的目录
[root@apache ~]#mount /dev/sr1 /repo/rhel/7.9
#将centos挂载到对应的目录
[root@apache ~]#mount /dev/sr2 /repo/centos/
#将ubuntu挂载到对应的目录
[root@apache ~]#mount /dev/sr3 /repo/ubuntu/
#将openEuler挂载到对应的目录
[root@apache ~]#mount /dev/sr4 /repo/openEuler/

2.7测试

2.7.1Windows端测试

在浏览器输入IP地址

2.7.2Linux端测试(rhel7上测试)

a.配置yum仓库
[root@master yum.repos.d]# vi /etc/yum.repos.d/rhel7.repo
[rhel7]
name=rhel7
baseurl=http://192.168.75.184/rhel/7.9/
gpgcheck=0
b.清除缓存
[root@master yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register.Cleaning repos: rhel7
[root@master yum.repos.d]# yum makecache
Loaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register.rhel7                                                                           | 2.8 kB  00:00:00     
(1/5): rhel7/group                                                              | 628 kB  00:00:00     
(2/5): rhel7/primary                                                            | 2.1 MB  00:00:00     
(3/5): rhel7/filelists                                                          | 3.1 MB  00:00:00     
(4/5): rhel7/group_xz                                                           |  95 kB  00:00:00     
(5/5): rhel7/other                                                              | 1.1 MB  00:00:00     
rhel7                                                                                        5230/5230
rhel7                                                                                        5230/5230
rhel7                                                                                        5230/5230
Metadata Cache Created
c.验证
[root@master yum.repos.d]# yum install httpd -y
Loaded plugins: product-id, search-disabled-repos, subscription-managerThis system is not registered with an entitlement server. You can use subscription-manager to register.Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-95.el7 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-95.el7 for package: httpd-2.4.6-95.el7.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-95.el7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-95.el7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-95.el7 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved=======================================================================================================Package                   Arch                 Version                      Repository           Size
=======================================================================================================
Installing:httpd                     x86_64               2.4.6-95.el7                 rhel7               1.2 M
Installing for dependencies:apr                       x86_64               1.4.8-7.el7                  rhel7               104 kapr-util                  x86_64               1.5.2-6.el7                  rhel7                92 khttpd-tools               x86_64               2.4.6-95.el7                 rhel7                93 kmailcap                   noarch               2.1.41-2.el7                 rhel7                31 kTransaction Summary
=======================================================================================================
Install  1 Package (+4 Dependent packages)Total download size: 1.5 M
Installed size: 4.3 M
Downloading packages:
(1/5): apr-1.4.8-7.el7.x86_64.rpm                                               | 104 kB  00:00:00     
(2/5): httpd-2.4.6-95.el7.x86_64.rpm                                            | 1.2 MB  00:00:00     
(3/5): httpd-tools-2.4.6-95.el7.x86_64.rpm                                      |  93 kB  00:00:00     
(4/5): mailcap-2.1.41-2.el7.noarch.rpm                                          |  31 kB  00:00:00     
(5/5): apr-util-1.5.2-6.el7.x86_64.rpm                                          |  92 kB  00:00:00     
-------------------------------------------------------------------------------------------------------
Total                                                                   17 MB/s | 1.5 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : apr-1.4.8-7.el7.x86_64                                                              1/5 Installing : apr-util-1.5.2-6.el7.x86_64                                                         2/5 Installing : httpd-tools-2.4.6-95.el7.x86_64                                                     3/5 Installing : mailcap-2.1.41-2.el7.noarch                                                         4/5 Installing : httpd-2.4.6-95.el7.x86_64                                                           5/5 Verifying  : httpd-tools-2.4.6-95.el7.x86_64                                                     1/5 Verifying  : mailcap-2.1.41-2.el7.noarch                                                         2/5 Verifying  : apr-1.4.8-7.el7.x86_64                                                              3/5 Verifying  : httpd-2.4.6-95.el7.x86_64                                                           4/5 Verifying  : apr-util-1.5.2-6.el7.x86_64                                                         5/5 Installed:httpd.x86_64 0:2.4.6-95.el7                                                                          Dependency Installed:apr.x86_64 0:1.4.8-7.el7        apr-util.x86_64 0:1.5.2-6.el7   httpd-tools.x86_64 0:2.4.6-95.el7  mailcap.noarch 0:2.1.41-2.el7  Complete!

3.基于nfs与yum仓库的http部署

主机IP
apache(服务端)192.168.75.184
server(客户端)192.168.75.151

3.1安装nfs-utils(服务端和客户端都要安装)

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

3.2自建yum仓库

3.2.1下载httpd及其所有依赖包

#download只下载不安装httpd软件包,--resolve是解决依赖
[root@apache ~]# yum  download  httpd --resolve --destdir /yum_repo/httpd/Packages

3.2.2查看结构

[root@apache ~]# tree  /yum_repo/httpd/
/yum_repo/httpd/
└── Packages├── apr-1.7.0-11.el9.x86_64.rpm├── apr-util-1.6.1-23.el9.x86_64.rpm├── apr-util-bdb-1.6.1-23.el9.x86_64.rpm├── apr-util-openssl-1.6.1-23.el9.x86_64.rpm├── httpd-2.4.57-5.el9.x86_64.rpm├── httpd-core-2.4.57-5.el9.x86_64.rpm├── httpd-filesystem-2.4.57-5.el9.noarch.rpm├── httpd-tools-2.4.57-5.el9.x86_64.rpm├── mod_http2-1.15.19-5.el9.x86_64.rpm├── mod_lua-2.4.57-5.el9.x86_64.rpm└── redhat-logos-httpd-90.4-2.el9.noarch.rpm
# createrepo为一堆 RPM 软件包创建一个元数据仓库(repodata/目录),使其成为一个可被 yum或 dnf包管理器识别和使用的正式软件仓库。

3.2.3安装createrepo并执行

[root@apache ~]# yum install  createrepo_c -y
[root@apache ~]# createrepo  /yum_repo/httpd/

3.2.4查看拉去到的httpd包

[root@apache ~]# tree -L 1  /yum_repo/httpd/
/yum_repo/httpd/
├── Packages
└── repodata

3.2.5编辑httpd库

[root@apache ~]# vim   /etc/yum.repos.d/httpd.repo
[httpd]
name=httpd
baseurl=file:///yum_repo/httpd
gpgcheck=0

3.2.6查看是否有Packages和repodata

[root@apache ~]# ll /yum_repo/httpd

3.3编辑配置文件并检测重启

3.3.1编辑配置文件

[root@apache ~]# vim /etc/httpd/conf.d/repo.conf
<directory /yum_repo>
DirectoryIndex disabled  #禁用默认的索引文件index.html
5
options indexes followsymlinks  #indexes表示显示目录内容列表,followsymlinks表示追踪软链接
6
allowoverride none  #none表示不允许读取.htaccess文件中设置的options值,实践中不要使用.htaccess文件,会降低性能
7
require all granted  #允许所有主机通过
</directory>
<VirtualHost 192.168.75.184:80>DocumentRoot  /yum_repo
</VirtualHost>

3.3.2检测并重启

[root@apache ~]# httpd -t
Syntax OK
[root@apache ~]# systemctl restart httpd

3.3.3在浏览器输入IP地址

注意:要将欢迎界面备份,使其失效

[root@apache ~]# mv /etc/httpd/conf.d/welcome.conf {,.bak}

3.4编辑nfs配置文件

[root@apache ~]# vim /etc/exports
/yum_repo/httpd   *(rw,sync,all_squash)各参数解释:
#*表示允许所有客户端访问
#rw:读写权限
#sync:同步模式
#all_squash:将所有访问的客户端用户映射为匿名用户

3.5重启服务(必须要先重启rpcbind在重启nfs服务)

[root@apache ~]# systemctl enable --now rpcbind
[root@apache ~]# systemctl enable --now nfs-server.service 
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.

3.6客户端查看是否收到

[root@server ~]# showmount -e 192.168.75.184
Export list for 192.168.75.184:
/yum_repo/httpd *

3.7创建文件并挂载服务端发来的文件

[root@server ~]# mkdir /httpd
[root@server ~]# mount -t nfs 192.168.75.184:/yum_repo/httpd  /httpd
[root@server ~]# cd /httpd/
[root@server httpd]# ls
Packages  repodata

3.8编写客户端yum仓库

[root@server yum.repos.d]# vim httpd.repo
[httpd]
name=httpd
baseurl=http://192.168.75.184/httpd   #httpd包所对应的路径
gpgcheck=0

3.9清除缓存

[root@server yum.repos.d]# yum makecache
正在更新 Subscription Management 软件仓库。
无法读取客户身份本系统尚未在权利服务器中注册。可使用 subscription-manager 进行注册。httpd                                                                                                                                                                            1.9 MB/s | 3.0 kB     00:00    
元数据缓存已建立。

3.10测试

[root@server yum.repos.d]# yum install httpd -y 
正在更新 Subscription Management 软件仓库。
无法读取客户身份本系统尚未在权利服务器中注册。可使用 subscription-manager 进行注册。httpd                                                                                                                                                                             62 kB/s | 1.4 kB     00:00    
依赖关系解决。
无需任何处理。
完毕!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.pswp.cn/pingmian/96369.shtml
繁体地址,请注明出处:http://hk.pswp.cn/pingmian/96369.shtml
英文地址,请注明出处:http://en.pswp.cn/pingmian/96369.shtml

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【开题答辩全过程】以 12306候补购票服务系统为例,包含答辩的问题和答案

个人简介一名14年经验的资深毕设内行人&#xff0c;语言擅长Java、php、微信小程序、Python、Golang、安卓Android等开发项目包括大数据、深度学习、网站、小程序、安卓、算法。平常会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。感谢大家的…

计算机毕业设计 基于深度学习的酒店评论文本情感分析研究 Python毕业设计项目 Hadoop毕业设计选题 机器学习选题【附源码+文档报告+安装调试】

博主介绍&#xff1a;✌从事软件开发10年之余&#xff0c;专注于Java技术领域、Python、大数据、人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&…

嵌入式第五十二天(GIC,协处理器,异常向量表)

一.GICGIC&#xff08;Generic Interrupt Controller&#xff0c;通用中断控制器&#xff09; 是ARM架构中管理系统中断的核心组件&#xff0c;负责接收、优先级排序、分发中断信号给处理器核心。其核心功能和关键版本如下&#xff1a;核心功能1. 中断接收与分发&#xff1a;接…

基于hiprint的票据定位打印系统开发实践

基于hiprint的票据定位打印系统开发实践 在日常的Web开发中&#xff0c;我们经常需要实现打印功能&#xff0c;特别是对于票据、标签等需要精确排版的打印需求。今天我将分享一个基于hiprint插件实现的票据定位打印系统&#xff0c;重点介绍如何实现单行打印、批量打印以及金额…

Android ScrollView嵌套RecyclerView 导致RecyclerView数据展示不全问题

Android RecyclerView 数据展示不全问题&#xff08;ScrollView→NestedScrollView 修复&#xff09; 一、问题核心现象 布局初始结构&#xff1a;外层用ScrollView包裹包含两个CustomBlogCardView&#xff08;内部均含RecyclerView&#xff09;的LinearLayout。 异常表现&…

AI助力数学学习,轻松掌握知识点!

小伙伴们&#xff0c;今天我们来利用AI辅助数学学习&#xff0c;将数学题目提交给AI,经过分析后给出相应的解题思路和知识点分析。现在有了AI这个"智能小老师"&#xff0c;学习变得更轻松&#xff01;只需把题目交给它&#xff0c;AI就能快速分析题目类型&#xff0c…

AI-调查研究-76-具身智能 当机器人走进生活:具身智能对就业与社会结构的深远影响

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; AI炼丹日志-31- 千呼万唤始出来 GPT-5 发布&#xff01;“快的…

机器学习、深度学习

卷积神经网络&#xff08;CNN&#xff09;vs. 循环神经网络&#xff08;RNN&#xff09;vs. Transformer 一文带你搞懂 AI Agent 开发利器&#xff1a;LangGraph 与 LangChain 区别 大语言模型&#xff1a;基于LLM的应用开发框架「LangChain」最全指南

SQL语句执行时间太慢,有什么优化措施?以及衍生的相关问题

SQL语句执行时间太慢&#xff0c;有什么优化措施&#xff1f; 可以从四个方面进行&#xff1a; 第一个是查询是否添加了索引 如果没有的话&#xff0c;为查询字段添加索引&#xff0c; 还有是否存在让索引失效的场景&#xff0c;像是没有遵循最左前缀&#xff0c;进行了一些…

QtConcurrent应用解析

目录 对比传统线程 1. QtConcurrent::run() —— 异步运行函数 2.QtConcurrent::mapped() —— 并行转换 3. QtConcurrent::filter() —— 并行过滤 4. QtConcurrent::run() QFutureWatcher —— UI 异步更新 5.线程池配置 QtConcurrent 是 Qt 框架提供的一个 高级并发编…

大疆图传十公里原理:无人机图传技术解析

大疆图传系统的核心在于把发射端的能量、机载接收的灵敏度、以及环境中的衰减因素&#xff0c;进行科学的预算与动态的修正。简单的说&#xff0c;就是通过精准的链路预算来确保在最坏环境下仍有可用的信号空间。发射功率、天线增益、空中与地面的路径损耗、接收端的噪声底线等…

jmeter 带函数压测脚本

包含时间戳获取、md5值计算、随机字符串获取<?xml version"1.0" encoding"UTF-8"?> <jmeterTestPlan version"1.2" properties"5.0" jmeter"5.6.3"><hashTree><TestPlan guiclass"TestPlanGui&…

鸿蒙app日志存储

app的pid获取 import process from @ohos.process;@Entry @Component struct MainAbility {aboutToAppear(): void {console.log(this.TAG,"pid: "+process.pid)}} 获取本应用日志 在Android中可以使用logcat --pid xxxx 获取特定进程xxxx的打印日志 在鸿蒙中也有…

02.【Linux系统编程】Linux权限(root超级用户和普通用户、创建普通用户、sudo短暂提权、权限概念、权限修改、粘滞位)

目录 1. root超级用户和普通用户 2. 创建普通用户、密码设置、切换用户 3. sudo短暂提权&#xff08;给普通用户添加sudo权限&#xff09; 4. 权限 4.1 是什么 4.2 为什么有权限&#xff1f;&#xff08;权限 角色 目标属性&#xff09; 4.2.1 角色 4.2.2 目标属性 …

阿里云可观测 2025 年 8 月产品动态

本月可观测热文回顾 文章一览&#xff1a; 零代码改造&#xff01;LoongSuite AI 采集套件观测实战 性能瓶颈定位更快更准&#xff1a;ARMS 持续剖析能力升级解析 不只是告警&#xff1a;用阿里云可观测 MCP 实现 AK 高效安全审计 金蝶云•星辰基于 SLS 构建稳定高效可观测…

绿虫零碳助手:通过电费推算用电量,确认光伏装机规模

在光伏项目开发前期&#xff0c;精准掌握用电需求与合理确定装机规模是关键环节。前者决定光伏系统需满足的用电基数&#xff0c;后者影响项目投资成本与发电收益匹配度。通过电费数据推算实际用电量&#xff0c;再结合专业工具计算光伏装机参数&#xff0c;可有效降低项目规划…

融智学:构建AI时代学术的新范式

融智学&#xff1a;构建AI时代学术新范式摘要&#xff1a;邹晓辉提出的融智学为现代学术体系困境提供系统性解决方案&#xff0c;通过"问题与价值驱动"的新范式取代传统"发表驱动"模式。该体系包含三大核心&#xff1a;哲学基础&#xff08;唯文主义、信息…

【JavaEE初阶】-- JVM

文章目录1. JVM运行流程2. Java运行时数据区2.1 方法区&#xff08;内存共享&#xff09;2.2 堆&#xff08;内存共享&#xff09;2.3 Java虚拟机栈&#xff08;线程私有&#xff09;2.4 本地方法栈&#xff08;线程私有&#xff09;2.5 程序计数器&#xff08;线程私有&#x…

第十四届蓝桥杯青少组C++选拔赛[2023.1.15]第二部分编程题(4 、移动石子)

参考程序1&#xff1a;#include <bits/stdc.h> using namespace std; int main() {int N;cin >> N;vector<int> stones(N);int sum 0;for (int i 0; i < N; i) {cin >> stones[i];sum stones[i];}int target sum / N; // 每个篮子的平均值int a…

Spring Boot 的注解是如何生效的

在 Spring 中&#xff0c;Configuration、ComponentScan、Bean、Import 等注解的扫描、解析和 BeanDefinition 注册是一个分层处理的过程。下面我们以 Configuration 类为例&#xff0c;结合代码流程详细说明其从扫描到注册的完整逻辑。 1. 整体流程概览 以下是核心步骤的流程图…