Apache2 and mod_wsgi: Truncated or oversized response headers received from daemon process - apache

My application is running with an Apache 2 server using mod_wsgi, Flask, and Python 2.7. Oddly enough, the application crashes when the page refreshes. For me, this happens exactly on every other refresh. You can see it here. Furthermore, in Chrome, if I open the web inspector tool, the program does not crash.
In the logs, I see:
[Tue Apr 14 13:45:29.137444 2015] [wsgi:error] [pid 32713] [client 146.203.54.32:58816] Truncated or oversized response headers received from daemon process 'localhost:80': /etc/g2e/htdocs/g2e
[Tue Apr 14 13:45:29.671493 2015] [core:notice] [pid 28845] AH00052: child pid 640 exit signal Segmentation fault (11)
[Tue Apr 14 13:45:29.671520 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' has died, deregister and restart it.
[Tue Apr 14 13:45:29.671524 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' terminated by signal 11
[Tue Apr 14 13:45:29.671527 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' has been deregistered and will no longer be monitored.
...
FWIW, I am using
Linux 3.16.7-7-desktop #1 SMP PREEMPT Wed Dec 17 18:00:44 UTC 2014 (762f27a) x86_64 x86_64 x86_64 GNU/Linux
Any help is appreciated.

I may have a tweak. I had this problem but now it's working somehow.
I tried to run mod_wsgi as a daemon. My application didn't work and I had this error message in the logs.
however running mod_wsgi as non-daemon worked, for instance
python manage.py runmodwsgi --reload-on-changes # for Django
So I once again launched it then killed it.
my app is still running :)
(mod_wsgi 4.4.[1-13], apache2, python 2.7, Django 1.7, Debian8 fresh install, with or without virtualenv)

Related

Xvarnish (cachewall) with mod_pagespeed

There is an issue where I have a cpanel server with cachewall (Xvarnish used to be called) and mod_pagspeed installed.
Cachewall/Xvarnish has https support enabled.
The issue is that even though the header of the website is showing that both Cachewall and modpagespeed is running, I'm getting flooded with this in my apache error log:
[Mon Jul 03 20:45:49.060050 2017] [pagespeed:error] [pid 31223:tid 112490802050816] [mod_pagespeed 1.11.33.4-0 #31223] Serf status 120171(APR does not understand this error code) polling for 1 threaded fetches for 0.05 seconds
[Mon Jul 03 20:45:49.060071 2017] [pagespeed:error] [pid 31223:tid 112490802050816] [mod_pagespeed 1.11.33.4-0 #31223] Serf status 120171(APR does not understand this error code) polling for 1 threaded fetches for 0.05 seconds
[Mon Jul 03 20:45:49.910183 2017] [pagespeed:warn] [pid 31225:tid 112490799363840] [mod_pagespeed 1.11.33.4-0 #31225] Fetch timed out: https://www.example.com/wp-includes/js/jquery/jquery.js?ver=1.12.4 (connecting to:139.xx.xx.xx:82) (1) waiting for 50 ms
Not sure whats going on here.
I think you have to understand the cache flow when using both varnish and page_speed.
Please check the link bellow for details:
https://www.sonassi.com/help/troubleshooting/understanding-cache-flow-when-using-pagespeed-and-varnish
Clear all page_speed cache and varnish cache, then restart both varnish and apache.

Apache error on accessing Extension Manager in Typo3

When i try to use the Extension Manager in Typo3, my Apache server crashes...
I use XAMPP.
This is my error log:
[di jan 13 20:43:53 2015] [notice] [] [pid 4928:tid 260] AH00455: Apache/2.4.3 (Win32)
OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[di jan 13 20:43:53 2015] [notice] [] [pid 4928:tid 260] AH00456: Server built: Aug 18 2012 12:41:37
[di jan 13 20:43:53 2015] [notice] [] [pid 4928:tid 260] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[di jan 13 20:43:53 2015] [notice] [] [pid 4928:tid 260] AH00418: Parent: Created child process 7356
[di jan 13 20:43:55 2015] [notice] [] [pid 7356:tid 276] AH00354: Child: Starting 150 worker threads.
I do not have any clue on what to do or what I can provide more to solve this problem. Anyone knows what to do?
Extra info:
I did install curl. Curl is working.
In php.ini: allow_url_fopen is on.
Typo3 version: 6.2.9
I work on a local typo3 environment. The site does work. It is on windows Vista.
What happens:
1) i click "extension manager"
2) i get the loader icon in the browser part where the extension should be loaded
3) i then get a Microsoft Windows popup screen: Apache HTTP Server has stopped working with these details:
Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.4.3.0
Application Timestamp: 502f70a3
Fault Module Name: php5ts.dll
Fault Module Version: 5.4.7.0
Fault Module Timestamp: 505114f8
Exception Code: c00000fd
Exception Offset: 00039eaa
OS Version: 6.0.6002.2.2.0.768.3
Locale ID: 1043
Additional Information 1: fd00
Additional Information 2: ea6f5fe8924aaa756324d57f87834160
Additional Information 3: fd00
Additional Information 4: ea6f5fe8924aaa756324d57f87834160
4) at that point there is no info added to the apache error log
5) now i close the pop up
6) then the previous mentioned lines are added to the error log (restarting apache)
When i check my browser network, the error happens on this GET:
http://typo3t1.local/typo3/mod.php?M=tools_ExtensionmanagerExtensionmanager&moduleToken=22799cc88caf7817031b07bc69ad0235b0474d5e
with this response:
(failed)
net::ERR_CONNECTION_RESET
I found the sollution. Add these lines to httpd.conf:
# 8388608 = 8*1024*1024
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
Restart Apache.
I got this from here:
http://www.adick.at/2012/10/02/apache-crash-php5ts-dll/
It seems to be a "Stack Overflow" :)

