PDA

Bekijk Volledige Versie : Alle websites van VPS: 502 Bad Gateway - nginx



Jerremy
09/02/14, 14:19
Beste,

Ik heb afgelopen dagen de rDNS van de VPS veranderd in vps.iahost.nl, en de hostname is veranderd naar vps.iahost.nl.

Nu is het zo dat opeens alle websites de foutmelding "502 bad gateway - nginx" geven.

Ik zie in Plesk dat de Apache web server uitstaat. Als ik deze aanzet krijg ik de error:
Error: Unable to make action: Unable to manage service by apache_control_adapter: Service /etc/init.d/httpd failed to start
Service /etc/init.d/httpd failed to start ('--start', 'web')

Iemand enige idee hoe dit is op te lossen?
OT: Ik zit er toch maar over na te denken om weer managed hosting te gaan nemen...

Dit is de output waarvan ik achtte dat het wellicht hulpzaam zou kunnen zijn:
# service httpd configtest
Syntax OK

# tail -n 50 /var/log/nginx/error.log
2014/02/09 13:57:32 [error] 1539#0: *36 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 13:58:32 [error] 1539#0: *38 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 13:59:33 [error] 1539#0: *40 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 13:59:53 [error] 1539#0: *42 connect() failed (111: Connection refused) while connecting to upstream, client: 157.56.93.37, server: innovationsanywhere.com, request: "GET / HTTP/1.0", upstream: "http://149.210.159.109:7080/", host: "innovationsanywhere.com"
2014/02/09 14:00:33 [error] 1539#0: *44 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:01:13 [error] 1539#0: *46 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "impactcleaning.eu"
2014/02/09 14:01:13 [error] 1539#0: *46 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /wp-content/uploads/2013/11/CO2-3-216x300.jpg HTTP/1.1", upstream: "http://149.210.159.109:7080/wp-content/uploads/2013/11/CO2-3-216x300.jpg", host: "impactcleaning.eu"
2014/02/09 14:01:32 [error] 1539#0: *49 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:02:32 [error] 1539#0: *51 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:03:32 [error] 1539#0: *53 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:04:32 [error] 1539#0: *55 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:04:57 [error] 1539#0: *57 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.111, server: best2buysolution.nl, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "best2buysolution.nl"
2014/02/09 14:05:07 [error] 1539#0: *59 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "best2buysolution.nl"
2014/02/09 14:05:08 [error] 1539#0: *59 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET /favicon.ico HTTP/1.1", upstream: "http://149.210.159.109:7080/favicon.ico", host: "best2buysolution.nl"
2014/02/09 14:05:17 [error] 1539#0: *62 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: innovationsanywhere.com, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "innovationsanywhere.com"
2014/02/09 14:05:17 [error] 1539#0: *62 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: innovationsanywhere.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://149.210.159.109:7080/favicon.ico", host: "innovationsanywhere.com"
2014/02/09 14:05:32 [error] 1539#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:05:53 [error] 1539#0: *67 connect() failed (111: Connection refused) while connecting to upstream, client: 157.56.93.37, server: innovationsanywhere.com, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "innovationsanywhere.com"
2014/02/09 14:06:33 [error] 1539#0: *69 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:06:54 [error] 1539#0: *71 connect() failed (111: Connection refused) while connecting to upstream, client: 157.56.93.37, server: innovationsanywhere.com, request: "GET / HTTP/1.0", upstream: "http://149.210.159.109:7080/", host: "innovationsanywhere.com"
2014/02/09 14:07:32 [error] 1539#0: *73 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:08:33 [error] 1539#0: *75 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:08:52 [error] 1539#0: *77 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.163.30, server: innovationsanywhere.com, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "innovationsanywhere.com"
2014/02/09 14:08:53 [error] 1539#0: *79 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.163.30, server: realeast.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "www.realeast.eu"
2014/02/09 14:08:54 [error] 1539#0: *81 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.243.86, server: innovationsanywhere.com, request: "GET /wp-content/uploads/portfolio-dwp2-1-1024x571-570x321.png HTTP/1.1", upstream: "http://149.210.159.109:7080/wp-content/uploads/portfolio-dwp2-1-1024x571-570x321.png", host: "innovationsanywhere.com"
2014/02/09 14:08:54 [error] 1539#0: *79 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.163.30, server: realeast.eu, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "realeast.eu"
2014/02/09 14:08:55 [error] 1539#0: *84 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.163.30, server: realeast.eu, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "www.realeast.eu"
2014/02/09 14:09:33 [error] 1539#0: *86 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:10:33 [error] 1539#0: *88 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:11:33 [error] 1539#0: *90 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:12:32 [error] 1539#0: *92 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:13:23 [error] 1539#0: *94 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "impactcleaning.eu"
2014/02/09 14:13:23 [error] 1539#0: *94 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /download/fr/CO2%20Nettoyage%20-%20Fr.pdf HTTP/1.1", upstream: "http://149.210.159.109:7080/download/fr/CO2%20Nettoyage%20-%20Fr.pdf", host: "impactcleaning.eu"
2014/02/09 14:13:33 [error] 1539#0: *97 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:14:13 [error] 1539#0: *99 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "impactcleaning.eu"
2014/02/09 14:14:13 [error] 1539#0: *99 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /download/fr/CO2_Nettoyage-Fr.pdf HTTP/1.1", upstream: "http://149.210.159.109:7080/download/fr/CO2_Nettoyage-Fr.pdf", host: "impactcleaning.eu"
2014/02/09 14:14:33 [error] 1539#0: *102 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:14:37 [error] 1539#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 178.154.243.86, server: innovationsanywhere.com, request: "GET /wp-content/uploads/portfolio-b2bs-1-570x321.png HTTP/1.1", upstream: "http://149.210.159.109:7080/wp-content/uploads/portfolio-b2bs-1-570x321.png", host: "innovationsanywhere.com"
2014/02/09 14:15:13 [error] 1539#0: *106 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "impactcleaning.eu"
2014/02/09 14:15:13 [error] 1539#0: *106 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /download/fr/CO2_Nettoyage-Fr.pdf HTTP/1.1", upstream: "http://149.210.159.109:7080/download/fr/CO2_Nettoyage-Fr.pdf", host: "impactcleaning.eu"
2014/02/09 14:15:33 [error] 1539#0: *109 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:16:14 [error] 1539#0: *111 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.76.238, server: impactcleaning.eu, request: "GET /robots.txt HTTP/1.1", upstream: "http://149.210.159.109:7080/robots.txt", host: "impactcleaning.eu"
2014/02/09 14:16:14 [error] 1539#0: *113 connect() failed (111: Connection refused) while connecting to upstream, client: 66.249.78.199, server: impactcleaning.eu, request: "GET /download/fr/CO2_Nettoyage-Fr.pdf HTTP/1.1", upstream: "http://149.210.159.109:7080/download/fr/CO2_Nettoyage-Fr.pdf", host: "impactcleaning.eu"
2014/02/09 14:16:32 [error] 1539#0: *115 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:17:33 [error] 1539#0: *117 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:18:33 [error] 1539#0: *119 connect() failed (111: Connection refused) while connecting to upstream, client: 80.69.67.10, server: , request: "GET / HTTP/1.0", upstream: "http://127.0.0.1:7080/"
2014/02/09 14:18:58 [error] 1539#0: *121 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "best2buysolution.nl"
2014/02/09 14:18:58 [error] 1539#0: *121 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET /favicon.ico HTTP/1.1", upstream: "http://149.210.159.109:7080/favicon.ico", host: "best2buysolution.nl"
2014/02/09 14:18:59 [error] 1539#0: *121 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET / HTTP/1.1", upstream: "http://149.210.159.109:7080/", host: "best2buysolution.nl"
2014/02/09 14:18:59 [error] 1539#0: *121 connect() failed (111: Connection refused) while connecting to upstream, client: 81.68.129.144, server: best2buysolution.nl, request: "GET /favicon.ico HTTP/1.1", upstream: "http://149.210.159.109:7080/favicon.ico", host: "best2buysolution.nl"

# netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1687/mysqld
tcp 0 0 0.0.0.0:587 0.0.0.0:* LISTEN 1479/master
tcp 0 0 149.210.159.109:80 0.0.0.0:* LISTEN 1538/nginx
tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1479/master
tcp 0 0 127.0.0.1:10001 0.0.0.0:* LISTEN 1316/sw-cp-serverd
tcp 0 0 149.210.159.109:53 0.0.0.0:* LISTEN 1760/named
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1760/named
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1327/sshd
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1760/named
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1479/master
tcp 0 0 149.210.159.109:443 0.0.0.0:* LISTEN 1538/nginx
tcp 0 0 0.0.0.0:12443 0.0.0.0:* LISTEN 1316/sw-cp-serverd
tcp 0 0 127.0.0.1:12768 0.0.0.0:* LISTEN 1493/psa-pc-remote
tcp 0 0 :::106 :::* LISTEN 1335/xinetd
tcp 0 0 :::587 :::* LISTEN 1479/master
tcp 0 0 :::110 :::* LISTEN 1388/couriertcpd
tcp 0 0 :::143 :::* LISTEN 1370/couriertcpd
tcp 0 0 2a01:7c8:aab4:63::1:80 :::* LISTEN 1538/nginx
tcp 0 0 :::8880 :::* LISTEN 1316/sw-cp-serverd
tcp 0 0 :::465 :::* LISTEN 1479/master
tcp 0 0 :::53 :::* LISTEN 1760/named
tcp 0 0 :::21 :::* LISTEN 1335/xinetd
tcp 0 0 :::22 :::* LISTEN 1327/sshd
tcp 0 0 :::25 :::* LISTEN 1479/master
tcp 0 0 :::8443 :::* LISTEN 1316/sw-cp-serverd
tcp 0 0 :::993 :::* LISTEN 1380/couriertcpd
tcp 0 0 :::995 :::* LISTEN 1397/couriertcpd
udp 0 0 0.0.0.0:631 0.0.0.0:* 1136/portreserve
udp 0 0 149.210.159.109:123 0.0.0.0:* 1357/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 1357/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 1357/ntpd
udp 0 0 0.0.0.0:783 0.0.0.0:* 1136/portreserve
udp 0 0 149.210.159.109:53 0.0.0.0:* 1760/named
udp 0 0 127.0.0.1:53 0.0.0.0:* 1760/named
udp 0 0 fe80::5054:ff:fe1c:4f9e:123 :::* 1357/ntpd
udp 0 0 ::1:123 :::* 1357/ntpd
udp 0 0 2a01:7c8:aab4:63::1:123 :::* 1357/ntpd
udp 0 0 :::123 :::* 1357/ntpd
udp 0 0 :::53 :::* 1760/named

