err_connection_refused - NGINX
AnsweredHello ,
I got an " err_connection_refused " error after i stopped and uninstall nginx on my almalinux server .
first i used the command :
sudo systemctl stop nginx
Then :
yum erase ea-nginx
and i confirm by : Y
Then the process begin as the following :
Dependencies resolved.
===============================================================================================================================================
Package Architecture Version Repository Size
===============================================================================================================================================
Removing:
ea-nginx x86_64 1:1.26.2-1.1.1.cpanel @EA4-c9 3.7 M
Removing unused dependencies:
ea-apache24-mod_remoteip x86_64 2.4.62-2.3.7.cpanel @EA4-c9 40 kTransaction Summary
===============================================================================================================================================
Remove 2 PackagesFreed space: 3.8 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
usermod: no changes
Running transaction
Preparing : 1/1
Running scriptlet: ea-nginx-1:1.26.2-1.1.1.cpanel.x86_64 1/2
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Htaccess::del_user in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Htaccess::set_index in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Htaccess::set_pass in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Htaccess::set_protect in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Park::park in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api1::Park::unpark in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::AddonDomain::addaddondomain in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::AddonDomain::deladdondomain in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::Park::park in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::Park::unpark in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::SubDomain::addsubdomain in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::Api2::SubDomain::delsubdomain in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::LangPHP::php_set_vhost_versions in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::LangPHP::php_ini_set_user_content in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::LangPHP::php_ini_set_user_basic_directives in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::Mime::add_redirect in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::Mime::delete_redirect in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::SSL::delete_ssl in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::SSL::install_ssl in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::SSL::toggle_ssl_redirect_for_domains in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::SubDomain::addsubdomain in hooks registry
Deleted hook NginxHooks::_do_adminbin for Cpanel::UAPI::WordPressInstanceManager::start_scan in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for scripts::build_apache_conf in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::Accounts::Modify in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::Accounts::Remove in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::Hostname::change in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::PipedLogConfiguration in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::TweakSettings::Basic in hooks registry
Deleted hook NginxHooks::_rebuild_config_all for Whostmgr::TweakSettings::Main in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Accounts::Create in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Accounts::SiteIP::set in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::AutoSSL::installssl in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::SSL::delssl in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::SSL::installssl in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Domain::park in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Domain::unpark in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Domain::addsubdomain in hooks registry
Deleted hook NginxHooks::_rebuild_user for Whostmgr::Domain::delsubdomain in hooks registry
Deleted hook NginxHooks::_possible_php_fpm for Whostmgr::Lang::PHP::set_vhost_versions in hooks registry
Deleted hook NginxHooks::_possible_php_fpm for Whostmgr::Lang::PHP::ini_set_content in hooks registry
Deleted hook NginxHooks::_possible_php_fpm for Whostmgr::Lang::PHP::set_system_default_version in hooks registry
Deleted hook NginxHooks::_possible_php_fpm for Whostmgr::Lang::PHP::ini_set_directives in hooks registry
Deleted hook NginxHooks::_php_fpm_config for scripts::php_fpm_config in hooks registry
Deleted hook NginxHooks::_do_wordpress for Cpanel::Api1::cPAddons::mainpg in hooks registry
Deleted hook NginxHooks::_just_clear_user_cache for Whostmgr::Accounts::suspendacct in hooks registry
Deleted hook NginxHooks::_just_clear_user_cache for Whostmgr::Accounts::unsuspendacct in hooks registry
Deleted hook NginxHooks::_do_reload_logs_adminbin for Stats::RunUser in hooks registry
Deleted hook NginxHooks::_reload_logs for Stats::RunAll in hooks registry
Waiting for “httpd” to stop ………finished.Startup Log
Nov 21 05:32:44 *server* systemd[1]: Starting Apache web server managed by cPanel EasyApache...
Nov 21 05:32:44 *server* systemd[1]: httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permitted
Nov 21 05:32:44 *server* systemd[1]: Started Apache web server managed by cPanel EasyApache.
Nov 24 23:50:54 *server* systemd[1]: Stopping Apache web server managed by cPanel EasyApache...
Nov 24 23:50:54 *server* systemd[1]: httpd.service: Deactivated successfully.
Nov 24 23:50:54 *server* systemd[1]: Stopped Apache web server managed by cPanel EasyApache.
Nov 24 23:50:54 *server* systemd[1]: httpd.service: Consumed 2min 3.442s CPU time.httpd stopped successfully.
Service “nginx” is already stopped.Startup Log
Nov 22 16:01:13 *server* systemd[1]: Reloading nginx - high performance web server...
Nov 22 16:01:13 *server* systemd[1]: Reloaded nginx - high performance web server.
Nov 23 16:12:27 *server* systemd[1]: Reloading nginx - high performance web server...
Nov 23 16:12:27 *server* systemd[1]: Reloaded nginx - high performance web server.
Nov 24 16:06:57 *server* systemd[1]: Reloading nginx - high performance web server...
Nov 24 16:06:57 *server* systemd[1]: Reloaded nginx - high performance web server.
Nov 24 23:49:24 *server* systemd[1]: Stopping nginx - high performance web server...
Nov 24 23:49:24 *server* systemd[1]: nginx.service: Deactivated successfully.
Nov 24 23:49:24 *server* systemd[1]: Stopped nginx - high performance web server.
Nov 24 23:49:24 *server* systemd[1]: nginx.service: Consumed 4min 16.900s CPU time.nginx stopped successfully.
Use of uninitialized value in concatenation (.) or string at /etc/nginx/ea-nginx/meta/apache line 133.
whmapi1 set_tweaksetting failed:
Use of uninitialized value in concatenation (.) or string at /etc/nginx/ea-nginx/meta/apache line 133.
whmapi1 set_tweaksetting failed:
Running move_apache_back_to_orig_ports() …Erasing : ea-nginx-1:1.26.2-1.1.1.cpanel.x86_64 1/2
warning: /etc/nginx/ea-nginx/settings.json saved as /etc/nginx/ea-nginx/settings.json.rpmsave
warning: /etc/nginx/ea-nginx/meta/apache_ssl_port.initial saved as /etc/nginx/ea-nginx/meta/apache_ssl_port.initial.rpmsave
warning: /etc/nginx/ea-nginx/meta/apache_port.initial saved as /etc/nginx/ea-nginx/meta/apache_port.initial.rpmsave
warning: /etc/nginx/conf.d/includes-optional/cpanel-proxy-xt.conf saved as /etc/nginx/conf.d/includes-optional/cpanel-proxy-xt.conf.rpmsave
warning: /etc/nginx/conf.d/includes-optional/cloudflare.conf saved as /etc/nginx/conf.d/includes-optional/cloudflare.conf.rpmsave
warning: /etc/nginx/conf.d/ea-nginx.conf saved as /etc/nginx/conf.d/ea-nginx.conf.rpmsave
warning: /etc/nginx/conf.d/default.conf saved as /etc/nginx/conf.d/default.conf.rpmsaveRunning scriptlet: ea-nginx-1:1.26.2-1.1.1.cpanel.x86_64 1/2
renamed '/var/log/nginx' -> '/var/log/nginx.uninstall'Erasing : ea-apache24-mod_remoteip-2.4.62-2.3.7.cpanel.x86_64 2/2
Running scriptlet: ea-apache24-mod_remoteip-2.4.62-2.3.7.cpanel.x86_64 2/2
Verifying : ea-apache24-mod_remoteip-2.4.62-2.3.7.cpanel.x86_64 1/2
Verifying : ea-nginx-1:1.26.2-1.1.1.cpanel.x86_64 2/2
usermod: no changes
Purging all relevant cached command results
Removing: /root/.cpanel/datastore/_usr_sbin_httpd_-v
Removing: /root/.cpanel/datastore/_usr_sbin_httpd_-V
Removing: /root/.cpanel/datastore/_usr_sbin_httpd_-l
Removing: /root/.cpanel/datastore/_usr_sbin_httpd_-L
Rebuilding global cache
Building global cache for cpanel...Done
Nothing to do (/etc/suphp.conf does not exist)
info [modsec_cpanel_conf_init] The modsec2.cpanel.conf file and its datastore are already set up. No further action is required.
Built /etc/apache2/conf/httpd.conf OK
Nothing to do under ea4 (this script has been deprecated under ea4).
Fix mailman package directories …
… PID 3517325
Fix mailing list perms …
… PID 3517327
Aligning modsec config to Whostmgr
- Whostmgr version 11.124.0.10
- Whostmgr supports conf.d/modsec location
- No change necessary
Service “httpd” is already stopped.Startup Log
Nov 21 05:32:44 *server* systemd[1]: Starting Apache web server managed by cPanel EasyApache...
Nov 21 05:32:44 *server* systemd[1]: httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permitted
Nov 21 05:32:44 *server* systemd[1]: Started Apache web server managed by cPanel EasyApache.
Nov 24 23:50:54 *server* systemd[1]: Stopping Apache web server managed by cPanel EasyApache...
Nov 24 23:50:54 *server* systemd[1]: httpd.service: Deactivated successfully.
Nov 24 23:50:54 *server* systemd[1]: Stopped Apache web server managed by cPanel EasyApache.
Nov 24 23:50:54 *server* systemd[1]: httpd.service: Consumed 2min 3.442s CPU time.httpd stopped successfully.
Waiting for “httpd” to start ……waiting for “httpd” to initialize ………finished.Service Status
httpd (/usr/sbin/httpd -k start) is running as root with PID 3517366 (systemd+/proc check method).Startup Log
Nov 24 23:50:56 *server* systemd[1]: Starting Apache web server managed by cPanel EasyApache...
Nov 24 23:50:57 *server* systemd[1]: httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permitted
Nov 24 23:50:57 *server* systemd[1]: Started Apache web server managed by cPanel EasyApache.Log Messages
[Sun Nov 24 23:50:57.214402 2024] [mpm_prefork:notice] [pid 3517366:tid 3517366] AH00163: Apache/2.4.62 (cPanel) OpenSSL/3.2.2 mod_bwlimited/1.4 configured -- resuming normal operations
[Sun Nov 24 23:50:57.185506 2024] [security2:notice] [pid 3517363:tid 3517363] ModSecurity for Apache/2.9.7 (http://www.modsecurity.org/) configured.
Nov 24 23:50:57 ae systemd[1]: Started Apache web server managed by cPanel EasyApache.
Nov 24 23:50:57 ae systemd[1]: httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permittedhttpd started successfully.
Setting /home permissions to 0711 …
Setting permissions for users …
1 …
2 …
3 …
4 …
5 …
… DoneRemoved:
ea-apache24-mod_remoteip-2.4.62-2.3.7.cpanel.x86_64 ea-nginx-1:1.26.2-1.1.1.cpanel.x86_64Complete!
I restarted the server too ..
But still i am facing this error , how can i fix it ?!
-
Why did you do that? in WHM do you have Nginx enabled/installed? Make sure it's disabled there then use EasyApache to recompile/reinstall Apache on the server.
Andrew N. - cPanel Plesk VMWare Certified Professional
Do you need immediate assistance? 20 minutes response time!* Open a ticket
EmergencySupport - Professional Server Management and One-time Services0 -
I wanted to uninstall it through ssh .
I know there is Nginx options in WHM and i already installed it from there , but i want to know how to manage through ssh too .
In general , is there a specific way to do so using ssh commands ?
what could be the steps to do so and what did i miss in my previous steps ?
Is it required to recompile/reinstall Apache on the server in both ways ( WHM and SSH ) ?
and will all settings be reset again after that ?!
Currently i reinstalled Nginx through ssh and the website is working with no issues .
0 -
Hi,
When uninstalling Nginx, Apache should normally be switched back from the offset ports (444/81) back to ports 80 and 443 so websites would continue to function. After removing nginx, can you run the following command to see if Apache is running?
/scripts/restartsrv_httpd --status
You can run the command without the --status flag to restart the service. If the service fails to restart, it should include useful output to troubleshoot the issue.
0 -
Hi ,
Thanks for your reply ,
I just try to uninstall and run the command you share :
/scripts/restartsrv_httpd --status
This is the output :
[root@server ~]# /scripts/restartsrv_httpd --status
httpd (/usr/sbin/httpd -k start) is running as root with PID 461279 (systemd+/proc check method).
[root@server ~]# /scripts/restartsrv_httpd
Waiting for “httpd” to restart gracefully …waiting for “httpd” to initialize ………finished.Service Status
httpd (/usr/sbin/httpd -k start) is running as root with PID 461279 (systemd+/proc check method).Startup Log
Nov 27 01:19:50 *server* systemd[1]: Starting Apache web server managed by cPanel EasyApache...
Nov 27 01:19:50 *server* systemd[1]: httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permitted
Nov 27 01:19:50 *server* systemd[1]: Started Apache web server managed by cPanel EasyApache.Log Messages
[Wed Nov 27 01:19:50.318705 2024] [mpm_prefork:notice] [pid 461279:tid 461279] AH00163: Apache/2.4.62 (cPanel) OpenSSL/3.2.2 mod_bwlimited/1.4 configured -- resuming normal operations
[Wed Nov 27 01:19:50.291282 2024] [security2:notice] [pid 461276:tid 461276] ModSecurity for Apache/2.9.7 (http://www.modsecurity.org/) configured.httpd restarted successfully.
And again , the same error show up again
0 -
Just to confirm, after the success restart from that command, you are still not able to connect to the sites, correct? Can you run this command to confirm that the service is listening on port 80?
netstat -lpn | grep 80 | grep http
Knowing the output from that command would help us determine what may be happening.
0 -
Yes , that's right .
I just tried the command without uninstalling nginx , but i didn't get any results .
0 -
It's odd that *nothing* is listening on port 80, as the cPanel service is designed to listen on that port if Apache or Nginx isn't running.
At this point it would be best to submit a ticket so the server can be examined as there could be multiple issues happening with this system.
0 -
As i mentioned , i didn't remove nginx .
Should i remove it and try to run the command ?
By the way , there is one website on the server which i am getting many alerts , i am not sure if it is related to nginx or not , it shows :
Title : lfd on *server*: Excessive processes running under user *web*
Time: Thu Dec 5 16:15:36 2024 +0400
Account: *web*
Process Count: 12 (Not killed)Process Information:
User:*web* PID:3819349 PPID:3819345 Run Time:19(secs) Memory:62264(kb) RSS:40268(kb) exe:/usr/local/cpanel/libexec/cpanellogd cmd:cpanellogd - http logs for *web*
User:*web* PID:3819372 PPID:3819371 Run Time:17(secs) Memory:16892(kb) RSS:6912(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819373 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:1884(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819374 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:2012(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819375 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:1884(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819376 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:2012(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819377 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:1884(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819378 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:2012(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819379 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:1756(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819380 PPID:3819372 Run Time:17(secs) Memory:17104(kb) RSS:2012(kb) exe:/usr/local/cpanel/3rdparty/webalizer/bin/english cmd:/usr/local/cpanel/3rdparty/webalizer/bin/english -N 10 -D /home/*web*/tmp/webalizer/dns_cache.db -R 250 -p -n *web*.co -o /home/*web*/tmp/webalizer /var/log/nginx/domains/*web*.co.bkup
User:*web* PID:3819396 PPID:140217 Run Time:13(secs) Memory:395612(kb) RSS:109028(kb) exe:/opt/cpanel/ea-php81/root/usr/sbin/php-fpm cmd:php-fpm: pool *web*_co
User:*web* PID:3819398 PPID:140217 Run Time:13(secs) Memory:293852(kb) RSS:76692(kb) exe:/opt/cpanel/ea-php81/root/usr/sbin/php-fpm cmd:php-fpm: pool *web*_coAnd other emails shows :
Title: lfd on *server *: Suspicious File Alert
Time: Thu Dec 5 12:40:28 2024 +0400
File: /tmp/systemd-private-8c564fb84051467db65fcfc015708f59-ea- php81-php-fpm.service-IH5Wic/ tmp/python3.61
Reason: Linux Binary
Owner: *web* (1007:1008)
Action: No action takenAnd
Title : lfd on *server* : Excessive resource usage: *web* (3600773 (Parent PID:3600773))
Time: Thu Dec 5 03:39:09 2024 +0400
Account: *web*
Resource: Process Time
Exceeded: 3649 > 3600 (seconds)
Executable: /opt/cpanel/ea-php81/root/usr/bin/php-cgi
Command Line: /opt/cpanel/ea-php81/root/usr/bin/php-cgi /tmp/phpbbmEn2DE phpbb
PID: 3600773 (Parent PID:3600773)
Killed: NoIt looks like it is related to CSF , but it is abnormal status .
0 -
cPanel doesn't manage or distribute CSF, so I can't advise on those messages.
I would remove Nginx and get the system back into a default Apache state to see if you can get things working there. Then we know we have a good base system where things are working as they should be.
0 -
What is the command to remove Nginx , is it :
1 - yum erase ea-nginx
2- yum uninstall ea-nginx
Becuase when i try the first one it works but the second one it doesn't , and after i use the erase command i tried to run the command you sent , and again it didn't show any results
0 -
At this point it would likely be better to use the WHM interface to ensure things are removed properly with all dependencies. However, the "erase" command is what you would want on the command line:
https://support.cpanel.net/hc/en-us/articles/1500010475601-How-to-uninstall-ea-nginx
0
Please sign in to leave a comment.
Comments
11 comments