mod_security prevents Apache from starting - no errors

I installed mod_security 2.8.0 on my Apache 2.4 installation. I copied the yajl.dll into my bin folder, the .so file into my modules, added the configuration as the readme suggested, but when I start Apache, it fails.
But it only fails if I specify rules (I tried a lot of different ones, one at a time). Every time there is a rule, Apache fails to start.
If I go with only
SecRuleEngine On
SecDefaultAction "deny,phase:2,status:403"
Then it works fine. The error log shows only:
[Mon May 19 11:24:10.010299 2014] [:notice] [pid 2820:tid 496] ModSecurity for Apache/2.8.0 (http://www.modsecurity.org/) configured.
[Mon May 19 11:24:10.010299 2014] [:notice] [pid 2820:tid 496] ModSecurity: APR compiled version="1.5.0"; loaded version="1.5.0"
[Mon May 19 11:24:10.010299 2014] [:notice] [pid 2820:tid 496] ModSecurity: PCRE compiled version="8.34 "; loaded version="8.34 2013-12-15"
[Mon May 19 11:24:10.010299 2014] [:notice] [pid 2820:tid 496] ModSecurity: LUA compiled version="Lua 5.1"
[Mon May 19 11:24:10.010299 2014] [:notice] [pid 2820:tid 496] ModSecurity: LIBXML compiled version="2.9.1"
I.e. no errors. If I add a rule that is misconfigured (missing ID) it will log it here, but as you can see it doesn't - but Apache won't start.
System is Windows Server 2008 R2 64 bit.
I don't know if this helps, but I had this problem just minutes ago, and diagnosed that the mod_security installation changed my server root in the httpd_conf to "c:/apache24/" when there was no such file on my system, I changed it back to "c:/xampp/apache/" and it started up just fine again, no probs.

Apache can't read anything from mod_wsgi.so

I'm using Apache2.2 on WIndows 7. I tried to load mod_wsgi.so to Apache2.2 by adding the following line to httpd.conf:
LoadModule wsgi_module modules/mod_wsgi.so
In httpd.conf, there's some lines using directives from mod_wsgi.so (maybe depend on this so, I'm not sure) like this line:
WSGISocketPrefix D:\tool\apache2.2\conf
This line made me stuck by the following error which I get from Apache2.2 log:
[Thu Jul 25 21:44:25 2013] [notice] Parent: Received restart signal -- Restarting the server.
[Thu Jul 25 21:44:25 2013] [notice] Child 6436: Exit event signaled. Child process is ending.
[Thu Jul 25 21:44:25 2013] [warn] module wsgi_module is already loaded, skipping
Syntax error on line 20 of D:/work/tool/apache2.2/conf/graphite.conf:
Invalid command 'WSGISocketPrefix', perhaps misspelled or defined by a module not included in the
server configuration
[Thu Jul 25 21:44:25 2013] [warn] (OS 995)The I/O operation has been aborted because of either a
thread exit or an application request. : winnt_accept: Asynchronous AcceptEx failed.
[Thu Jul 25 21:44:26 2013] [notice] Child 6436: Released the start mutex
[Thu Jul 25 21:44:27 2013] [notice] Child 6436: All worker threads have exited.
[Thu Jul 25 21:44:27 2013] [notice] Child 6436: Child process is exiting
Please help me!!
The WSGISocketPrefix isn't used on Windows and you should not be setting it. It is only relevant to mod_wsgi daemon mode which is only supported on UNIX systems.

XAMPP Apache startup issues

This is first problem like that on my PC. Honestly saying I tried all solutions from the first pages of google and no one did work. I was able to start the server without any problem one month ago but today I'm starting it and it automatically stops. I tried to change port from 80 to 8080, 1337, 9999 and no one did work so I don't think it's a port problem(I've also tried to change the port in SSL config of apache) and few other solutions shown on few pages but I cant! It still stops, I don't know if a satan controlls the ports or what. Please help me without posting links because I tried them all. I don't really know if it's a good problem for stackoverflow but it seems to be really annoying so I've decided to post it here. That would be nice to see any help. I don't care if you don't like the problem and give me the magic downvote, all I need is the solution.
[Thu Aug 08 16:42:39.843750 2013] [mpm_winnt:notice] [pid 3324:tid 188] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Thu Aug 08 16:42:39.843750 2013] [mpm_winnt:notice] [pid 3324:tid 188] AH00456: Server built: Aug 18 2012 12:41:37
[Thu Aug 08 16:42:39.843750 2013] [core:notice] [pid 3324:tid 188] AH00094: Command line: 'd:\\xampp\\apache\\bin\\httpd.exe -d D:/xampp/apache'
[Thu Aug 08 16:42:39.859375 2013] [mpm_winnt:notice] [pid 3324:tid 188] AH00418: Parent: Created child process 3472
[Thu Aug 08 16:42:41.140625 2013] [mpm_winnt:crit] [pid 3472:tid 1884] (OS 10022)An invalid argument was supplied. : AH00405: Child: WSASocket failed to open the inherited socket
[Thu Aug 08 16:42:41.140625 2013] [mpm_winnt:crit] [pid 3324:tid 188] AH00427: Parent: child process exited with status 3 -- Aborting.
i was having the same issue however after i restart the computer it went ok...
that happens because 'system' is using port 80...
try to:
Close XAMPP
Open "SERVICES.MSC"
Stop "Web Deployment Agent Service"
In my case this was apparently caused by Winsock2 corruption. In case anyone else experiences this issue, try the Fix It link at the bottom of this page from Microsoft:
http://support.microsoft.com/kb/811259/en
(as recommended here https://community.apachefriends.org/f/viewtopic.php?f=16&t=49824)
That solved it for me; changing the port and other things mentioned here did not.