我第一次在我的fedora 24中停止nginx服务器。我正在使用apache服务器进行开发。对于onlyoffice集成,我必须安装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
}
}
提前致谢。
答案 0 :(得分:1)
回答我的问题,因为@mattdm建议,我安装了php-fpm,现在它已经开始工作了。
sudo dnf install php-fpm
答案 1 :(得分:0)
我有相同的日志错误消息。问题出在 nginx/conf.d/configuration.conf 我测试了每个配置,在我删除 #Enable WordPress Permananent Links 配置后,n