尧图网络科技YAOTU DIGITAL 获取报价
获取报价
首页 / 资讯中心 / 文章详情

【TongWeb8】使用 systemctl 管理 TongWeb 启停

发布时间:2026/9/26 19:10:32

资讯中心
01
ARTICLE

【TongWeb8】使用 systemctl 管理 TongWeb 启停

【TongWeb8】使用 systemctl 管理 TongWeb 启停
在 Linux 环境中TongWeb 默认一般通过 bin 目录下的脚本进行启动和停止启动./startd.sh停止./stopserver.sh这种方式每次都需要进入 TongWeb 安装目录操作如果服务器重启还需要人工启动。可以将 TongWeb 配置成 systemd 服务之后直接使用 systemctl 管理。例如systemctl start tongweb systemctl stop tongweb systemctl restart tongweb systemctl status tongweb配置 TongWeb 服务创建服务文件vim /etc/systemd/system/tongweb.service写入以下内容[Unit] DescriptionTongWeb Middleware Afternetwork.target syslog.target [Service] Typeforking WorkingDirectory/home/chenyanliang/dft/TongWeb8.0.9.12/bin EnvironmentJAVA_HOME/usr/local/java/jdk1.8 Userchenyanliang Groupchenyanliang ExecStart/home/chenyanliang/dft/TongWeb8.0.9.12/bin/startd.sh ExecStop/home/chenyanliang/dft/TongWeb8.0.9.12/bin/stopserver.sh TimeoutStartSec120 TimeoutStopSec60 PrivateTmpfalse Restarton-failure RestartSec10 StandardOutputjournalconsole StandardErrorjournalconsole [Install] WantedBymulti-user.target注意修改以下配置TongWeb 安装路径/home/chenyanliang/dft/TongWeb8.0.9.12需要替换成实际 TongWeb 安装目录。例如WorkingDirectory/你的TongWeb目录/bin ExecStart/你的TongWeb目录/bin/startd.sh ExecStop/你的TongWeb目录/bin/stopserver.sh同时Userchenyanliang Groupchenyanliang修改为实际运行 TongWeb 的用户。加载配置创建完成后执行systemctl daemon-reload让 systemd 重新读取服务配置。TongWeb 启停管理启动 TongWebsystemctl start tongweb停止 TongWebsystemctl stop tongweb重启 TongWebsystemctl restart tongweb查看运行状态systemctl status tongweb设置开机自动启动如果希望服务器重启后自动启动 TongWebsystemctl enable tongweb查看是否设置成功systemctl is-enabled tongweb配置完成后TongWeb 的日常管理就可以直接通过 systemctl 完成不需要再进入 TongWeb 的 bin 目录手动执行启动脚本。这样也方便后续服务器重启、故障自动拉起等运维操作。
02
RELATED NEWS

相关资讯

更多网站建设与数字化升级内容

03
WHY YAOTU

想打造同款高转化官网?

懂行业、懂生意,从建站到增长一站式陪跑

◈

场景化定制

不做模板站,围绕你的业务场景量身设计,小众不撞款。

◐

营销型架构

以转化目标组织内容与路径,让官网真正带来询盘。

▲

全周期服务

设计、开发、运营、运维一体,上线只是开始。

免费获取你的建站方案

留下需求,专属顾问 24 小时内为你输出方案建议。