【发布时间】:2017-03-01 15:58:41
【问题描述】:
我第一次在我的 fedora 24 中停止 nginx 服务器。我正在使用 apache 服务器进行开发。对于 onlyoffice 集成,我必须安装 nginx 服务器。我使用这个命令安装了 nginx 服务器 dnf install nginx
在启动 nginx 服务器之前,我停止了 apache 并将其禁用,如下所示。
systemctl stop httpd
systemctl disable httpd
如果我启动 nginx 服务器 sudo service nginx start 我会遇到以下错误。
Redirecting to /bin/systemctl start nginx.service
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
所以我运行systemctl status nginx.service 命令来了解问题详细信息,我在终端中得到以下输出。
[root@localhost ~]# systemctl -l status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-10-20 01:45:57 IST; 10s ago
Process: 10719 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 10709 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
Oct 20 01:45:57 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct 20 01:45:57 localhost.localdomain nginx[10719]: nginx: [emerg] no port in upstream "php-fpm" in /etc/nginx/default.d/phpMyAdmin.conf:17
Oct 20 01:45:57 localhost.localdomain nginx[10719]: nginx: configuration file /etc/nginx/nginx.conf test failed
Oct 20 01:45:57 localhost.localdomain systemd[1]: nginx.service: Control process exited, code=exited status=1
Oct 20 01:45:57 localhost.localdomain systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Oct 20 01:45:57 localhost.localdomain systemd[1]: nginx.service: Unit entered failed state.
Oct 20 01:45:57 localhost.localdomain systemd[1]: nginx.service: Failed with result 'exit-code'.
我尝试了几种修复方法,将 /etc/nginx/nginx.conf 中的 listen 80 更改为 listen 801,但没有问题。我也遵循了以下网址,但我无法解决问题。
nginx not started and can't start
https://serverfault.com/questions/717752/cant-start-nginx-code-exited-status-1-failure
/etc/nginx/default.d/phpMyAdmin.conf
# phpMyAdmin
location = /phpMyAdmin {
alias /usr/share/phpMyAdmin/;
}
location /phpMyAdmin/ {
root /usr/share;
index index.php index.html;
location ~ ^/phpMyAdmin/(.+\.php)$
{
try_files $uri =404;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php-fpm; //this is line number 17
}
}
提前致谢。
【问题讨论】:
-
我对这个特定问题了解不多,无法提供进一步帮助,但请注意,日志输出会将您指向要调查的特定问题:
Oct 20 01:45:57 localhost.localdomain nginx[10719]: nginx: [emerg] no port in upstream "php-fpm" in /etc/nginx/default.d/phpMyAdmin.conf:17 -
@mattdm 感谢您的回复。我检查了那个文件,但我没有得到。所以我在我的问题中添加了该文件内容。请检查