systemctl start php-fpm 查看状态 systemctl status php-fpm 停止服务 systemctl stop php-fpm 重启服务 systemctl restart php-fpm 修改配置文件后重载 systemctl reload php-fpm 开机自启动 systemctl enable php-fpm 禁止开机自启动 systemctl did
touch/usr/lib/systemd/system/nginx.service 创建成功 之后,我们要写入。 编写配置文件 使用vim进行配置文件的写入(其实刚刚不用touch创建也可以~): 代码语言:shell AI代码解释 vim/usr/lib/systemd/system/nginx.service 新增: 代码语言:html AI代码解释 [Unit] Description=nginx After=network.target [Service] ...
service --since today # 实时滚动显示某个 Unit 的最新日志 journalctl -u nginx.service -f # 合并显示多个 Unit 的日志 $ journalctl -u nginx.service -u php-fpm.service --since today # 查看指定优先级(及其以上级别)的日志,共有 8 级# 0: emerg # 1: alert # 2: crit # 3: err # 4: ...
sudo systemctl status php-fpm.service 检查网络接口和端口: 确保nginx配置的监听端口没有被其他服务占用,并且网络接口是可用的。 5. 修复问题并重新启动nginx服务 一旦找到问题的根源,你需要修复它,然后尝试重新启动nginx服务。 bash sudo systemctl restart nginx.service 如果问题仍然存在,你可能需要再次检查上述...
systemctl status nginx systemctl start nginx service nginx restart #重启 Nginx service php-fpm restart # 重启 php-fpm systemctl start mysqld #启动 MySQL systemctl status mysqld #查看 MySQL 状态 systemctl stop mysqld #关闭mysql systemctl enable mysqld #mysql开机启动...
可以使用```systemctl cat```命令来查看服务的配置文件,下面是Mysql的配置文件,很多软件已经支持Systemd程序了,安装的时候会自动配置它的Unit配置文件,例如Mysql和Nginx等等。 ``` [root@VM_0_11_centos ~]# systemctl cat mysqld # /usr/lib/systemd/system/mysqld.service ...
systemctl start nginx service nginx restart #重启 Nginx service php-fpm restart # 重启 php-fpm systemctl start mysqld #启动 MySQL systemctl status mysqld #查看 MySQL 状态 systemctl stop mysqld #关闭mysql systemctl enable mysqld #mysql开机启动 ...
systemctl restart abrtd.servicesystemctl status abrtd.service 设置服务开机启动 systemctl enable nginx.service//设置nginx开机启动 systemctl enable php-fpm.service//php-fpm开机启动 搜索指定状态的服务 systemctl list-unit-files | grep enabled//搜索全部已启动的服务,enabled 启用;disabled 禁用。
systemctl restart abrtd.service systemctl status abrtd.service 1. 2. 设置服务开机启动 systemctl enable nginx.service //设置nginx开机启动 1. systemctl enable php-fpm.service //php-fpm开机启动 1. 搜索指定状态的服务 systemctl list-unit-files | grep enabled //搜索全部已启动的服务,enabled 启用;...
sudo journalctl _UID=33--since today# 查看某个 Unit 的日志$ sudo journalctl -u nginx.service$ sudo journalctl -u nginx.service --since today# 实时滚动显示某个 Unit 的最新日志$ sudo journalctl -u nginx.service -f# 合并显示多个 Unit 的日志$ journalctl -u nginx.service -u php-fpm.service...