在 CentOS 下,LNMP 一般指 Linux + Nginx + MySQL(MariaDB) + PHP。重启方式取决于你是源码安装还是使用 LNMP 一键包,下面分别说明。
如果你是用 lnmp.org 的一键包安装的,直接执行:
lnmp restart
也可以单独重启:
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
查看状态:
lnmp status
systemctl restart nginx
# MySQL
systemctl restart mysqld
# MariaDB
systemctl restart mariadb
systemctl restart php-fpm
如果 PHP 版本是 php74、php80 之类:
systemctl restart php74-php-fpm
service nginx restart
service mysqld restart
service php-fpm restart
systemctl status nginx
systemctl status mysqld
systemctl status php-fpm
# Nginx
/var/log/nginx/error.log
# PHP
/var/log/php-fpm/error.log
# MySQL
/var/log/mysqld.log
systemctl restart nginx mysqld php-fpm
如果你能告诉我:
我可以给你更精确的重启命令。