Files
rxthinkcmf-wiki/RXThinkCMF_ThinkPhp8_EleVue/.vitepress/dist/assets/zh_deploy_env-plan.md.DRKpus9J.lean.js
T
2026-10-25 18:52:36 +08:00

28 lines
7.0 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as t,o as s,c as n,a2 as e}from"./chunks/framework.B-QBKwc1.js";const b=JSON.parse('{"title":"环境规划","description":"本节提供不同规模项目的服务器配置建议和环境规划方案。","frontmatter":{},"headers":[],"relativePath":"zh/deploy/env-plan.md","filePath":"zh/deploy/env-plan.md"}'),d={name:"zh/deploy/env-plan.md"};function p(l,a,i,r,o,c){return s(),n("div",null,[...a[0]||(a[0]=[e(`<h1 id="_11-2-环境规划" tabindex="-1">11.2 环境规划 <a class="header-anchor" href="#_11-2-环境规划" aria-label="Permalink to &quot;11.2 环境规划&quot;">​</a></h1><div class="tip custom-block"><p class="custom-block-title">概述</p><p>本节提供不同规模项目的服务器配置建议和环境规划方案。</p></div><h2 id="推荐配置" tabindex="-1">推荐配置 <a class="header-anchor" href="#推荐配置" aria-label="Permalink to &quot;推荐配置&quot;">​</a></h2><table tabindex="0"><thead><tr><th>组件</th><th>版本</th><th>说明</th></tr></thead><tbody><tr><td>PHP</td><td>8.2+</td><td>必需</td></tr><tr><td>MySQL</td><td>8.0+</td><td>主数据库(也支持 PostgreSQL、SQL Server、Oracle、SQLite)</td></tr><tr><td>Redis</td><td>6.0+</td><td>缓存(可选,推荐)</td></tr><tr><td>Nginx</td><td>1.18+</td><td>Web 服务器</td></tr><tr><td>Node.js</td><td>22+</td><td>前端构建</td></tr><tr><td>Composer</td><td>2.x</td><td>PHP 依赖</td></tr><tr><td>pnpm</td><td>12+</td><td>前端依赖</td></tr></tbody></table><h2 id="服务器配置建议" tabindex="-1">服务器配置建议 <a class="header-anchor" href="#服务器配置建议" aria-label="Permalink to &quot;服务器配置建议&quot;">​</a></h2><table tabindex="0"><thead><tr><th>规模</th><th>CPU</th><th>内存</th><th>磁盘</th><th>说明</th></tr></thead><tbody><tr><td>小型</td><td>2核</td><td>4GB</td><td>50GB</td><td>单机部署,日活 &lt; 1000</td></tr><tr><td>中型</td><td>4核</td><td>8GB</td><td>100GB</td><td>单机部署,日活 1000~10000</td></tr><tr><td>大型</td><td>8核+</td><td>16GB+</td><td>200GB+</td><td>分离部署,日活 &gt; 10000</td></tr></tbody></table><h2 id="部署架构" tabindex="-1">部署架构 <a class="header-anchor" href="#部署架构" aria-label="Permalink to &quot;部署架构&quot;">​</a></h2><h3 id="小型项目-单机-" tabindex="-1">小型项目(单机) <a class="header-anchor" href="#小型项目-单机-" aria-label="Permalink to &quot;小型项目(单机)&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span>┌─────────────────────────────┐</span></span>
<span class="line"><span>│ 单台服务器 │</span></span>
<span class="line"><span>│ │</span></span>
<span class="line"><span>│ Nginx + PHP-FPM + MySQL │</span></span>
<span class="line"><span>│ + Redis(可选) │</span></span>
<span class="line"><span>│ + 前端静态文件 │</span></span>
<span class="line"><span>└─────────────────────────────┘</span></span></code></pre></div><h3 id="中型项目-单机优化-" tabindex="-1">中型项目(单机优化) <a class="header-anchor" href="#中型项目-单机优化-" aria-label="Permalink to &quot;中型项目(单机优化)&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span>┌─────────────────────────────┐</span></span>
<span class="line"><span>│ 单台服务器 │</span></span>
<span class="line"><span>│ │</span></span>
<span class="line"><span>│ Nginx(前端 + API 代理) │</span></span>
<span class="line"><span>│ PHP-FPM(多进程) │</span></span>
<span class="line"><span>│ MySQL(主库) │</span></span>
<span class="line"><span>│ Redis(缓存) │</span></span>
<span class="line"><span>│ Supervisor(进程管理) │</span></span>
<span class="line"><span>└─────────────────────────────┘</span></span></code></pre></div><h3 id="大型项目-分离部署-" tabindex="-1">大型项目(分离部署) <a class="header-anchor" href="#大型项目-分离部署-" aria-label="Permalink to &quot;大型项目(分离部署)&quot;">​</a></h3><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes dracula-soft vitesse-light vp-code" tabindex="0"><code><span class="line"><span>┌──────────┐ ┌──────────┐ ┌──────────┐</span></span>
<span class="line"><span>│ Nginx │ │ Nginx │ │ Nginx │</span></span>
<span class="line"><span>│ 前端CDN │ │ API-1 │ │ API-2 │</span></span>
<span class="line"><span>└──────────┘ └──────────┘ └──────────┘</span></span>
<span class="line"><span> │ │</span></span>
<span class="line"><span> └──────┬───────┘</span></span>
<span class="line"><span> │</span></span>
<span class="line"><span> ┌──────┴──────┐</span></span>
<span class="line"><span> ▼ ▼</span></span>
<span class="line"><span> ┌──────────┐ ┌──────────┐</span></span>
<span class="line"><span> │ MySQL │ │ Redis │</span></span>
<span class="line"><span> │ 主从 │ │ 集群 │</span></span>
<span class="line"><span> └──────────┘ └──────────┘</span></span></code></pre></div><h2 id="环境变量规划" tabindex="-1">环境变量规划 <a class="header-anchor" href="#环境变量规划" aria-label="Permalink to &quot;环境变量规划&quot;">​</a></h2><table tabindex="0"><thead><tr><th>环境</th><th>APP_DEBUG</th><th>CACHE.DRIVER</th><th>JWT.SECRET</th><th>CORS.ALLOW_ORIGIN</th></tr></thead><tbody><tr><td>开发</td><td>true</td><td>file</td><td>开发密钥</td><td>*</td></tr><tr><td>测试</td><td>true</td><td>file</td><td>测试密钥</td><td>*</td></tr><tr><td>生产</td><td>false</td><td>redis</td><td>强随机密钥</td><td>指定域名</td></tr></tbody></table>`,15)])])}const u=t(d,[["render",p]]);export{b as __pageData,u as default};