Nginx job for nginx service failed because the control process exited with error code

nginx.service failed because the control process exited $ systemctl status nginx.service nginx.service - Startup script for nginx service Loaded: loaded (/usr/lib/systemd/system/nginx.service;

The cause of the issue is this, I already had Apache web server installed and actively listening on port 80 on my local machine.

Apache and Nginx are the two major open-source high-performance web servers capable of handling diverse workloads to satisfy the needs of modern web demands. However, Apache serves primarily as a HTTP server whereas Nginx is a high-performance asynchronous web server and reverse proxy server.

The inability of Nginx to start was because Apache was already listening on port 80 as its default port, which is also the default port for Nginx.

One quick workaround would be to stop Apache server by running the command below

systemctl stop apache2
systemctl status apache2

And then starting up Nginx server by running the command below

systemctl stop nginx
systemctl status nginx

However, this same issue will arise again when we try to start Apache server again, since they both use port 80 as their default port.

Here’s how I fixed it:

Run the command below to open the default configuration file of Nginx in Nano editor

sudo nano /etc/nginx/sites-available/default

When the file opens in Nano editor, scroll down and change the default server port to any port of your choice. For me, I chose to change it to port 85

# Default server configuration
#
server {
       listen 85 default_server;
       listen [::]:85 default_server;

Also, scroll down and change the virtual host port to any port of your choice. For me, I also chose to change it to port 85

# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
# server {
#        listen 85;
#        listen [::]:85;

Then save and exit the file by pressing on your keyboard:

Ctrl + S
Ctrl + X

You may still be prompted to press Y on your keyboard to save your changes.

Finally, confirm that your configuration is correct and restart the Nginx server:

sudo nginx -t
sudo systemctl restart nginx

You can now navigate to localhost:nginx-port (localhost:85) on your browser to confirm the changes.

Displaying the default Nginx start page

If you want the default Nginx start page to show when you navigate to localhost:nginx-port (localhost:85) on your browser, then follow these steps:

Examine the directory /var/www/html/ which is the default root directory for both Apache and Nginx by listing its contents:

cd ~
ls /var/www/html/

You will 2 files listed in the directory:

index.html                # Apache default start page
index.nginx-debian.html   # Nginx default start page

Run the command below to open the default configuration file of Nginx in Nano editor:

cd ~
sudo nano /etc/nginx/sites-available/default

Change the order of the index files in the root directory from this:

root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

to this (putting the default Nginx start page — index.nginx-debian.html in the 2nd position immediately after index):

root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.nginx-debian.html index.html index.htm;

Then save and exit the file by pressing on your keyboard:

Ctrl + S
Ctrl + X

You may still be prompted to press Y on your keyboard to save your changes.

Finally, confirm that your configuration is correct and restart the Nginx server:

sudo nginx -t
sudo systemctl restart nginx

You can now navigate to localhost:nginx-port (localhost:85) on your browser to confirm the changes.

I have a digitalocean droplet with Ubuntu 16.04 running on it. I am serving mostly static sites from it with Nginx, but it suddenly stopped working.

(As you might understand from this intro, I am quite the beginner at all of this.)

I’ve tried to restart nginx:

$ sudo service nginx restart
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:

$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-04-25 12:31:46 UTC; 55s ago
     Docs: man:nginx(8)
  Process: 8232 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 8221 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)

journalctl -xe

    $ sudo journalctl -u nginx
    - Logs begin at Thu 2019-03-21 01:07:26 UTC, end at Thu 2019-04-25 12:54:26 UTC. --
Apr 25 10:33:29 ubuntu-s-michaelsimsoe systemd[1]: Stopping A high performance web server and a reverse proxy server...
Apr 25 10:33:29 ubuntu-s-michaelsimsoe systemd[1]: Stopped A high performance web server and a reverse proxy server.
-- Reboot --
Apr 25 10:34:16 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 10:34:17 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:17 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:18 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 10:34:19 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 10:34:20 ubuntu-s-michaelsimsoe nginx[1242]: nginx: [emerg] still could not bind()
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 10:34:20 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:08:48 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:08:48 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:48 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:49 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:08:50 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:08:51 ubuntu-s-michaelsimsoe nginx[21464]: nginx: [emerg] still could not bind()
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 12:08:51 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:10:24 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:25 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:26 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:10:27 ubuntu-s-michaelsimsoe nginx[25175]: nginx: [emerg] still could not bind()
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Control process exited, code=exited status=1
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: nginx.service: Failed with result 'exit-code'.
Apr 25 12:10:27 ubuntu-s-michaelsimsoe systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Apr 25 12:12:59 ubuntu-s-michaelsimsoe systemd[1]: Starting A high performance web server and a reverse proxy server...
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Apr 25 12:12:59 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Apr 25 12:13:00 ubuntu-s-michaelsimsoe nginx[30965]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

The following have been done by me before I noticed the errors:
* Changed root password
* Changed password for user michaels
* Changed ownership of website folders (I’m trying to set up webhooks)

Any thoughts on what it might be?

EDIT: some additional information

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

$ ps -A | nginx
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2019/04/25 13:09:32 [warn] 28351#28351: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2019/04/25 13:09:32 [emerg] 28351#28351: BIO_new_file("/etc/letsencrypt/live/huske.michaelsimsoe.no/fullchain.pem") failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/letsencrypt/live/huske.michaelsimsoe.no/fullchain.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)

Before I installed nginx I had som pages served by Apache. I can reach these still.

So you’ve got two things which are in conflict and have led it seems to the nginx binaries going away somehow: Xenial repository version, and the NGINX PPA. As the maintainer of both, allow me to explain the conflict.

In Xenial, we released 1.10.0 just after release as an update. This update pushed us to a ‘stable’ branch but didn’t have dynamically-loadable modules built and made available. This was due to time but also build conflicts that arose during tests. We eventually got dynamic module support working, in Zesty.

In the PPA, we’ve always cloned directly from Debian. That means, we always had Debian’s ‘dynamic module’ support, which conflicted with the Xenial packages and resulted in some installation and upgrade conflicts.


There’s a small conflict here — you can’t mix-and-match nginx-core (which is the default flavor installed for the nginx package in Ubuntu) and the PPAs, as it sometimes makes things disappearify. The problem here, then, is we need to remove the existing Ubuntu package and then install from the PPA only.

To resolve this, you’ll first need to back up your nginx configurations you want to keep for your sites. That is, make a copy of your /etc/nginx/sites-available/ directory somewhere else (even in your user’s home directory is fine, we just need a copy of the site configurations). As well, we’ll need a backup of your website data, so copy that somewhere else as well (NOT in the standard docroot, so it doesn’t get messed up).

Once you make the copy, you’ll have to remove the existing nginx packages. This can be done with the following command:

sudo apt-get remove nginx nginx-common nginx-doc nginx-core nginx-full nginx-extras nginx-light

Once that is complete, run sudo apt-get update again just to make sure we have the most up to date version numberings.

Then, install nginx from the PPA — sudo apt-get install nginx nginx-full nginx-common should do this.

You should no longer be getting failed to start errors. Make sure your site configurations are still in place, and didn’t get overwritten. If they did, restore from the backups we took earlier of the site config and the site data. Otherwise, you’re all set.

Прошу помощи с решением проблемы.
Вероятно где-то ошибся и накосячил.
Мы меняем местами сервера — боевой и копию.
Чтобы хватало места под папку upload (на боевом нет возможности расширить).
Попробовали добавить поддомен на копию (была some.copy.site.ru —  добавили some.copy2.site.ru), чтобы потом some.copy.site.ru перенести туда где сейчас боевой, а some.copy2.site.ru заменить на some.site.ru — сделать боевым.
Стали отрываться оба поддомена ведущий на один портал. Один по https, другой по http.
При попытке добавить SSL на второй поддомен — всё сломалось.

Теперь nginx не стартует.

# 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

● nginx.service — nginx — high performance web server

  Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)

  Active: failed (Result: exit-code) since Fri 2022-01-07 13:02:55 +04; 46s ago

    Docs: http://nginx.org/en/docs/

 Process: 11094 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Jan 07 13:02:55 centos-79-64-minimal systemd[1]: Starting nginx — high performance web server…

