<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WordPress服务器排障 &#8211; 外贸服务器代维护工作室</title>
	<atom:link href="https://www.fuwuqi120.com/tag/wordpress%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%8e%92%e9%9a%9c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fuwuqi120.com</link>
	<description>｜外贸网站服务器代维：阿里云 ECS、AWS EC2、Linux、宝塔面板、WordPress 独立站托管与排障。</description>
	<lastBuildDate>Tue, 24 Nov 2026 16:47:07 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>宝塔面板命令：外贸站排障实操</title>
		<link>https://www.fuwuqi120.com/%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e6%8e%92%e9%9a%9c%e5%ae%9e%e6%93%8d/</link>
					<comments>https://www.fuwuqi120.com/%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e6%8e%92%e9%9a%9c%e5%ae%9e%e6%93%8d/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 24 Nov 2026 16:47:07 +0000</pubDate>
				<category><![CDATA[linux服务器代维]]></category>
		<category><![CDATA[bt命令]]></category>
		<category><![CDATA[WordPress服务器排障]]></category>
		<category><![CDATA[外贸独立站打不开]]></category>
		<category><![CDATA[宝塔面板命令]]></category>
		<guid isPermaLink="false">https://www.fuwuqi120.com/%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e6%8e%92%e9%9a%9c%e5%ae%9e%e6%93%8d/</guid>

					<description><![CDATA[宝塔面板命令就是服务器上的 bt 工具，用来查入口、改密码、重启服务、看端口。外贸站打不开时，先用 SSH 跑一遍，比等面板加载快。]]></description>
										<content:encoded><![CDATA[<div class="fuwuqi120-answer">
<p><strong>一句话答案：</strong><a href="https://www.fuwuqi120.com/tag/%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf/">宝塔面板</a>命令就是服务器上的 bt 工具，用来查入口、改密码、重启服务、看端口。外贸站打不开时，先用 SSH 跑一遍，比等面板加载快。</p>
</div>
<div class="fuwuqi120-toc">
<p><strong>本文目录</strong></p>
<ol>
<li><a href="#fuwuqi120-h2-1">先说清楚：bt 不是网页面板本身</a></li>
<li><a href="#fuwuqi120-h2-2">30 秒判断：面板、Nginx、PHP 谁挂了</a></li>
<li><a href="#fuwuqi120-h2-3">常用命令块：查入口、改密码、重启</a></li>
<li><a href="#fuwuqi120-h2-4">海外访问慢时，命令只能帮你排除一半</a></li>
<li><a href="#fuwuqi120-h2-5">迁移和备份：命令跑完还要验文件属主</a></li>
<li><a href="#fuwuqi120-h2-6">注意什么：别把 bt 当万能钥匙</a></li>
</ol>
</div>
<h2 id="fuwuqi120-h2-1">先说清楚：bt 不是网页面板本身</h2>
<p><strong>bt 是 SSH 里的运维工具，不是浏览器里那个网页面板。</strong>两者装在同一台机器，但入口完全分开。</p>
<p>我说的宝塔面板命令，指的是 <code>/etc/init.d/bt</code> 这个服务脚本，以及敲 <code>bt</code> 后弹出的交互菜单。CentOS 7、Ubuntu 20.04 / 22.04 上我都常跑，宝塔 7.9.x 到 8.x 都见过，菜单编号略有出入，1 到 16 那几项基本没变。网页面板是 Python 起的 Web 进程，走 8888；bt 命令走的是 shell，不依赖那个 Web 进程活着。</p>
<p>外贸站最常碰到的场景是：欧美客户前台还能开，运营想进后台改个运费模板，8888 一直转圈。或者阿里云 ECS 香港节点刚迁完，安全组忘了放 8888，面板直接超时。这时候别刷新浏览器。SSH 还能进，就先用命令查入口、改密码、重启服务，比等图形界面加载快得多。<a href="https://www.fuwuqi120.com/tag/aws-ec2/">AWS EC2</a> 新加坡节点一样适用，只是那边叫 Security Group，不叫安全组，名字不同，拦的效果一样。</p>
<p>我接过的外贸独立站里，约三成「面板打不开」根本不是面板坏了。要么是 2G 内存的实例被 MySQL + PHP-FPM 吃满，要么是 8888 没放行。这个坑我早年踩过，白重装了一次环境，WordPress 产品表还差点没导回来。</p>
<p>30 秒先判断，在<strong>出问题的那台服务器</strong>、用 <strong>root</strong> 执行：</p>
<pre><code>free -m
ss -lntp | grep 8888
/etc/init.d/bt status
bt 14</code></pre>
<p>第一行看内存还剩多少，第二行看 8888 有没有在听，第三行看面板服务状态，<code>bt 14</code> 直接把当前入口地址和安全入口打印出来。四项跑完，基本能分清是资源、端口还是服务本身。</p>
<ul>
<li><strong>内存剩不到 100 MB</strong>：先别重启面板，重启只会再卡一次。查 <code>ps aux --sort=-%mem | head -10</code>，多半是 PHP-FPM 子进程开多了，2G 机我一般压到 <code>pm.max_children = 8</code>。</li>
<li><strong>8888 没监听</strong>：跑 <code>/etc/init.d/bt restart</code>，再 <code>bt 14</code> 拿入口。</li>
<li><strong>本机监听正常、外面打不开</strong>：去控制台放行 TCP 8888。阿里云 ECS 香港在「安全组」入方向加，AWS EC2 新加坡在 Security Group 的 Inbound rules 加，来源 IP 建议只放运营办公网，别写 <code>0.0.0.0/0</code>。</li>
<li><strong>海外后台转圈但前台正常</strong>：大概率是安全入口带随机路径 + 跨运营商链路丢包，<code>bt 8</code> 改个短一点的入口，或干脆临时用 <code>bt 5</code> 改密码后从 SSH 隧道进。</li>
</ul>
<table>
<tr>
<th>位置</th>
<th>叫什么</th>
<th>谁在管</th>
</tr>
<tr>
<td>浏览器 8888</td>
<td>网页面板</td>
<td>bt 起的 Web 进程，吃内存</td>
</tr>
<tr>
<td>SSH 里敲 bt</td>
<td>交互菜单</td>
<td>shell 脚本，Web 挂了照样能跑</td>
</tr>
<tr>
<td>阿里云 ECS 香港</td>
<td>安全组</td>
<td>入方向规则</td>
</tr>
<tr>
<td>AWS EC2 新加坡</td>
<td>Security Group</td>
<td>Inbound rules</td>
</tr>
</table>
<p>改完端口规则不用重启实例，等 10 到 30 秒再试。东南亚线路到新加坡节点通常比欧美绕香港快一截，但后台登录慢和线路关系不大，先按上面四条排，别一上来就怀疑被黑。</p>
<h2 id="fuwuqi120-h2-2">30 秒判断：面板、Nginx、PHP 谁挂了</h2>
<p>先查端口和进程，别动重装。30 秒就能分清是面板、Nginx 还是 PHP 掉线。</p>
<p>我处理<a href="https://www.fuwuqi120.com/tag/%e5%a4%96%e8%b4%b8%e7%8b%ac%e7%ab%8b%e7%ab%99%e5%ae%95%e6%9c%ba/">外贸独立站宕机</a>，最怕老板一急就点「重装面板」。去年一个做汽配出口的站，欧美客户全白屏，运营差点重置宝塔，结果只是 php-fpm 7.4 被 OOM 杀了。重装完数据库配置、SSL 证书路径、伪静态全得重配，多停 2 小时。执行位置固定：<strong>目标 ECS / EC2 本机</strong>，身份 root，或者先 <code>sudo -i</code> 再跑。别在本地电脑、别在跳板机上敲。</p>
<p>下面这一段直接复制，一次看完 8888、80、443 和 php-fpm。阿里云 ECS 和 AWS EC2 都通用，CentOS 7 / Ubuntu 20.04 / 22.04 我都跑过。</p>
<pre><code># 目标 ECS/EC2，root 身份（或先执行 sudo -i）
ss -lntp | egrep ':(8888|80|443)s' || echo "NO_PANEL_OR_WEB_PORT"
ps -ef | egrep 'nginx|php-fpm' | grep -v grep
bt status
systemctl is-active nginx 2&gt;/dev/null || service nginx status
tail -n 20 /www/wwwlogs/nginx_error.log 2&gt;/dev/null
</code></pre>
<p>看输出按这张表对，不用猜：</p>
<table>
<tr>
<th>看到什么</th>
<th>判断</th>
<th>下一步</th>
</tr>
<tr>
<td>8888 在监听，Nginx active</td>
<td>面板和 Web 层都没挂</td>
<td>问题多半在 WordPress 插件或 MySQL，去查 <code>/www/wwwroot/域名/wp-content/debug.log</code> 和数据库进程</td>
</tr>
<tr>
<td>80/443 没了，Nginx 没跑</td>
<td>Web 层直接掉了</td>
<td>别碰面板，直接翻上面那条 <code>nginx_error.log</code>，常见是证书路径改错或 443 被别的服务占了</td>
</tr>
<tr>
<td>端口全在，但 php-fpm 进程为空</td>
<td>PHP 挂了，页面会 502 或白屏</td>
<td><code>bt restart php</code> 或按版本 <code>systemctl restart php-fpm-74</code></td>
</tr>
<tr>
<td>8888 都不返回</td>
<td>才是面板服务本身的问题</td>
<td>这时候才用 <code>bt restart</code>，仍然别重装</td>
</tr>
</table>
<ul>
<li><strong>能返回 8888 且 Nginx 在跑</strong>，就别再折腾服务器层了。我一般会直接开站点前台看是 500 还是「建立数据库连接时出错」，前者查插件，后者查 <code>mysql</code> 是否活着。</li>
<li><strong>Nginx 没跑</strong>，error_log 最后 20 行基本够用。见过最多的是迁移站时把 <code>/www/server/panel/vhost/cert/</code> 下旧证书删了，Nginx 起不来，欧美客户连 TLS 握手都过不去。</li>
<li>端口都正常、页面也慢，先别归到服务器。跨境链路的问题比本机多。</li>
</ul>
<p>有个动作顺手做掉：<strong>欧美客户打不开、东南亚却能开的时候，记下具体时间，精确到分钟，带时区</strong>。比如「2024-11-06 09:42 UTC+0，德国打不开，新加坡正常」。后面查 CDN 回源节点、DNS 解析生效记录，全靠这个时间点去对日志。我一般直接贴一条进工单：</p>
<pre><code># 目标 ECS/EC2，root 身份
date -u '+%Y-%m-%d %H:%M UTC' | tee -a /root/outage_note.txt
curl -s -o /dev/null -w 'local_https=%{http_code} time=%{time_total}sn' https://127.0.0.1 -k
</code></pre>
<p>这条 <code>curl -k</code> 是绕开证书校验打本机回环，能出 200 就说明本机 Web 层没死，慢或者打不开在回源和解析那段。时间记下来，别凭记忆写「上午十点左右」，CDN 厂商拉日志只认 UTC 时间戳。至于面板密码、改入口那些，是后面的事，这一节先不动。</p>
<h2 id="fuwuqi120-h2-3">常用命令块：查入口、改密码、重启</h2>
<p>先跑 <strong>bt</strong> 看菜单，再按编号操作，别背死数字。</p>
<p>我迁移完 WordPress 独立站，不管是从阿里云 ECS 迁到 AWS EC2，还是换到欧美机房，这三步必跑：确认面板入口、临时改密码、重载 Web 服务。原因很实际。迁移后安全组、弹性 IP、Nginx 配置常会变，海外客户那边可能已经打不开了，面板还在转圈等登录态。SSH 里敲命令，2 秒出结果，不用等浏览器。</p>
<p>宝塔 8.0 之后菜单编号会漂。我踩过这个坑，旧笔记里写「5 改密码、14 重启」，到一台 8.0.5 的机器上按 5 直接进了别的功能。别猜。先 <code>bt</code> 回车，看当前列表里「修改面板密码」「重启面板」「重载 Web 服务」各自是几，再按那个数字选。</p>
<p>下面全部在<strong>目标服务器</strong>、<strong>root 身份</strong>执行。先 SSH 上去，别在本地电脑或跳板机上跑。</p>
<pre><code># 目标服务器 / root
ssh root@服务器公网IP
bt
</code></pre>
<p>菜单出来后，按看到的编号继续。常见顺序大概是这几类，具体以 <code>bt</code> 输出为准：</p>
<ul>
<li><strong>查入口</strong>：选「查看面板入口 / 默认信息」，会给出带安全入口的路径，例如 <code>https://IP:8888/xxxxxx</code>。迁移后旧入口经常失效，拿这个发给运营，别让他们翻历史聊天记录。</li>
<li><strong>改密码</strong>：选「修改面板密码」，我一般临时设成 16 位随机串，进面板后再交给密码管理器。外贸站后台常被多人共管，迁移窗口最容易出现旧密码还在用。</li>
<li><strong>重载 Web</strong>：选「重启 Nginx / 重载 Web 服务」。换过 PHP 版本（比如 7.4 切 8.1）或改过伪静态后，不重载，欧美客户看到的还是 502。</li>
</ul>
<p>命令块放这，编号用变量占位，跑之前把 <code>bt</code> 列表对一遍：</p>
<pre><code># 目标服务器 / root：看当前菜单和入口信息
bt

# 目标服务器 / root：按上一步看到的编号，例如输入 5 只是示例
bt
# 出现 "请输入命令编号" 后键入实际编号，回车

# 目标服务器 / root：不动面板、直接重载 Web，排查海外访问慢时更快
bt restart nginx
nginx -t &amp;&amp; systemctl reload nginx

# 目标服务器 / root：确认 8888 当前谁在听
ss -lntp | grep ':8888'
</code></pre>
<p><code>bt restart nginx</code> 在不同小版本里不一定收这个参数，不确定就别硬敲，用菜单编号或后面那条 <code>nginx -t &amp;&amp; systemctl reload nginx</code> 更稳。我处理东南亚线路慢的单子，一般先 <code>nginx -t</code>，配置没报错再 reload，避免把本来就半挂的站点彻底打断。</p>
<p>改完密码立刻做一件事：<strong>进面板把 8888 的公网暴露关掉</strong>，只放公司固定 IP 或跳板机。路径在「安全 / 面板端口 + 授权 IP」，端口我习惯换成 10000–20000 之间一个不冲突的，比如 18888，同时去云厂商安全组删掉 <code>0.0.0.0/0:8888</code> 那条。<a href="https://www.fuwuqi120.com/tag/%e5%a4%96%e8%b4%b8%e7%8b%ac%e7%ab%8b%e7%ab%99/">外贸独立站</a>接 Stripe、PayPal，后台被扫到不是慢不慢的问题，是支付页被挂马、客户填卡直接出事。裸奔 8888 的机器，我见过最短 40 分钟就有爆破日志。</p>
<table>
<tr>
<th>动作</th>
<th>在哪跑</th>
<th>迁移后什么时候用</th>
</tr>
<tr>
<td><code>bt</code> 看列表</td>
<td>目标服务器 / root</td>
<td>第一步，8.0+ 编号会变</td>
</tr>
<tr>
<td>查入口</td>
<td>目标服务器 / root</td>
<td>运营要登录、旧地址失效</td>
</tr>
<tr>
<td>改密码 + 收 8888</td>
<td>目标服务器 / root → 面板</td>
<td>改完 5 分钟内做完</td>
</tr>
<tr>
<td>reload nginx</td>
<td>目标服务器 / root</td>
<td>换 PHP、改伪静态、海外 502</td>
</tr>
</table>
<p>这套下来大概 3–5 分钟。代维按次收的话，这类迁移后基础核对一般在 200–600 元区间，包月里通常不单算；具体看机器数量和有没有多台 ECS 要同步，我不给死价。</p>
<h2 id="fuwuqi120-h2-4">海外访问慢时，命令只能帮你排除一半</h2>
<p>bt restart 只管本机服务，跨洋慢得查链路和源站位置。</p>
<p>这个坑我踩过不止一次。老板在群里发一句「德国客户说下单页转半天」，运维顺手 <code>bt restart</code>，Nginx、PHP 全绿，面板里 CPU 才 12%，可客户那边还是白屏两秒。重启解决的是进程卡死，不是法兰克福到弗吉尼亚那 100 多毫秒的来回。我一般会同时看三样：Nginx 里 <code>$request_time</code>、MySQL 慢查询、浏览器 TTFB。三样里 TTFB 高而 <code>$request_time</code> 低，基本就不是机器的活儿了。</p>
<p>在<strong>海外服务器本机</strong>，用 <code>root</code> 执行：</p>
<pre><code># 看最近 200 条里超过 1 秒的请求，宝塔默认日志路径
awk '$NF &gt; 1 {print $NF, $7}' /www/wwwlogs/你的域名.log | tail -200 | sort -rn | head -20

# 没有配 request_time 时，临时改日志格式后重载（别重启整站）
grep -n 'log_format' /www/server/nginx/conf/nginx.conf
nginx -t &amp;&amp; nginx -s reload

# 慢查询当场开，跑 10 分钟再关，别长期挂着
mysql -uroot -p -e "SET GLOBAL slow_query_log=ON; SET GLOBAL long_query_time=1;"
mysql -uroot -p -e "SHOW GLOBAL STATUS LIKE 'Slow_queries';"

# 从本机反查自己域名的首字节，排除 DNS 干扰
curl -o /dev/null -s -w 'DNS:%{time_namelookup} 连接:%{time_connect} TTFB:%{time_starttransfer} 总:%{time_total}n' https://你的域名/product-page</code></pre>
<p>欧美线路 TTFB 稳在 <strong>300ms 以上</strong>，先别调 PHP 版本，先查源站放哪。AWS EC2 <code>us-east-1</code> 托一个没上 CDN 的 WooCommerce，德国客户首字节我实测常见 <strong>400–700ms</strong>，Woo 的 <code>wc-ajax=get_refreshed_fragments</code> 还要多绕一趟。挪到 <code>eu-central-1</code>，或者把商品页做边缘缓存，掉到 120–200ms 是能看到的。换区涉及 AMI、RDS 和支付回调白名单，停机窗口一般留 2–4 小时，代维报价我这边按 800–2500 元区间收，看有没有多站点绑在同一台。</p>
<table>
<tr>
<th>客户集中地</th>
<th>源站位置</th>
<th>未缓存 TTFB 参考</th>
<th>先动哪一步</th>
</tr>
<tr>
<td>德国 / 法国</td>
<td>us-east-1</td>
<td>400–700ms</td>
<td>迁 eu-central-1 或上边缘缓存</td>
</tr>
<tr>
<td>德国 / 法国</td>
<td>eu-central-1</td>
<td>120–200ms</td>
<td>查慢查询和对象缓存</td>
</tr>
<tr>
<td>马来 / 印尼 / 泰国</td>
<td>新加坡</td>
<td>80–180ms</td>
<td>先跑 mtr 看运营商绕不绕</td>
</tr>
<tr>
<td>马来 / 印尼 / 泰国</td>
<td>美西</td>
<td>220–400ms</td>
<td>对比新加坡节点再决定</td>
</tr>
</table>
<p>东南亚我一般偏新加坡，比美西稳，但具体运营商路由不确定。上个月一个印尼客户走某家本地 ISP，新加坡反而绕香港多跳了 3 跳；别按我经验硬套。在<strong>你本地电脑或另一台跳板机</strong>，普通用户执行：</p>
<pre><code>mtr -rwzc 100 -i 0.5 你的域名
# 看第 4–8 跳的丢包和平均延迟，单看最后一跳没用
# 有条件再从目标国家找一台 1 核小机反打一次，比本地测准</code></pre>
<p>还有一条得单独拎出来。<strong>支付页别开全站缓存</strong>，宝塔的「整站缓存」和部分 CDN 默认规则会把 <code>/checkout</code>、<code>/wc-api/</code>、<code>?wc-ajax=</code> 一起吃掉。Stripe、PayPal 的回调地址被缓存住，钱扣了订单还挂在「待付款」，外贸站最怕这种，客户不会二次下单，只会发一封投诉邮件。我配的时候按下面留白：</p>
<ul>
<li>Nginx 里对 <code>/checkout</code>、<code>/my-account</code>、<code>/wc-api/</code>、<code>wp-json</code> 一律 <code>proxy_no_cache 1;</code>，宝塔站点配置改完 <code>nginx -t &amp;&amp; nginx -s reload</code>。</li>
<li>带 <code>woocommerce_items_in_cart</code>、<code>wp_woocommerce_session_</code> 的 Cookie 请求直接回源，别进边缘缓存。</li>
<li>商品列表页可以缓存 5–10 分钟，单品页 30 分钟够了；支付相关页面设 <code>Cache-Control: private, no-store</code>。</li>
<li>改完拿一张真实测试卡走一遍，再去 Stripe 后台看 webhook 是不是 200，别只看前台页面能打开。</li>
</ul>
<p>命令能告诉你机器没病。剩下那一半，得看客户到机房之间那条路。</p>
<h2 id="fuwuqi120-h2-5">迁移和备份：命令跑完还要验文件属主</h2>
<p>迁移完先验属主，再开站，别先怪 DNS。</p>
<p>从旧 ECS 迁到新 EC2，我习惯先在新机器用 bt 确认 Nginx、PHP、MySQL 都起来了，然后单独查 <strong>/www/wwwroot</strong> 的属主和 wp-config.php 权限。旧服务器只做打包导出，不跑任何重启。这个顺序我踩过坑：有一回法兰克福节点迁完，面板全绿，欧美客户访问首页直接白屏，日志里没有 Nginx 报错，最后查出来整站目录被 rsync 带成了 root:root，PHP-FPM 用的 www 用户写不了缓存。</p>
<p>WordPress 那个 <strong>There has been a critical error on this website</strong>，迁移场景里八成是两件事：属主变成 root，或者 PHP 从 7.4 跳到 8.2 后老插件不兼容。我一般先按属主处理，不动插件。真要回退版本，新机上装 7.4 比改代码快，外贸站的老支付网关插件对 8.2 尤其敏感。</p>
<p>下面这组都在<strong>新服务器、root 身份</strong>执行，命令可以直接复制：</p>
<pre><code># 新 EC2 / root
bt status
bt 14
ls -ld /www/wwwroot /www/wwwroot/你的站点目录
stat -c '%U:%G %a %n' /www/wwwroot/你的站点目录/wp-config.php

# 属主不对就一次性修回来，别只改单层
chown -R www:www /www/wwwroot/你的站点目录
find /www/wwwroot/你的站点目录 -type d -exec chmod 755 {} ;
find /www/wwwroot/你的站点目录 -type f -exec chmod 644 {} ;
chmod 600 /www/wwwroot/你的站点目录/wp-config.php
bt restart nginx
bt restart php-fpm-74</code></pre>
<p>数据库导入后还有一步容易漏。换域名、或者先用临时 IP 给海外客户预览，siteurl 和 home 还指着旧地址，就会出现首页能开、产品页全 404。别急着改 DNS，先把 URL 和伪静态一起处理：</p>
<ul>
<li>wp_options 里 siteurl / home 改成新域名或 <code>http://临时IP</code>，预览完记得改回正式域名，Stripe、PayPal 回调对域名很挑。</li>
<li>宝塔站点里重新选一次 WordPress 伪静态，再 <code>bt restart nginx</code>。不重载规则，欧美线路上缓存的旧 rewrite 能挂大半天。</li>
<li>东南亚客户走临时 IP 预览时，我一般额外开 80/443 安全组，别只放 22，不然对方根本连不上。</li>
</ul>
<p>旧机只跑导出，root 身份，不碰服务状态：</p>
<pre><code># 旧 ECS / root，仅导出
cd /www/wwwroot/你的站点目录
tar -czf /tmp/site_$(date +%F).tar.gz .
mysqldump -u根用户 -p 数据库名 &gt; /tmp/db_$(date +%F).sql
ls -lh /tmp/site_*.tar.gz /tmp/db_*.sql</code></pre>
<table>
<tr>
<th>现象</th>
<th>先查</th>
<th>典型值</th>
</tr>
<tr>
<td>白屏 / critical error</td>
<td>目录属主 + PHP 版本</td>
<td>www:www，755 / 644，PHP 7.4</td>
</tr>
<tr>
<td>首页开、产品页 404</td>
<td>wp_options + 伪静态</td>
<td>siteurl 一致，规则已重载</td>
</tr>
<tr>
<td>海外客户打不开、本地能开</td>
<td>安全组 80/443</td>
<td>0.0.0.0/0 临时放行</td>
</tr>
</table>
<p>这套验完再切 DNS，回滚成本最低。代维里这类迁移单我收 800 到 2000 区间，看站点数量和有没有多语言子目录；自己照着跑，半小时够了。wp-config.php 给 600 就够，别图省事上 777，外贸站被塞过一次垃圾外链，清理比重迁还麻烦。</p>
<h2 id="fuwuqi120-h2-6">注意什么：别把 bt 当万能钥匙</h2>
<p>bt 只管面板侧动作，安全边界和交接记录得另外立规矩。</p>
<p>我接手过不少被黑的外贸站，回溯时发现最麻烦的不是木马本身，是没人说得清哪天谁跑过 <code>bt default</code>、谁改过面板密码。这些操作都会落日志，但日志只记时间和结果，不记「谁、为什么动」。代维交接时我要求单独留一份台账，哪怕就是一张表：UTC+0 时间、执行人、命令、客户侧原因。欧美客户半夜下单打不开，追查时差能省掉半小时扯皮。</p>
<p>在<strong>目标 ECS / EC2，root 身份</strong>执行，先把当前面板日志和版本留底再动任何东西：</p>
<pre><code>date -u '+%Y-%m-%d %H:%M:%S UTC'
cat /www/server/panel/data/default.pl 2&gt;/dev/null
tail -n 50 /www/server/panel/logs/panel.log
bt default
python3 -V
python -V 2&gt;&amp;1 | head -n 1
</code></pre>
<p>端口别图省事。面板 8888、SSH 22、MySQL 3306 一起对 <code>0.0.0.0/0</code> 开放，我见过最频繁的一台阿里云新加坡 ECS，8888 一天被猜 4000 多次，WordPress 后台跟着被撞库。外贸站不用备案，支付页又常年在线，暴露面比内销站大。放通按下面收：</p>
<table>
<tr>
<th>端口</th>
<th>建议放通</th>
<th>外贸场景说明</th>
</tr>
<tr>
<td>8888 / 面板</td>
<td>只放运维固定 IP，或临时开 30 分钟</td>
<td>被扫到后暴力猜测很常见，改密码也挡不住持续扫</td>
</tr>
<tr>
<td>22 / SSH</td>
<td>限 IP，改非 22 端口只算附加项</td>
<td>欧美、东南亚多地远程登，白名单比换端口好管</td>
</tr>
<tr>
<td>3306</td>
<td>只绑 127.0.0.1</td>
<td>独立站和库同机时根本不用对外，跨机才走内网</td>
</tr>
<tr>
<td>80 / 443</td>
<td>0.0.0.0/0</td>
<td>这个必须全开，海外客户才进得来</td>
</tr>
</table>
<p>在<strong>目标机器，root 身份</strong>核对一遍实际监听，别只看安全组页面：</p>
<pre><code>ss -lntp | egrep ':(22|3306|8888|80|443)s'
grep -n 'bind-address' /etc/mysql/mysql.conf.d/mysqld.cnf 2&gt;/dev/null
</code></pre>
<p>Ubuntu 22.04 上还有个坑。部分老宝塔插件仍依赖 Python 2，系统默认只有 3.10，硬装会把面板依赖带歪，我踩过一次，最后是靠前一天的快照回的。装插件前先看上面那条 <code>python -V</code> 输出，不确定兼容就先做快照，别在客户旺季改。</p>
<ul>
<li>快照保留至少 7 天，迁移类留 30 天，欧美黑五前别清。</li>
<li>包年代维我见过 <strong>3000-12000 元/台/年</strong>，含不含迁移、木马查杀、夜间响应差别很大。只写「服务器维护」四个字的合同别签，条款里至少列清响应时段、备份频率、被黑后几小时介入。</li>
<li>夜间响应按谁所在时区写死，UTC+0 还是 UTC+8，别留「尽快」。</li>
</ul>
<p>bt 跑完能告诉你面板活着，告诉不了你谁动过、门开在哪、出事谁接。这三件事不写进交接单，下次宕机还是从头猜。</p>
<h2 id="fuwuqi120-faq">常见问题</h2>
<h3>宝塔面板打不开了用什么命令查端口和密码</h3>
<p>SSH 进服务器跑 bt default 看入口，再跑 bt 选修改密码；8888 不通先查安全组。</p>
<h3>外贸网站海外客户打不开，bt restart 有用吗</h3>
<p>只在 Nginx 或 PHP 挂了时有用。链路、DNS、CDN 回源问题，重启面板没效果。</p>
<h3>阿里云 ECS 装宝塔后 8888 端口放不通怎么办</h3>
<p>在 ECS 安全组入方向加 TCP 8888，源 IP 填办公固定 IP，别填 0.0.0.0/0。</p>
<h3>WordPress 迁移后宝塔面板命令都正常但页面 500</h3>
<p>查 /www/wwwroot 属主、PHP 版本和插件日志，先看 wp-content/debug.log 再回滚插件。</p>
<h3>AWS EC2 上宝塔面板命令和阿里云一样吗</h3>
<p>bt 命令一样，差别在 Security Group、镜像系统和 IAM 密钥登录方式。</p>
<div class="fuwuqi120-cta">
<p>服务器又出问题了？外贸站的宕机、被黑、迁移和访问慢，我们按次或按月代维，先免费看机器再报价。</p>
<p><a class="fuwuqi120-cta-btn" href="/service/">看看代维服务</a></p>
</div>
<div class="fuwuqi120-grid">
<p class="fuwuqi120-grid-title"><strong>0</strong></p>
<div class="fuwuqi120-grid-inner"><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/2-504%e9%94%99%e8%af%af%e6%8e%92%e6%9f%a5%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e7%bd%91%e5%85%b3%e8%b6%85%e6%97%b6%e6%80%8e%e4%b9%88%e4%bf%ae/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/2-504e99499e8afafe68e92e69fa5efbc9ae5a496e8b4b8e7ab99e7bd91e585b3e8b685e697b6e6808ee4b988e4bfae-3kT1Ok-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">2 504错误排查：外贸站网关超时怎么修</span><span class="fuwuqi120-card-date">2026-11-22</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/nginx%e5%8f%8d%e5%90%91%e4%bb%a3%e7%90%86%e5%a4%b1%e8%b4%a5%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e6%8e%92%e9%9a%9c%e5%ae%9e%e5%bd%95/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/nginxe58f8de59091e4bba3e79086e5a4b1e8b4a5efbc9ae5a496e8b4b8e7ab99e68e92e99a9ce5ae9ee5bd95-Ou1YoF-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">Nginx反向代理失败：外贸站排障实录</span><span class="fuwuqi120-card-date">2026-11-21</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/1-nginx%e4%bc%98%e5%8c%96%e9%85%8d%e7%bd%ae%e7%a4%ba%e4%be%8b%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e5%8f%af%e7%9b%b4%e6%8e%a5%e5%a5%97%e7%94%a8/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/1-nginxe4bc98e58c96e9858de7bdaee7a4bae4be8befbc9ae5a496e8b4b8e7ab99e58fafe79bb4e68ea5e5a597e794a8-kaL4Ls-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">1 Nginx优化配置示例：外贸站可直接套用</span><span class="fuwuqi120-card-date">2026-11-19</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/nginx-%e5%b8%b8%e8%a7%81%e9%94%99%e8%af%af%e6%8e%92%e6%9f%a5%e6%8c%87%e5%8d%97%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e5%ae%9e%e6%88%98/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/nginx-e5b8b8e8a781e99499e8afafe68e92e69fa5e68c87e58d97efbc9ae5a496e8b4b8e7ab99e5ae9ee68898-NVasxb-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">Nginx 常见错误排查指南：外贸站实战</span><span class="fuwuqi120-card-date">2026-11-18</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/nginx-%e7%bd%91%e5%85%b3%e9%94%99%e8%af%af%e6%8e%92%e6%9f%a5%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99-502-504-%e5%ae%9e%e5%bd%95/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/nginx-e7bd91e585b3e99499e8afafe68e92e69fa5efbc9ae5a496e8b4b8e7ab99-502-504-e5ae9ee5bd95-zZIlPd-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">Nginx 网关错误排查：外贸站 502/504 实录</span><span class="fuwuqi120-card-date">2026-11-18</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/%e5%a4%96%e8%b4%b8%e7%ab%99%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf%e5%ae%89%e8%a3%85%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%85%88%e9%80%89%e7%b3%bb%e7%bb%9f%e5%86%8d%e8%a3%85/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/e5a496e8b4b8e7ab99e5ae9de5a194e99da2e69dbfe5ae89e8a385e591bde4bba4efbc9ae58588e98089e7b3bbe7bb9fe5868de8a385-vU0FgY-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">外贸站宝塔面板安装命令：先选系统再装</span><span class="fuwuqi120-card-date">2026-11-15</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/wordpress-%e5%a4%96%e8%b4%b8%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%85%a8%e9%9d%a2%e7%bb%b4%e6%8a%a4%e6%9c%8d%e5%8a%a1%ef%bc%88%e6%94%af%e6%8c%81%e4%b8%ad%e8%8b%b1%e6%96%87%ef%bc%89/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/wordpress-e5a496e8b4b8e69c8de58aa1e599a8e585a8e99da2e7bbb4e68aa4e69c8de58aa1efbc88e694afe68c81e4b8ade88bb1e69687efbc89-L09wI0-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">aliyun服务器代维</span><span class="fuwuqi120-card-title">WordPress 外贸服务器全面维护服务（支持中英文）</span><span class="fuwuqi120-card-date">2020-02-28</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/%e4%bc%81%e4%b8%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%89%98%e7%ae%a1%e8%bf%90%e7%bb%b4/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/e4bc81e4b89ae69c8de58aa1e599a8e68998e7aea1e8bf90e7bbb4-E1vdzG-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux代维</span><span class="fuwuqi120-card-title">企业服务器托管运维</span><span class="fuwuqi120-card-date">2020-02-28</span></span></a><a class="fuwuqi120-card" href="https://www.fuwuqi120.com/%e5%a4%96%e8%b4%b8%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%bb%a3%e7%bb%b4%e6%8a%a4/"><span class="fuwuqi120-card-thumb" style="background-image:url(https://www.fuwuqi120.com/wp-content/uploads/2026/11/e5a496e8b4b8e69c8de58aa1e599a8e4bba3e7bbb4e68aa4-pA6qcr-768x430.webp)" aria-hidden="true"></span><span class="fuwuqi120-card-body"><span class="fuwuqi120-card-cat">linux服务器代维</span><span class="fuwuqi120-card-title">外贸服务器代维护</span><span class="fuwuqi120-card-date">2020-02-28</span></span></a></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.fuwuqi120.com/%e5%ae%9d%e5%a1%94%e9%9d%a2%e6%9d%bf%e5%91%bd%e4%bb%a4%ef%bc%9a%e5%a4%96%e8%b4%b8%e7%ab%99%e6%8e%92%e9%9a%9c%e5%ae%9e%e6%93%8d/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