Jerremy
09/02/14, 14:22
Meer:
# ps -ax | grep httpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
2767 pts/0 S+ 0:00 grep httpd

# /usr/share/doc/procps-3.2.8/FAQ
bash: /usr/share/doc/procps-3.2.8/FAQ: Permission denied

# /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 8 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 21 of /usr/local/psa/admin/conf/vhosts_bootstrap.conf: Could not open configuration file /var/www/vhosts/elite-devices.com/conf/13918607590.54581400_httpd.include: Permission denied
[FAILED]

# /usr/sbin/apachect1 restart
bash: /usr/sbin/apachect1: No such file or directory

Kevin Bentlage
09/02/14, 14:22
Zo te lezen heb je nginx als een proxy voor Apache draaien. Kun je de output van de httpd (error)log eens geven?

Jerremy
09/02/14, 14:29
Zo te lezen heb je nginx als een proxy voor Apache draaien. Kun je de output van de httpd (error)log eens geven?

Is dat deze command: # /var/log/httpd/error_log
bash: /var/log/httpd/error_log: Permission denied

want # tail -n 50 /var/log/httpd/error_log geeft niks als output.

Jerremy
09/02/14, 14:38
# ps -ax | grep httpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
3897 pts/0 S+ 0:00 grep httpd

Wellicht?


Nu is deze error melding in Plesk:
New files of configuration for Apache web server were not built due to errors in configuration templates: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 8 of /etc/httpd/conf.d/zz010_psa_httpd.conf: Syntax error on line 21 of /usr/local/psa/admin/conf/vhosts_bootstrap.conf: Could not open configuration file /var/www/vhosts/elite-devices.com/conf/13919533440.71625500_httpd.include: Permission denied . The detailed error message was e-mailed to you, so please check the e-mail, fix the errors, and click here to retry generating broken configuration or click here to retry generating of all configurations.

Wat leidt tot :
Web server reconfiguration is failed with error: Execution failed. Command: httpdmng Arguments: Array ( [0] => --reconfigure-all ) Details: Empty error message from utility.

Jerremy
09/02/14, 15:10
# tail -n 50 /tmp/httpd_modules_ctl.cTKwMW
Trying to restart service httpd... httpd is stopped
Starting httpd: [FAILED]

WARNING!
Some problems are found during restart(see log file: /tmp/httpd_modules_ctl.cTKwMW)

Continue...

Jerremy
09/02/14, 15:22
Update: Alle websites doen het nu weer, omdat ik SELinux heb uitgezet.
Het rare is dat ik de VPS niet had uitgezet voordat dit probleem voorkwam. Bovendien weet ik ook niet of het wel veilig is om SELinux altijd uit te zetten?

Ik heb namelijk gelezen dat als de server nu gereboot wordt, SELinux weer aan wordt gezet met de setting die ik heb gedaan. Dat zou betekenen dat weer alles errors geeft? Dat is natuurlijk niet wat ik wil, maar ik wil ook niet dat de server niet veilig is. Ik zie in dit artikel dat er een oplossing is (http://forum.parallels.com/pda/index.php/t-291139.html) maar hier snap ik niet zo veel van. Ik hoop dat iemand mij hierbij kan helpen.

Bedankt voor alle hulp!

(Excuses dat ik meerdere posts heb, maar ik kan helaas oudere berichten niet bewerken)

Hostingwalk
09/02/14, 15:46
Wat heb je precies uitgevoerd hier: http://www.cyberciti.biz/faq/howto-turn-off-selinux/ ?

Jerremy
09/02/14, 16:53
Wat heb je precies uitgevoerd hier: http://www.cyberciti.biz/faq/howto-turn-off-selinux/ ?

Het enige wat hielp en wat output gaf: # setenforce 0