分类 服务器 下的文章

修改时区

常看当前时区

timedatectl

列出所有时区

timedatectl list-timezones

更改时区

timedatectl set-timezone Asia/Shanghai

时间同步

首先安装crhony

dnf install -y chrony

更改配置

chrony配置文件: /etc/chrony.conf
如果服务器在国内,建议修改时钟服务器为国内服务器。其他地区时钟服务器可参考:https://dns.icoa.cn/ntp/
将第一行改成: pool ntp.ntsc.ac.cn iburst

启动自动同步时间

systemctl enable chronyd
systemctl start chronyd

问题介绍

nginx执行nginx -s reload时,出现如下错误:

nginx: [error] CreateFile() "C:\web\nginx-1.17.9/logs/nginx.pid" failed (2: The system cannot find the file specified)

排查方法

执行命令nginx -t查看配置文件是否正确,大部分问题都是因为配置文件造成的,此命令会列出配置文件错误项。如下:

C:\web\nginx-1.17.9>nginx.exe -t
nginx: the configuration file C:\web\nginx-1.17.9/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:8090 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
nginx: configuration file C:\web\nginx-1.17.9/conf/nginx.conf test failed

可以看出,配置文件中监听端口号无法正常启动,应是被占用了,修改端口之后,重新执行nginx -s reload即可。

P.S. 本人nginx并不熟悉,此文也仅是记录下本次碰到此问题的解决过程。故此方案未必能解决所有同类问题。

问题描述

宝塔面板安装php,消息盒子提示安装成功。

提示成功

但是,应用列表中并没有显示。查看日志,可以看到如下信息:

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
make: * No targets specified and no makefile found.  Stop.
make: * No rule to make target 'install'.  Stop.

解决方案

ssh登陆服务器,执行如下命令,然后重新安装php即可成功安装。

apt-get install curl
apt-get install libcurl4-gnutls-dev