nginx安装有问题,不知道怎么解决

Problem with nginx install, no idea how to fix

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

我遵循了一个教程,它运行良好,然后我尝试在网站上进行一些修改,但出现了一些错误(这是关于我试图在 [= 上克隆的 GitHub 存储库11=],不是 nginx)。

为了修复它,我在所有 PID 上使用 SIGKILL 停止了 nginx。

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

当我现在尝试 restart/start 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?

要在 Ubuntu(作为 Debian 衍生产品)上删除并重新安装 nginx (virtual) package, you can use apt

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 代表并接受 单位的名称,并且 .service 后缀可以省略作为单位的默认类型。

正在复制配置文件

您可以将 Debian Salsa 上的 nginx source package upstream nginx 存储库克隆为:

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

并将 conf/ 目录内容复制到 /etc/nginx,方法是:

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

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