Jan 07 13:02:55 centos-79-64-minimal nginx[11094]: nginx: [emerg] cannot load certificate «/etc/letsencrypt/live/some….

Jan 07 13:02:55 centos-79-64-minimal nginx[11094]: nginx: configuration file /etc/nginx/nginx.conf test failed

Jan 07 13:02:55 centos-79-64-minimal systemd[1]: nginx.service: control process exited, code=exited status=1

Jan 07 13:02:55 centos-79-64-minimal systemd[1]: Failed to start nginx — high performance web server.

Jan 07 13:02:55 centos-79-64-minimal systemd[1]: Unit nginx.service entered failed state.

Jan 07 13:02:55 centos-79-64-minimal systemd[1]: nginx.service failed.

Hint: Some lines were ellipsized, use -l to show in full.

# journalctl -xe

— Unit session-178.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal systemd[1]: Started Session 179 of user root.

— Subject: Unit session-179.scope has finished start-up

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit session-179.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal systemd[1]: Started Session 180 of user bitrix.

— Subject: Unit session-180.scope has finished start-up

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit session-180.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal CROND[11297]: (root) CMD (/opt/webdir/bin/restart_httpd-scale.sh process)

Jan 07 13:05:01 centos-79-64-minimal CROND[11298]: (root) CMD (/opt/webdir/bin/update_network.sh eno1)

