Applicable to:
- Plesk for Linux
Symptoms
-
After enabling nginx with the command
plesk sbin nginxmng -e
, it is failed to start:# service nginx status
● nginx.service - Startup script for nginx service
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Cts 2018-02-10 18:54:45 +03; 10s ago
nginx[11996]: nginx: [emerg] bind() to 203.0.113.2:80 failed (98: Address already in use)
nginx[11996]: nginx: [emerg] bind() to 192.0.2.2:80 failed (98: Address already in use)
nginx[11996]: nginx: [emerg] bind() to 203.0.113.2:443 failed (98: Address already in use)
nginx[11996]: nginx: [emerg] bind() to 192.0.2.2:443 failed (98: Address already in use)
nginx[11996]: nginx: [emerg] still could not bind()
systemd[1]: nginx.service: control process exited, code=exited status=1
systemd[1]: Failed to start Startup script for nginx service.
systemd[1]: Unit nginx.service entered failed state.
systemd[1]: nginx.service failed. -
Apache listens both on backend ports (7080 and 7081) and on the frontend ones (80 and 443):
# netstat -tulpn | grep 80
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 1121/sw-cp-server:
tcp6 0 0 :::80 :::* LISTEN 11876/httpd
tcp6 0 0 :::8880 :::* LISTEN 1121/sw-cp-server:
tcp6 0 0 :::7080 :::* LISTEN 11876/httpd# netstat -tulpn | grep 7081
tcp6 0 0 :::7081 :::* LISTEN 11876/httpd# netstat -tulpn | grep 443
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 1121/sw-cp-server:
tcp6 0 0 :::443 :::* LISTEN 11876/httpd
tcp6 0 0 :::8443 :::* LISTEN 1121/sw-cp-server: -
After repairing the web servers configuration with the command
plesk repair web
, the issue still persists. -
In the Apache configuration directory, the configuration file
/etc/httpd/conf.d/~lxcenter.conf
, which contains the following lines at the end of it:CONFIG_TEXT: Include /opt/configs/apache/conf/defaults/*.conf
Include /opt/configs/apache/conf/domains/*.conf
Include /opt/configs/apache/conf/customs/*.conf -
One of the configuration files at the mentioned locations contain instructions for Apache to listen on port 80 and 443.
Cause
Third-party hosting panel Kloxo (or one of its forks) was previously installed on the server, and its configuration files were not fully removed.
Resolution
-
Connect to the server using SSH.
-
Rename the found configuration file:
# mv /etc/httpd/conf.d/~lxcenter.conf{,.bak}
-
Restart Apache to apply changes (on Debian and Ubuntu, the service is called
apache2
):# service httpd restart
-
Start nginx:
# service nginx start
Comments
0 comments
Please sign in to leave a comment.