找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Namecheap优惠码Spaceship优惠码
查看: 40|回复: 6

[主机资源] InstaBox免費雲虛擬機4個vCPU+8GB 搭建成功/wordpress

[复制链接]
发表于 3 小时前 | 显示全部楼层 |阅读模式
本帖最后由 浪子吟风 于 2026-10-18 17:28 编辑

功夫不负有心人



域名:https://xwblog.xuwbk.com/   

我看看能不能挂起  

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 3 小时前 | 显示全部楼层
我这里安装经常断连,等晚点我再试试。
发表于 3 小时前 | 显示全部楼层
本帖最后由 patriotic 于 2026-10-18 17:45 编辑

InstaBox可以叫Muse幫您自動運行就可以24/7
具體如何操作煩勞大佬指教~
 楼主| 发表于 3 小时前 | 显示全部楼层
我靠,没有想到速度咣咣的
 楼主| 发表于 3 小时前 | 显示全部楼层
patriotic 发表于 2026-10-18 17:42
InstaBox可以叫Muse幫您自動運行就可以24/7
具體如何操作煩勞大佬指教~

一、彻底禁用系统休眠 / 挂起 / 休眠到磁盘

1)mask 睡眠相关 target
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

验证:
systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target

看到 Loaded: masked 就对了。
想恢复:
systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

2)禁止空闲自动挂起(logind)

新建配置:
mkdir -p /etc/systemd/logind.conf.d
cat > /etc/systemd/logind.conf.d/no-sleep.conf <<'EOF'
[Login]
IdleAction=ignore
IdleActionSec=0
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchDocked=ignore
HandleLidSwitchExternalPower=ignore
EOF

systemctl restart systemd-logind

3)systemd-sleep 层面再锁一次
mkdir -p /etc/systemd/sleep.conf.d
cat > /etc/systemd/sleep.conf.d/disable-sleep.conf <<'EOF'
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
EOF

到这步,系统层面永远不会自动睡。
二、让 1Panel / socat 一直跑(关键)

系统不睡 ≠ 服务一定在。你要让服务“开机自启 + 崩溃重启”。
1Panel 本身
cat > /etc/systemd/system/instabox-1panel-forward.service <<'EOF'
[Unit]
Description=Forward InstaBox 31658 to 1Panel 31568
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/socat TCP-LISTEN:31658,reuseaddr,fork TCP:127.0.0.1:31568
Restart=always
RestartSec=3
User=root

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable --now instabox-1panel-forward
systemctl status instabox-1panel-forward

你前面的 31658 → 31568 转发,做成 systemd 服务
cat > /etc/systemd/system/instabox-1panel-forward.service <<'EOF'
[Unit]
Description=Forward InstaBox 31658 to 1Panel 31568
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/socat TCP-LISTEN:31658,reuseaddr,fork TCP:127.0.0.1:31568
Restart=always
RestartSec=3
User=root

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable --now instabox-1panel-forward
systemctl status instabox-1panel-forward
这样:
机器/容器重启 → 自动转发
socat 挂了 → systemd 3 秒后拉起来
三、如果是“InstaBox 平台把空闲沙箱回收/暂停”

这个你改 Linux 也没用,因为是平台层行为:
长时间无请求 → 沙箱被暂停
再次访问 → 服务没起来 → “Nothing is listening”
解决办法只有这类:
用 1Panel 的计划任务定期 curl 自己
外部监控/保活(你本地或别的机器定时访问)
升级 InstaBox 套餐/改为常驻实例
把 1Panel 放真实云服务器,而不是沙箱
简单保活:
# crontab -e
*/2 * * * * curl -s http://127.0.0.1:31568/xuwbk >/dev/null 2>&1

四、你这个环境的最终结论

✅ 系统不休眠:用上面 systemd 配置
✅ 1Panel 常驻:enable 1panel
✅ 31658 可访问:用 systemd 管理 socat
⚠️ InstaBox 平台回收沙箱:只能保活/换常驻实例
发表于 3 小时前 | 显示全部楼层
能装Discourse 吗
发表于 1 小时前 | 显示全部楼层
还是不会玩
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2026-10-18 21:21 , Processed in 0.076642 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表