Jan 07 13:05:01 centos-79-64-minimal CROND[11299]: (bitrix) CMD (test -f /home/bitrix/www/bitrix/modules/main/tools/cronJan 07 13:05:01 centos-79-64-minimal CROND[11300]: (bitrix) CMD (/usr/bin/php -f /home/bitrix/www/bitrix/php_interface/cJan 07 13:05:01 centos-79-64-minimal systemd[1]: Removed slice User Slice of bitrix.

— Subject: Unit user-600.slice has finished shutting down

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit user-600.slice has finished shutting down.

Jan 07 13:05:05 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:07 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:08 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:09 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:12 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:16 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:17 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:18 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:21 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:22 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:26 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:27 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:31 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:31 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:35 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:aJan 07 13:05:39 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:alines 2397-2445/2445 (END)

— Unit session-178.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal systemd[1]: Started Session 179 of user root.

— Subject: Unit session-179.scope has finished start-up

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit session-179.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal systemd[1]: Started Session 180 of user bitrix.

— Subject: Unit session-180.scope has finished start-up

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit session-180.scope has finished starting up.

— The start-up result is done.

Jan 07 13:05:01 centos-79-64-minimal CROND[11297]: (root) CMD (/opt/webdir/bin/restart_httpd-scale.sh process)

Jan 07 13:05:01 centos-79-64-minimal CROND[11298]: (root) CMD (/opt/webdir/bin/update_network.sh eno1)

Jan 07 13:05:01 centos-79-64-minimal CROND[11299]: (bitrix) CMD (test -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php && { /usr/bin/php -f /home/bitrix/www/bitrix/modules/main/tools/cron_events.php; } >/dev/null 2>&1)

Jan 07 13:05:01 centos-79-64-minimal CROND[11300]: (bitrix) CMD (/usr/bin/php -f /home/bitrix/www/bitrix/php_interface/cron_events.php)

Jan 07 13:05:01 centos-79-64-minimal systemd[1]: Removed slice User Slice of bitrix.

— Subject: Unit user-600.slice has finished shutting down

— Defined-By: systemd

— Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

— Unit user-600.slice has finished shutting down.

Jan 07 13:05:05 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=36237 PROTO=TCP SPT=55875 DPT=21583 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:07 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=79.124.62.78 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=248 ID=7191 PROTO=TCP SPT=58659 DPT=63767 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:08 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=35939 PROTO=TCP SPT=55875 DPT=48721 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:09 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=36237 PROTO=TCP SPT=55875 DPT=21583 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:12 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.196.61 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=248 ID=31284 PROTO=TCP SPT=50389 DPT=3404 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=35939 PROTO=TCP SPT=55875 DPT=48721 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=45.143.203.12 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=249 ID=10514 PROTO=TCP SPT=45923 DPT=44393 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:13 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=36237 PROTO=TCP SPT=55875 DPT=21583 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:16 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.86 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=64158 PROTO=TCP SPT=45993 DPT=48560 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:17 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=35939 PROTO=TCP SPT=55875 DPT=48721 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:18 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=55945 PROTO=TCP SPT=55875 DPT=33344 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:21 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=35939 PROTO=TCP SPT=55875 DPT=48721 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:22 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=55945 PROTO=TCP SPT=55875 DPT=33344 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:26 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=26020 PROTO=TCP SPT=55875 DPT=43080 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:27 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=55945 PROTO=TCP SPT=55875 DPT=33344 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:31 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=26020 PROTO=TCP SPT=55875 DPT=43080 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:31 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=55945 PROTO=TCP SPT=55875 DPT=33344 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:35 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=26020 PROTO=TCP SPT=55875 DPT=43080 WINDOW=1024 RES=0x00 SYN URGP=0

Jan 07 13:05:39 centos-79-64-minimal kernel: Firewall: *TCP_IN Blocked* IN=eno1 OUT= MAC=24:4b:fe:b9:3e:2c:b4:8a:5f:36:a7:92:08:00 SRC=92.63.197.5 DST=162.55.239.104 LEN=40 TOS=0x00 PREC=0x00 TTL=250 ID=26020 PROTO=TCP SPT=55875 DPT=43080 WINDOW=1024 RES=0x00 SYN URGP=0

# nginx -t

nginx: [emerg] cannot load certificate «/etc/letsencrypt/live/some.copy2.site.ru/fullchain.pem»: BIO_new_file() failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/etc/letsencrypt/live/some.copy2.site.ru/fullchain.pem’,’r’) error:2006D080:BIO routines:BIO_new_file:no such file)

