温馨提示×

debian lnmp怎么重启服务

小樊
40
2026-09-10 18:40:27
栏目: 智能运维

在 Debian 上,LNMP 一般指 Linux + Nginx + MySQL/MariaDB + PHP。重启方式取决于你是用 apt 安装 还是 一键包(如 LNMP.org)


一、APT 安装的 LNMP(最常用)

1. 重启 Nginx

systemctl restart nginx

2. 重启 MySQL / MariaDB

systemctl restart mysql      # MySQL
# 或
systemctl restart mariadb    # MariaDB

3. 重启 PHP(以 PHP 7.4 为例)

systemctl restart php7.4-fpm

查看已安装版本:

ls /etc/php/

4. 一次性重启全部(推荐)

systemctl restart nginx mysql php7.4-fpm

二、LNMP.org 一键包

如果你用的是 lnmp.org 一键安装包:

lnmp restart

单独重启:

lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart

三、查看服务状态

systemctl status nginx
systemctl status mysql
systemctl status php7.4-fpm

四、常见问题

Nginx 配置错误

nginx -t

开机自启

systemctl enable nginx mysql php7.4-fpm

如果你是 具体某个版本(Debian 11/12)宝塔 / LNMP.org / 自己编译,可以告诉我,我给你更精确命令。

0