Nginx_Apache - 502 Gateway Error after custom build update

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
Nginx_Apache - 502 Gateway Error after custom build update
I tried everything, ./build /rewrite, etc. but still sites are down. DA is working. all websites are down. I tried to switch nginx apache but on both the same problem.

also, I am not super pro, mostly going with documentation and tutorials try to copy commands on ssh but still nothing.

This site can’t be reached
www.domain.com refused to connect.

Try:
ERR_CONNECTION_REFUSED
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,347
Location
LT, EU
What's the OS you're running? Please check /var/log/httpd/error_log for errors.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
2019/11/23 00:12:39 [emerg] 17859#17859: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:12:49 [emerg] 18034#18034: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:14:02 [emerg] 19065#19065: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:14:42 [emerg] 19925#19925: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:14:55 [emerg] 20393#20393: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:02 [emerg] 25709#25709: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:32 [emerg] 29703#29703: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:36 [emerg] 30127#30127: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:36 [emerg] 30133#30133: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:37 [emerg] 30139#30139: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:20:42 [emerg] 31145#31145: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:21:01 [emerg] 3360#3360: unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
2019/11/23 00:35:01 [emerg] 22278#22278: invalid port in upstream "|IP|:|PORT_8080|" in /etc/nginx/nginx-userdir.conf:5
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
2019/11/23 00:35:30 [warn] 23797#0: conflicting server name "srv.likeakinginc.com" on 104.237.9.154:80, ignored
2019/11/23 00:35:30 [warn] 23797#0: conflicting server name "srv.likeakinginc.com" on 104.237.9.154:443, ignored
2019/11/23 00:35:30 [warn] 23798#0: conflicting server name "srv.likeakinginc.com" on 104.237.9.154:80, ignored
2019/11/23 00:35:30 [warn] 23798#0: conflicting server name "srv.likeakinginc.com" on 104.237.9.154:443, ignored
2019/11/23 00:35:31 [error] 23800#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 46.229.168.162, server: srv.likeakinginc.com, request: "GET /36v98me04b86b37koyp977w HTTP/1.1", upstream: "https://104.237.9.154:8081/36v98me04b86b37koyp977w", host: "mail.xcity.ge"
2019/11/23 00:35:32 [error] 23800#0: *7 connect() failed (111: Connection refused) while connecting to upstream, client: 46.229.168.161, server: srv.likeakinginc.com, request: "GET /63a3ijdc3c4c2f585u_3bgb HTTP/1.1", upstream: "http://104.237.9.154:8080/63a3ijdc3c4c2f585u_3bgb", host: "mail.mmm.ge"
2019/11/23 00:35:34 [error] 23800#0: *10 connect() failed (111: Connection refused) while connecting to upstream, client: 4
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
Updating to latest CWAF client version
current version is up to date
update process finished!
Defaulting to Comodo WAF SecDefaultAction...
Installation of ModSecurity Rule Set has been finished.
Using 104.237.9.154 for your server IP
Using 104.237.9.154 for your server IP
PHP has been secured.
Restarting php-fpm72.
Defaulting to Comodo WAF SecDefaultAction...
Restarting nginx.
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-11-23 11:07:21 CST; 2s ago
Process: 12583 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Nov 23 11:07:21 srv.likeakinginc.com systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 23 11:07:21 srv.likeakinginc.com nginx[12583]: nginx: [emerg] unknown directive "modsecurity" in /etc/nginx/nginx-modsecurity-enable.conf:1
Nov 23 11:07:21 srv.likeakinginc.com nginx[12583]: nginx: configuration file /etc/nginx/nginx.conf test failed
Nov 23 11:07:21 srv.likeakinginc.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Nov 23 11:07:21 srv.likeakinginc.com systemd[1]: nginx.service: Failed with result 'exit-code'.
Nov 23 11:07:21 srv.likeakinginc.com systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
root@srv:/usr/local/directadmin/custombuild# journalctl -xe
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit nginx.service has finished with a failure.
--
-- The job identifier is 9864 and the job result is failed.
Nov 23 11:07:27 srv.likeakinginc.com systemd[1]: Reloading The PHP FastCGI Process Manager.
-- Subject: A reload job for unit php-fpm72.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A reload job for unit php-fpm72.service has begun execution.
--
-- The job identifier is 9910.
Nov 23 11:07:27 srv.likeakinginc.com systemd[1]: Reloaded The PHP FastCGI Process Manager.
-- Subject: A reload job for unit php-fpm72.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A reload job for unit php-fpm72.service has finished.
--
-- The job identifier is 9910 and the job result is done.
Nov 23 11:07:30 srv.likeakinginc.com sshd[12608]: Connection closed by 118.126.105.120 port 51946 [preauth]
Nov 23 11:07:31 srv.likeakinginc.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:35:67:23:08:00 SRC=104.251.210.20 DST=255.255.255.255 LEN=16
Nov 23 11:07:31 srv.likeakinginc.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:35:67:23:08:00 SRC=104.251.210.20 DST=104.251.210.255 LEN=16
Nov 23 11:07:31 srv.likeakinginc.com sshd[12607]: Invalid user monique from 106.13.67.90 port 39678
Nov 23 11:07:31 srv.likeakinginc.com sshd[12607]: pam_unix(sshd:auth): check pass; user unknown
Nov 23 11:07:31 srv.likeakinginc.com sshd[12607]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=106.13.67.90
Nov 23 11:07:32 srv.likeakinginc.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1c:42:01:06:9f:08:00 SRC=107.155.116.147 DST=255.255.255.255 LEN=1
Nov 23 11:07:33 srv.likeakinginc.com sshd[12607]: Failed password for invalid user monique from 106.13.67.90 port 39678 ssh2
Nov 23 11:07:34 srv.likeakinginc.com sshd[12607]: Received disconnect from 106.13.67.90 port 39678:11: Bye Bye [preauth]
Nov 23 11:07:34 srv.likeakinginc.com sshd[12607]: Disconnected from invalid user monique 106.13.67.90 port 39678 [preauth]
Nov 23 11:07:42 srv.likeakinginc.com CRON[11386]: pam_unix(cron:session): session closed for user root
Nov 23 11:07:48 srv.likeakinginc.com sshd[12621]: Invalid user l!nux from 66.154.116.162 port 38120
Nov 23 11:07:48 srv.likeakinginc.com sshd[12621]: pam_unix(sshd:auth): check pass; user unknown
Nov 23 11:07:48 srv.likeakinginc.com sshd[12621]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=66.154.116.162
Nov 23 11:07:49 srv.likeakinginc.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:1c:42:49:36:24:2c:21:31:14:49:01:08:00 SRC=159.203.201.115 DST=104.237.9.154 LEN=40
Nov 23 11:07:49 srv.likeakinginc.com kernel: Firewall: *TCP_IN Blocked* IN=eth0 OUT= MAC=00:1c:42:49:36:24:2c:21:31:14:49:01:08:00 SRC=178.128.114.248 DST=104.237.9.154 LEN=40
Nov 23 11:07:50 srv.likeakinginc.com sshd[12621]: Failed password for invalid user l!nux from 66.154.116.162 port 38120 ssh2
Nov 23 11:07:50 srv.likeakinginc.com sshd[12621]: Received disconnect from 66.154.116.162 port 38120:11: Bye Bye [preauth]
Nov 23 11:07:50 srv.likeakinginc.com sshd[12621]: Disconnected from invalid user l!nux 66.154.116.162 port 38120 [preauth]
Nov 23 11:07:54 srv.likeakinginc.com sshd[12630]: Invalid user com!@# from 83.16.14.107 port 51790
Nov 23 11:07:54 srv.likeakinginc.com sshd[12630]: pam_unix(sshd:auth): check pass; user unknown
Nov 23 11:07:54 srv.likeakinginc.com sshd[12630]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=83.16.14.107
Nov 23 11:07:56 srv.likeakinginc.com sshd[12630]: Failed password for invalid user com!@# from 83.16.14.107 port 51790 ssh2
Nov 23 11:07:56 srv.likeakinginc.com sshd[12630]: Received disconnect from 83.16.14.107 port 51790:11: Bye Bye [preauth]
Nov 23 11:07:56 srv.likeakinginc.com sshd[12630]: Disconnected from invalid user com!@# 83.16.14.107 port 51790 [preauth]
Nov 23 11:07:56 srv.likeakinginc.com kernel: Firewall: *UDP_IN Blocked* IN=eth0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:18:9c:cf:92:46:08:00 SRC=104.251.214.59 DST=255.255.255.255 LEN=24
lines 2946-2993/2993 (END)
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,347
Location
LT, EU
You may try:
Code:
cd /usr/local/directadmin/custombuild
./build modsecurity
./build rewrite_confs
If that doesn't help - feel free to PM me for free assistance for this specific case :)
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
thank you for your response. I greatly appreciate it. I had done all those commands but still not worked after 24 hr waiting and upgrade everything as much possible. now works but still not running dovecot and exit.