nginx: configuration file /etc/nginx/nginx.conf test failed

Попытки переименовать WWW в папке HOME и установить по новой не помогают.

Буду признателен за помощь!

Question 1: What is the problem?

  • What is the expected behavior?

I’m trying to install Passenger + nginx on Ubuntu 18.04 following the instructions on https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/aws/nginx/oss/bionic/install_passenger.html. On Step 2 when I run sudo service nginx restart nginx service should be restarted successfully.

  • What is the actual behavior?

But instead it gives

Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
  • How can we reproduce it?

I’ve just launch a new AWS EC2 instance (type t3.micro) with Ubuntu Server 18.04 LTS (HVM), SSD Volume Type — ami-0ac019f4fcb7cb7e6 (64-bit x86).

Then run sudo apt update and sudo apt upgrade.

I’ve installed Ruby 2.5.3 using rbenv and then tried to install Passenger using instructions from https://www.phusionpassenger.com/library/walkthroughs/deploy/ruby/aws/nginx/oss/bionic/install_passenger.html.

Step 1 went ok and step 2 was looking good until discover that nginx service is failing to running.

Also, when I run:

sudo /usr/bin/passenger-config validate-install it displays:

What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'

 ‣ ⬢  Passenger itself
   ⬡  Apache

Which is odd, because I’ve installed libnginx-mod-http-passenger and not libapache2-mod-passenger.

If I select both I get:

 * Checking whether this Passenger install is in PATH... ✓
 * Checking whether there are no other Passenger installations... ✓
 * Checking whether Apache is installed... ✗

   Apache is not installed. You can solve this as follows:
   
   Please install it with apt-get install apache2

And this is result from running sudo /usr/sbin/passenger-memory-stats

Version: 6.0.1
Date   : 2019-02-14 16:22:18 +0000
------------- Apache processes -------------
*** WARNING: The Apache executable cannot be found.
Please set the APXS2 environment variable to your 'apxs2' executable's filename, or set the HTTPD environment variable to your 'httpd' or 'apache2' executable's filename.


-------- Nginx processes --------

### Processes: 0
### Total private dirty RSS: 0.00 MB


--- Passenger processes ---

### Processes: 0
### Total private dirty RSS: 0.00 MB

Question 2: Passenger version and integration mode:

Open source 6.0.1/nginx

Question 3: OS or Linux distro, platform (including version):

Ubuntu 18.04 from AWS AMI ami-0ac019f4fcb7cb7e6

Question 4: Passenger installation method:

[ ] RubyGems + Gemfile
[ ] RubyGems, no Gemfile
[X] Phusion APT repo
[ ] Phusion YUM repo
[ ] OS X Homebrew
[ ] source tarball
[ ] Other, please specify:

**Question 5: Your app’s programming language (including any version managers) and framework

rbenv Ruby 2.5.3, Node.js 8.10.0

Question 6: Are you using a PaaS and/or containerization? If so which one?

No

Question 7: Anything else about your setup that we should know?

I don’t know. Ask me ;)

uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

nginx незапускается

Сильно не пинайте
хотел увеличить
upload_max_filesize =

залез php.ini
запустил перезагрузку и сайты легли

потом заменил обратно файл php.ini но nginx не в какую не грузиться и сайты лежат тока панель работает

команда
[root@a1775112 ~]# 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.

команда
[root@a1775112 ~]# systemctl status nginx.service
● nginx.service — The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─limits.conf
Active: failed (Result: exit-code) since Thu 2018-06-28 22:17:29 CEST; 1min 33s ago
Process: 858 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 849 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

Jun 28 22:17:29 a1775112.example.com systemd[1]: Starting The nginx HTTP and reverse proxy server…
Jun 28 22:17:29 a1775112.example.com nginx[858]: nginx: [emerg] open() «/home/admin/conf/web/p…:59
Jun 28 22:17:29 a1775112.example.com nginx[858]: nginx: configuration file /etc/nginx/nginx.co…led
Jun 28 22:17:29 a1775112.example.com systemd[1]: nginx.service: control process exited, code=e…s=1
Jun 28 22:17:29 a1775112.example.com systemd[1]: Failed to start The nginx HTTP and reverse pr…er.
Jun 28 22:17:29 a1775112.example.com systemd[1]: Unit nginx.service entered failed state.
Jun 28 22:17:29 a1775112.example.com systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


