Skip to main content

111: Connection refused

Comments

11 comments

  • cPRex Jurassic Moderator

    Hey there!  My first guess with this issue is always a firewall configuration, as you'd want to make sure the additional ports are opened for access.  If it's critical that the site be online, it would be simplest to switch back to just Apache while you troubleshoot possible connection issues.

    Are you able to telnet to port 444 on that machine from your local system?  That would confirm the network connection is open and accepting requests.

    0
  • Boris Goncharov

    telnet 127.0.0.1 444
    Trying 127.0.0.1...
    telnet: connect to address 127.0.0.1: Connection refused

    It's AlmaLinux. Checked iptables. No rules. Firewalld is inactive. How to open this port?

    0
  • cPRex Jurassic Moderator

    Thanks for that information - I'm assuming that test was performed while Nginx was installed?  If so, this page explains how to open ports:

    https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-configure-your-firewall-for-cpanel-services/

    although many admins find a tool such as CSF easier to use and maintain.

    0
  • Boris Goncharov

    I have added 444 port in the nftables and save the conf file:

    nft add rule inet filter INPUT tcp dport 444 accept

    After reboot there are no changes. Still:

    telnet 127.0.0.1 444
    telnet: connect to address 127.0.0.1: Connection refused

    0
  • cPRex Jurassic Moderator

    I wouldn't expect the firewall to matter at all if you're connecting from localhost as a test.

    Just to confirm, what is the output from this command:

    netstat -lpn | grep 444
    0
  • Boris Goncharov

    It's empty, no results, as for port 81 either, but 443 and 80 are opened.

     

     

     

    0
  • cPRex Jurassic Moderator

    You'd want to be doing all your network testing when Nginx is installed and running, or else nothing will be listening on that port to accept a response.

     

    0
  • Boris Goncharov

    It is tested on the profile "cPanel Default NGINX®" installed and active, as I mentioned in the start of the topic. Checked it again. That's why I'm here. I have no idea why whatever port is in the $CPANEL_APACHE_PROXY_SSL_PORT like 444 or 8443, etc. it's leading to the same error. Even with the nftables updated the same 502 here:

    2025/02/25 21:06:08 [error] 1490#1490: *60 connect() failed (111: Connection refused) while connecting to upstream, client: 17.241.***.***, server: ***.com, request: "GET /produit/peigne-fleurs-sechees-bleues-chloe/ HTTP/1.1", upstream: "https://51.75.**.**:444/produit/peigne-fleurs-sechees-bleues-chloe/", host: "www.***.com"

     

     

    0
  • cPRex Jurassic Moderator

    It would be best to create a ticket at this point as it seems there could be multiple things happening that are leading to this not working as expected.

    0
  • Boris Goncharov

    I have noticed that provisioning process ended up with error. Maybe here is the glue:

    [2025-02-25 21:30:52 +0000] info [xml-api] Configuration problem detected on line 220 of file /etc/apache2/conf/httpd.conf.work.80de5f77:    RemoteIP: Error parsing IP packer.cpanel.ovh (Name or service not known error) for RemoteIPInternalProxy
    [2025-02-25 21:30:52 +0000] info [xml-api]     --- /etc/apache2/conf/httpd.conf.work.80de5f77 ---
    [2025-02-25 21:30:52 +0000] info [xml-api]     214# This allows us to not log requests proxied to Apache from nginx;
    [2025-02-25 21:30:52 +0000] info [xml-api]     215#    That way hits are not double recorded.
    [2025-02-25 21:30:52 +0000] info [xml-api]     216SetEnvIf cPanel-localhost McB9exxKAIHJPv7Yw2ly2kETfOUXWhBIkKcDMT38eBHldGyEXfynZQw-9N6AKJ1L isproxyrequest
    [2025-02-25 21:30:52 +0000] info [xml-api]     217RequestHeader unset cPanel-localhost
    [2025-02-25 21:30:52 +0000] info [xml-api]     218<IfModule remoteip_module>
    [2025-02-25 21:30:52 +0000] info [xml-api]     219    RemoteIPHeader X-Forwarded-For-McB9exxKAIHJPv7Yw2ly2kETfOUXWhBIkKcDMT38eBHldGyEXfynZQw-9N6AKJ1L
    [2025-02-25 21:30:52 +0000] info [xml-api]     220 ===>     RemoteIPInternalProxy packer.cpanel.ovh <===
    [2025-02-25 21:30:52 +0000] info [xml-api]     221    RemoteIPInternalProxy 51.75.**.**
    [2025-02-25 21:30:52 +0000] info [xml-api]     222    RequestHeader unset X-Forwarded-For-McB9exxKAIHJPv7Yw2ly2kETfOUXWhBIkKcDMT38eBHldGyEXfynZQw-9N6AKJ1L
    [2025-02-25 21:30:52 +0000] info [xml-api]     223</IfModule>

    And then:

    [2025-02-25 21:30:52 +0000] info [xml-api] Waiting for “httpd” to start ………Waiting for httpd,litespeed,lscgid to shutdown ... not running.
    [2025-02-25 21:30:52 +0000] info [xml-api] ……failed.
    [2025-02-25 21:30:52 +0000] info [xml-api] Cpanel::Exception::Services::StartError
    [2025-02-25 21:30:52 +0000] info [xml-api] Service Status
    [2025-02-25 21:30:52 +0000] info [xml-api]     undefined status from Cpanel::ServiceManager::Services::Httpd
    [2025-02-25 21:30:52 +0000] info [xml-api] Service Error
    [2025-02-25 21:30:52 +0000] info [xml-api]     (XID 2qgd6d) The “httpd” service failed to start.
    [2025-02-25 21:30:52 +0000] info [xml-api] Startup Log
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net systemd[1]: Starting Apache web server managed by cPanel EasyApache...
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net restartsrv_httpd[6005]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net restartsrv_httpd[6005]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net restartsrv_httpd[6005]: no listening sockets available, shutting down
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net restartsrv_httpd[6005]: AH00015: Unable to open logs
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net systemd[1]: httpd.service: Control process exited, code=exited status=1
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net systemd[1]: httpd.service: Failed with result 'exit-code'.
    [2025-02-25 21:30:52 +0000] info [xml-api]     Feb 25 21:30:49 ***.vps.ovh.net systemd[1]: Failed to start Apache web server managed by cPanel EasyApache.
    0
  • cPRex Jurassic Moderator

    I would create that ticket so this can be investigated.

    0

Please sign in to leave a comment.