root@srv:/usr/local/directadmin/custombuild# ./build dovecot
Another instance of custombuild is running (lockfile: /usr/local/directadmin/custombuild/.custombuild, PID 7331).
Executing: doDovecot
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,347
Location
LT, EU
Try "./build dovecot" again, it might have been already running in another session of yours.
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/include/dovecot'
/usr/bin/install -c -m 644 lda-settings.h mail-deliver.h mail-send.h '/usr/include/dovecot'
make[3]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-lda'
make[2]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-lda'
Making install in lib-dict-backend
make[2]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-dict-backend'
make[3]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-dict-backend'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-dict-backend'
make[2]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/lib-dict-backend'
Making install in anvil
make[2]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/anvil'
make[3]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/anvil'
/bin/mkdir -p '/usr/libexec/dovecot'
/bin/sh ../../libtool --mode=install /usr/bin/install -c anvil '/usr/libexec/dovecot'
libtool: install: /usr/bin/install -c .libs/anvil /usr/libexec/dovecot/anvil
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/anvil'
make[2]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/anvil'
Making install in auth
make[2]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/auth'
make[3]: Entering directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/auth'
/bin/mkdir -p '/usr/libexec/dovecot'
/bin/sh ../../libtool --mode=install /usr/bin/install -c auth checkpassword-reply '/usr/libexec/dovecot'
libtool: warning: 'libstats_auth.la' has not been installed in '/usr/lib/dovecot/old-stats'
libtool: install: /usr/bin/install -c .libs/auth /usr/libexec/dovecot/auth
libtool: install: /usr/bin/install -c .libs/checkpassword-reply /usr/libexec/dovecot/checkpassword-reply
/bin/mkdir -p '/usr/lib/dovecot/auth'
/bin/mkdir: cannot create directory '/usr/lib/dovecot/auth': File exists
make[3]: *** [Makefile:878: install-auth_moduleLTLIBRARIES] Error 1
make[3]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/auth'
make[2]: *** [Makefile:1507: install-am] Error 2
make[2]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src/auth'
make[1]: *** [Makefile:560: install-recursive] Error 1
make[1]: Leaving directory '/usr/local/directadmin/custombuild/dovecot-2.3.8/src'
make: *** [Makefile:678: install-recursive] Error 1
Updating dovecot configuration files...
ensuring ssl_dh
Dovecot configuration files have been updated successfully.
ensuring ssl_dh
Disabling dovecot.socket in systemd...
Enabling dovecot in systemd...
Restarting dovecot.
root@srv:/usr/local/directadmin/custombuild#
 

ibossonline

Verified User
Joined
Oct 26, 2019
Messages
64
Location
NYC
this is interesting, on the custom build its shows me the need to be updated dovecot. but as many try its not updating, also not starting it.
 

smtalk

Administrator
Staff member
Joined
Aug 22, 2006
Messages
8,347
Location
LT, EU
this is interesting, on the custom build its shows me the need to be updated dovecot. but as many try its not updating, also not starting it.
I could check it directly on your system if you’d like me to. Something is not alright there :)
 
Top