无法在Linux上安装Nginx

无法在Linux上安装Nginx,第1张

概述我刚刚创建了一个Ubuntu服务器.我试过安装Nginx但是我遇到了错误. root@scw-eefca0:~# sudo apt-get install nginxReading package lists... DoneBuilding dependency tree Reading state information... Donenginx is already th 我刚刚创建了一个ubuntu服务器.我试过安装Nginx但是我遇到了错误.
root@scw-eefca0:~# sudo apt-get install NginxReading package Lists... DoneBuilding dependency tree        Reading state information... DoneNginx is already the newest version (1.10.0-0ubuntu0.16.04.4).0 upgraded,0 newly installed,0 to remove and 0 not upgraded.2 not fully installed or removed.After this operation,0 B of additional disk space will be used.Do you want to continue? [Y/n] YSetting up Nginx-core (1.10.0-0ubuntu0.16.04.4) ...Job for Nginx.service Failed because the control process exited with error code. See "systemctl status Nginx.service" and "journalctl -xe" for details.invoke-rc.d: initscript Nginx,action "start" Failed.dpkg: error processing package Nginx-core (--configure): subprocess installed post-installation script returned error exit status 1dpkg: dependency problems prevent configuration of Nginx: Nginx depends on Nginx-core (>= 1.10.0-0ubuntu0.16.04.4) | Nginx-full (>= 1.10.0-0ubuntu0.16.04.4) | Nginx-light (>= 1.10.0-0ubuntu0.16.04.4) | Nginx-extras (>= 1.10.0-0ubuntu0.16.04.4); however:  Package Nginx-core is not configured yet.  Package Nginx-full is not installed.  Package Nginx-light is not installed.  Package Nginx-extras is not installed. Nginx depends on Nginx-core (<< 1.10.0-0ubuntu0.16.04.4.1~) | Nginx-full (<< 1.10.0-0ubuntu0.16.04.4.1~) | Nginx-light (<< 1.10.0-0ubuntu0.16.04.4.1~) | Nginx-extras (<< 1.10.0-0ubuntu0.16.04.4.1~); however:  Package Nginx-core is not configured yet.  Package Nginx-full is not installed.  Package Nginx-light is not installed.  Package Nginx-extras is not installed.dpkg: error processing package Nginx (--configure): dependency problems - leaving unconfiguredErrors were encountered while processing: Nginx-core NginxE: Sub-process /usr/bin/dpkg returned an error code (1)

编辑:@H_403_5@

systemctl status Nginx.service输出:@H_403_5@

● Nginx.service - A high performance web server and a reverse proxy server   Loaded: loaded (/lib/systemd/system/Nginx.service; enabled; vendor preset: enabled)   Active: Failed (Result: exit-code) since Mon 2017-01-23 13:40:38 UTC; 10min ago  Process: 12375 ExecStartPre=/usr/sbin/Nginx -t -q -g daemon on; master_process on; (code=exited,status=1/FAILURE)Jan 23 13:40:38 scw-eefca0 systemd[1]: Starting A high performance web server and a reverse proxy server...Jan 23 13:40:38 scw-eefca0 Nginx[12375]: Nginx: [emerg] socket() [::]:80 Failed (97: Address family not supported by protocol)Jan 23 13:40:38 scw-eefca0 Nginx[12375]: Nginx: configuration file /etc/Nginx/Nginx.conf test FailedJan 23 13:40:38 scw-eefca0 systemd[1]: Nginx.service: Control process exited,code=exited status=1Jan 23 13:40:38 scw-eefca0 systemd[1]: Failed to start A high performance web server and a reverse proxy server.Jan 23 13:40:38 scw-eefca0 systemd[1]: Nginx.service: Unit entered Failed state.Jan 23 13:40:38 scw-eefca0 systemd[1]: Nginx.service: Failed with result 'exit-code'.

这是一个全新的服务器,除了更新apt-get之外我没有配置任何东西.@H_403_5@解决方法

Nginx: [emerg] socket() [::]:80 Failed (97: Address family not supported by protocol)

Nginx尝试启动,并连接到[::]:80,但不能.可能是因为在计算机上禁用了IPv6.启用IPv6或更改Nginx配置.在配置文件/etc/Nginx/Nginx.conf中搜索此行:@H_403_5@

Listen [::]:80 default_server;

并评论出来:@H_403_5@

# Listen [::]:80 default_server;

重启Nginx:@H_403_5@

systemctl Nginx restart

或者,如果这给出了错误,它没有运行:@H_403_5@

systemctl Nginx start

然后再次运行install命令.@H_403_5@ 总结

以上是内存溢出为你收集整理的无法在Linux上安装Nginx全部内容,希望文章能够帮你解决无法在Linux上安装Nginx所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/1040682.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-24
下一篇2022-05-24

发表评论

登录后才能评论

评论列表(0条)

    保存