skip to Main Content

This is what it brings when you check nginx status

[root@ttproxyapp conf.d]# service nginx status
Redirecting to /bin/systemctl status nginx.service
● nginx.service - nginx - high performance web server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

3

Answers


  1. It realy looks like your NGINX ins’t running. nginx -s reload is just working if there is a running instance and therfore a PID-file.

    Please check the result of the following command.

    [root@localhost conf.d]# sudo ps -elf | grep nginx
    

    Should be something like

    1 S root      88262      1  0  80   0 - 13143 sigsus 23:47 ?        00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    5 S nginx     88263  88262  0  80   0 - 13257 ep_pol 23:47 ?        00:00:00 nginx: worker process
    0 R root      88265  69227  0  80   0 - 28178 -      23:47 pts/1    00:00:00 grep --color=auto nginx
    

    You need at least! the master process and the worker process! If there is no process start your instance by typing

    sudo /bin/systemctl start nginx.service OR sudo service nginx start

    Check your processlist after running the command.

    After you have started the NGINX service there should be PID-file located at
    /var/run/nginx.pid and sudo systemctl status nginx.service should printout something like

    [root@localhost conf.d]# systemctl status nginx.service
    ● nginx.service - NGINX Plus - high performance web server
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
       Active: active (running) since Sat 2020-03-14 23:47:13 EDT; 5min ago
         Docs: https://www.nginx.com/resources/
      Process: 88232 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
      Process: 88260 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
      Process: 88251 ExecStartPre=/usr/libexec/nginx-plus/check-subscription (code=exited, status=0/SUCCESS)
     Main PID: 88262 (nginx)
        Tasks: 2
       Memory: 1.7M
       CGroup: /system.slice/nginx.service
               ├─88262 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
               └─88263 nginx: worker process
    
    Mar 14 23:47:13 localhost.localdomain systemd[1]: Starting NGINX Plus - high performance web server...
    Mar 14 23:47:13 localhost.localdomain systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory
    Mar 14 23:47:13 localhost.localdomain systemd[1]: Started NGINX Plus - high performance web server.
    

    I am running NGINX Plus but it doesn’t matter in this case.

    Login or Signup to reply.
  2. sudo systemctl stop apache2
    sudo systemctl start nginx
    

    should work since looks like the port is in use (with apache probably)

    Login or Signup to reply.
  3. there is maybe an apache server running. you must stop that apache server order run the Nginx server.

    sudo systemctl stop apache2

    sudo systemctl start nginx

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search