问题描述:
禁用了Plesk的Nginx代理,单独使用Apache,因为在单独使用Apache的时候可以给每个网站设置带宽和连接数。重新启用Nginx代理之后,发现重启服务器之后,Nginx不能自动开机启懂,运行systemctl status nginx.service的时候出现如下的错误提示,但是可以通过systemctl start nginx.servie手动启动。
- [root@www ~]# systemctl status nginx.service
- ● nginx.service - Startup script for nginx service
- Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
- Active: failed (Result: exit-code) since 五 2018-01-12 21:19:58 CST; 25s ago
- 1月 12 21:19:57 www.ezloo.com systemd[1]: Starting Startup script for nginx service...
- 1月 12 21:19:58 www.ezloo.com nginx[844]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
- 1月 12 21:19:58 www.ezloo.com nginx[844]: nginx: [emerg] bind() to 172.31.191.115:443 failed (99: Cannot assign requested address)
- 1月 12 21:19:58 www.ezloo.com nginx[844]: nginx: configuration file /etc/nginx/nginx.conf test failed
- 1月 12 21:19:58 www.ezloo.com systemd[1]: nginx.service: control process exited, code=exited status=1
- 1月 12 21:19:58 www.ezloo.com systemd[1]: Failed to start Startup script for nginx service.
- 1月 12 21:19:58 www.ezloo.com systemd[1]: Unit nginx.service entered failed state.
- 1月 12 21:19:58 www.ezloo.com systemd[1]: nginx.service failed.
解决办法:
编辑 /etc/sysctl.conf,加入以下一行代码:
- # allow processes to bind to the non-local address
- net.ipv4.ip_nonlocal_bind = 1
再运行一下:
- sysctl -p /etc/sysctl.conf
重启服务器的时候,发现Nginx可以正常启动了。
解决Plesk面板Nginx不能自动启动的问题
------
按道理来说,在一台服务器上,单纯使用Apache比通过Nginx代理使用的内存、CPU要低,毕竟Nginx还是要占用资源的,不知道Plesk用Nginx做前端代理有何用意。除外,既然用Nginx做代理,那么应该允许我们前后端分离,就是后端服务器再另外一台服务器上,希望下次能看到这个功能。
作为开放网络的先驱,戴尔易安信推出其***Z系列100GbE光纤交换机Z9264F-ON,其容...
Unix和Linux平台下使用最广泛的免费HTTP服务器是Apache服务器,而Windows平台的...
近年来,越来越多的首席信息官和IT领导者致力于实施数字化转型,他们在这一过程...
Raid 5是最常见的raid方式之一,它本身也具有一定的数据保护机制,如果其中的一...
服务器域名空间的选择对一个网站的维护或者运营起到至关重要的所以,由于如今美...
8月6日,UCloud正式发布新一代归档存储产品,该产品采用UCloud全新自研存储架构...
当前的快消品企业转型需要从数字化转型开始。数字化转型是当前企业需要赶快思考...
2020年春季,随着新冠疫情在美国蔓延,大多数公司出于需要而安排部分或全部员工...
香港服务器最为受欢迎的原因之一是减去了繁琐步骤,相信大家都知道备案对于站长...
仍在蔓延的冠状病毒疫情使企业开展的数字化转型比以往更加重要,企业需要积极主...