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.
Logging§
Unit maintains a single general-purpose
log
for diagnostics and troubleshooting
(not to be confused with the
access log).
To find out its default location in your installation:
$ unitd -h unit options: ... --log FILE set log filename default: "/path/to/unit.log"
The --log
option overrides the default value;
if Unit is already running,
check whether this option is set:
$ ps ax | grep unitd ... unit: main v1.29.0 [/path/to/unitd ... --log /path/to/unit.log ...]
If Unit isn’t running,
see its system startup scripts or configuration files
to check if --log
is set,
and how.
Note
Mind that our Docker images forward their log output to the
Docker log collector
instead of a file.
Debug Log§
Unit’s log has two verbosity modes,
common and debug;
the steps to enable debug vary by install method.
Warning
Debug log is meant for developers;
it grows rapidly,
so enable it only for detailed reports and inspection.
Installing From Our Repos
Our
repositories
provide a debug version of unitd called unitd-debug
within the unit package:
# unitd-debug <command line options>
Running From Docker Images
To enable debug-level logging when using our
Docker images:
$ docker run -d nginx/unit:1.29.0-minimal unitd-debug --no-daemon --control unix:/var/run/control.unit.sock
Another option is adding a new layer in a Dockerfile:
FROM nginx/unit:1.29.0-minimal CMD ["unitd-debug","--no-daemon","--control","unix:/var/run/control.unit.sock"]
The CMD
instruction above
replaces the default unitd executable
with its debug version.
Building From Source
To enable debug-level logging when
installing from source,
use the --debug
option:
$ ./configure --debug <other options>
Then recompile and reinstall Unit
and your language modules of choice.
Core Dumps§
Core dumps help us investigate crashes;
attach them when
reporting an issue.
For builds from
our repositories,
we maintain debug symbols in special packages;
they have the original packages’ names with the -dbg
suffix appended,
such as unit-dbg
.
Note
This section assumes you’re running Unit as root
(recommended).
Linux: systemd
To enable saving core dumps
while running Unit as a systemd service
(for example, with
packaged installations),
adjust the
service settings
in /lib/systemd/system/unit.service
:
[Service] ... LimitCORE=infinity LimitNOFILE=65535
Alternatively,
update the
global settings
in /etc/systemd/system.conf
:
[Manager] ... DefaultLimitCORE=infinity DefaultLimitNOFILE=65535
Next,
reload the service configuration
and restart Unit
to reproduce the crash condition:
# systemctl daemon-reload # systemctl restart unit.service
After a crash,
locate the core dump file:
# coredumpctl -1 # optional TIME PID UID GID SIG COREFILE EXE Mon 2020-07-27 11:05:40 GMT 1157 0 0 11 present /usr/sbin/unitd # ls -al /var/lib/systemd/coredump/ # default, see also /etc/systemd/coredump.conf and /etc/systemd/coredump.conf.d/*.conf ... -rw-r----- 1 root root 177662 Jul 27 11:05 core.unitd.0.6135489c850b4fb4a74795ebbc1e382a.1157.1590577472000000.lz4
Linux: Manual Setup
Check the
core dump settings
in /etc/security/limits.conf
,
adjusting them if necessary:
root soft core 0 # disables core dumps by default root hard core unlimited # enables raising the size limit
Next, raise the core dump size limit with
ulimit,
then restart Unit
to reproduce the crash condition:
# ulimit -c unlimited # cd /path/to/unit/ # sbin/unitd # or sbin/unitd-debug
After a crash,
locate the core dump file:
# ls -al /path/to/unit/working/directory/ # default location, see /proc/sys/kernel/core_pattern ... -rw-r----- 1 root root 177662 Jul 27 11:05 core.1157
FreeBSD
Check the
core dump settings
in /etc/sysctl.conf
,
adjusting them if necessary:
kern.coredump=1 # must be set to 1 kern.corefile=/path/to/core/files/%N.core # must provide a valid pathname
Alternatively,
update the settings in runtime:
# sysctl kern.coredump=1 # sysctl kern.corefile=/path/to/core/files/%N.core
Next, restart Unit
to reproduce the crash condition.
If Unit is installed as a service:
If it’s installed manually:
# cd /path/to/unit/ # sbin/unitd
After a crash,
locate the core dump file:
# ls -al /path/to/core/files/ ... -rw------- 1 root root 9912320 Jul 27 11:05 unitd.core
Getting Support§
Support Channel | Details |
---|---|
GitHub | Visit our repo to submit issues, suggest features, ask questions, or see the roadmap. |
Mailing lists | To post questions to unit@nginx.org and get notifications, including release news, email unit-subscribe@nginx.org or sign up here. To receive all OSS release announcements from NGINX, join the general mailing list here. |
Security alerts | Please report security issues to security-alert@nginx.org, specifically mentioning NGINX Unit in the subject and following the CVSS v3.1 specification. |
In addition,
we offer commercial support.
Прошу помощи с решением проблемы.
Вероятно где-то ошибся и накосячил.
Мы меняем местами сервера — боевой и копию.
Чтобы хватало места под папку 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 и установить по новой не помогают.
Буду признателен за помощь!
I installed nginx on my Ubuntu 18.04. After that I made some changes in the default file. Now I am trying to start it but I am getting following error:
$ 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
nginx.service - A high performance web server and a reverse proxy
server Loaded: loaded (/lib/systemd/system/nginx.service; enabled;
vendor preset: en Active: failed (Result: exit-code) since Sat
2019-05-25 13:35:03 CDT; 19min a
Docs: man:nginx(8) Process: 3220 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code Process: 3219
ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process
May 25 13:35:01 lc2530hz nginx[3220]: nginx: [emerg] bind() to
0.0.0.0:80 failed May 25 13:35:01 lc2530hz nginx[3220]: nginx: [emerg] bind() to [::]:80 failed (9 May 25 13:35:02 lc2530hz nginx[3220]:
nginx: [emerg] bind() to 0.0.0.0:80 failed May 25 13:35:02 lc2530hz
nginx[3220]: nginx: [emerg] bind() to [::]:80 failed (9 May 25
13:35:02 lc2530hz nginx[3220]: nginx: [emerg] bind() to 0.0.0.0:80
failed May 25 13:35:02 lc2530hz nginx[3220]: nginx: [emerg] bind() to
[::]:80 failed (9 May 25 13:35:03 lc2530hz nginx[3220]: nginx: [emerg]
still could not bind() May 25 13:35:03 lc2530hz systemd[1]:
nginx.service: Control process exited, code May 25 13:35:03 lc2530hz
systemd[1]: nginx.service: Failed with result 'exit-cod May 25
13:35:03 lc2530hz systemd[1]: Failed to start A high performance web
serv lines 1-17/17 (END)
$ journalctl -xe
Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit phpsessionclean.service has finished starting up.
--
-- The start-up result is RESULT.
May 25 13:42:32 lc2530hz systemd[1]: Starting Message of the Day...
-- Subject: Unit motd-news.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit motd-news.service has begun starting up.
May 25 13:42:32 lc2530hz systemd[1]: Started Message of the Day.
-- Subject: Unit motd-news.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit motd-news.service has finished starting up.
--
-- The start-up result is RESULT.
May 25 13:42:53 lc2530hz org.gnome.Shell.desktop[1989]: (/usr/lib/firefox/firefo
May 25 13:42:58 lc2530hz systemd-resolved[782]: Server returned error NXDOMAIN,
May 25 13:47:19 lc2530hz /usr/lib/gdm3/gdm-x-session[1855]: (II) event5 - PixAr
lines 1576-1598/1598 (END)
$ nginx -t
nginx: [alert] could not open error log file: open()
"/var/log/nginx/error.log" failed (13: Permission denied) 2019/05/25
14:01:03 [warn] 3564#3564: the "user" directive makes sense only if
the master process runs with super-user privileges, ignored in
/etc/nginx/nginx.conf:1 nginx: the configuration file
/etc/nginx/nginx.conf syntax is ok 2019/05/25 14:01:03 [emerg]
3564#3564: open() "/run/nginx.pid" failed (13: Permission denied)
nginx: configuration file /etc/nginx/nginx.conf test failed
zulfi@lc2530hz:/etc/nginx/sites-enabled$
/etc/nginx/sites-enabled$ cat default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or WordPress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
Default server configuration
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
#
include snippets/snakeoil.conf;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
#server_name_;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/=404;
}
# pass PHP scripts to FastCGI server
# location ~ .php$ {
# include snippets/fastcgi-php.conf;
#
# With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one #
#location ~ /.ht {
# deny all;
#}
}
# 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 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#} user@lc2530hz:/etc/nginx/sites-enabled$
Somebody please guide me how to restart the nginx.