Failed to start The nginx HTTP and reverse proxy server issue

  • 9,000
  • Tác giả: admin
  • Ngày đăng:
  • Lượt xem: 9
  • Tình trạng: Còn hàng

First time I'm stalling nginx server in my fedora 24. I'm using apache server for development. For onlyoffice integration I have lớn install nginx server. I installed nginx server by using this command dnf install nginx

Before starting nginx server I stopped apache and disabled it also lượt thích below.

systemctl stop httpd
systemctl disable httpd

If I start the nginx server sudo service nginx start I'm getting below error.

Redirecting lớn /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.

So I ran the systemctl status nginx.service command lớn know issue detail, I got below output in my terminal.

[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 trăng tròn 01:45:57 localhost.localdomain systemd[1]: Starting The nginx HTTP and reverse proxy server...
Oct trăng tròn 01:45:57 localhost.localdomain nginx[10719]: nginx: [emerg] no port in upstream "php-fpm" in /etc/nginx/default.d/phpMyAdmin.conf:17
Oct trăng tròn 01:45:57 localhost.localdomain nginx[10719]: nginx: configuration tệp tin /etc/nginx/nginx.conf test failed
Oct trăng tròn 01:45:57 localhost.localdomain systemd[1]: nginx.service: Control process exited, code=exited status=1
Oct trăng tròn 01:45:57 localhost.localdomain systemd[1]: Failed lớn start The nginx HTTP and reverse proxy server.
Oct trăng tròn 01:45:57 localhost.localdomain systemd[1]: nginx.service: Unit entered failed state.
Oct trăng tròn 01:45:57 localhost.localdomain systemd[1]: nginx.service: Failed with result 'exit-code'.

I tried several ways lớn fix by changing the listen 80 lớn listen 801 in /etc/nginx/nginx.conf but no issue. I followed the below urls also but I can't fix the issue.

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
     }
}

Thanks in advance.