gpt4 book ai didi

linux - nginx安装出现问题,不知道如何解决

转载 作者:太空宇宙 更新时间:2023-11-04 05:11:52 25 4
gpt4 key购买 nike

我正在尝试在我的笔记本电脑(Ubuntu 18.04)上为我的网站安装 nginx 服务器。

我按照教程进行操作,效果很好,然后我尝试在网站上进行一些修改,但出现了一些错误(这是关于我试图在 /var/www/html 上克隆的 GitHub 存储库,而不是 nginx)。

为了修复这个问题,我在所有 PID 上使用 SIGKILL 停止了 nginx。

然后我不知道为什么,但出现了一些问题,我删除了 /etc/nginx 存储库(是的,这确实是一个坏主意,我知道......)

当我现在尝试重新启动/启动 nginx 时,出现此错误:

Job for nginx.service failed because the control process exited with error code.

See "systemctl status nginx.service" and "journalctl -xe" for
details.

我尝试了很多在互联网上找到的东西,但它总是引用我删除的配置文件。

有没有办法从我的计算机上完全删除 nginx 并重新正确安装它?我认为这是最好的选择;或者解决这个问题的方法,如果你知道的话?

最佳答案

重新安装 nginx

Is there a way to completely remove nginx from my computer and re-install it properly? I think it's the best option. Or a way to fix it, if you know that?

删除并重新安装 nginx (虚拟)包,可以使用apt在 Ubuntu 上(作为 Debian 的衍生版本):

apt remove -y nginx

apt install -y nginx

分析服务故障

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

您可以考虑发出:

journalctl -u nginx

查看错误的确切原因。

-u 代表并接受 的名称作为单位的默认类型,可以省略unit和.service后缀。

复制配置文件

您可以克隆nginx源码包上游nginx Debian Salsa 上的存储库为:

git clone git://salsa.debian.org/nginx-team/nginx

并将 conf/ 目录内容复制到 /etc/nginx 中:

cp -rv nginx/conf/* /etc/nginx/

-r 用于递归(子目录,如果有)复制,-v 用于详细信息(在控制台屏幕上输出复制的文件)

关于linux - nginx安装出现问题,不知道如何解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54381875/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com