imperio

VestaCP Team
Posts: 6987
Joined: Sat Dec 01, 2012 12:37 pm
Contact:

Re: nginx незапускается

Post

by imperio » Thu Jun 28, 2018 8:27 pm

Укажите ОС и используемый веб-стек

Code: Select all

Jun 28 22:17:29 a1775112.example.com nginx[858]: nginx: [emerg] open() "/home/admin/conf/web/p...:59

Не полная строка


uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

Re: nginx незапускается

Post

by uadesign » Thu Jun 28, 2018 8:33 pm

к сожалению Bitvise SSH Client тока так показывает
через что еще можно зайти?


imperio

VestaCP Team
Posts: 6987
Joined: Sat Dec 01, 2012 12:37 pm
Contact:

Re: nginx незапускается

Post

by imperio » Thu Jun 28, 2018 8:38 pm

putty к примеру. Попробуйте окно терминала расширить


uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

Re: nginx незапускается

Post

by uadesign » Thu Jun 28, 2018 8:45 pm

● nginx.service — The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/nginx.service.d
└─limits.conf
Active: failed (Result: exit-code) since Thu 2018-06-28 22:41:07 CEST; 3min 57s ago
Process: 868 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Process: 860 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)

Jun 28 22:41:07 a1775112.example.com systemd[1]: Starting The nginx HTTP and reverse proxy server…
Jun 28 22:41:07 a1775112.example.com nginx[868]: nginx: [emerg] open() «/home/admin/conf/web/
Jun 28 22:41:07 a1775112.example.com nginx[868]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 28 22:41:07 a1775112.example.com systemd[1]: nginx.service: control process exited, code=exited status=1
Jun 28 22:41:07 a1775112.example.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Jun 28 22:41:07 a1775112.example.com systemd[1]: Unit nginx.service entered failed state.
Jun 28 22:41:07 a1775112.example.com systemd[1]: nginx.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

Last edited by uadesign on Thu Jun 28, 2018 9:34 pm, edited 1 time in total.


uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

Re: nginx незапускается

Post

by uadesign » Thu Jun 28, 2018 8:46 pm

еще я поменял в настройках домена в панеле

Шаблон Web:
wordpress2_rewrite

Backend Support:
да

Поддержка SSL:
Lets Encrypt

Шаблон Backend:
socket

если это влияет конечно


imperio

VestaCP Team
Posts: 6987
Joined: Sat Dec 01, 2012 12:37 pm
Contact:

Re: nginx незапускается

Post

by imperio » Thu Jun 28, 2018 8:57 pm

По ОС, версии панели Вы так и не ответили. Используют ли домены https соединение
Скиньте содержимое файла шаблона

Code: Select all

/usr/local/vesta/data/templates/web/nginx/php5-fpm/wordpress2_rewrite.tpl
/usr/local/vesta/data/templates/web/nginx/php5-fpm/wordpress2_rewrite.stpl


uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

Re: nginx незапускается

Post

by uadesign » Thu Jun 28, 2018 8:58 pm

CentOS-7-amd64

Версия:
0.9.8 (x86_64)

Релиз:
22

Поддержка SSL:
Lets Encrypt

Last edited by uadesign on Thu Jun 28, 2018 9:04 pm, edited 2 times in total.


uadesign

Posts: 15
Joined: Thu Nov 23, 2017 10:55 am

Re: nginx незапускается

Post

by uadesign » Thu Jun 28, 2018 9:01 pm

wordpress2_rewrite.tpl

Code: Select all

server {
    listen      %ip%:%web_port%;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;
    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;
        
        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /index.php?q=$1 last;
        }

        location ~* ^.+.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/].php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location ~* "/.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   %home%/%user%/web/%domain%/stats/;
        include %home%/%user%/conf/web/%domain%.auth;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}

wordpress2_rewrite.stpl

Code: Select all

server {
    listen      %ip%:%web_ssl_port%;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location / {
        try_files $uri $uri/ /index.php?$args;

        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /index.php?q=$1 last;
        }

        location ~* ^.+.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/].php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location ~* "/.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   %home%/%user%/web/%domain%/stats/;
        include %home%/%user%/conf/web/%domain%.auth;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
} 



Понравилась статья? Поделить с друзьями:
  • Nginx error too many redirects
  • Nginx error the page you are looking for is temporarily unavailable please try again later
  • Nginx error page location
  • Nginx error page css
  • Nginx error page 502