Xvarnish (cachewall) with mod_pagespeed - apache

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.

Related

Enable HTTP2 in Apache 2.4.53

After reading this link, it's clear that HTTP2 and prefork don't work together. I am trying to get around this issue by disabling prefork in MPM.
I went and changed the httpd-mpm.conf and commented out the following statements:
<IfModule mpm_prefork_module>
#StartServers 5
#MinSpareServers 5
#MaxSpareServers 10
#MaxRequestWorkers 250
#MaxConnectionsPerChild 0
</IfModule>
and in my httpd.conf file i have enabled the module
LoadModule http2_module modules/mod_http2.so
and added the following configuration:
Protocols h2 h2c http/1.1
H2Direct on
I see no errors in my error log which are as follows:
[Thu Apr 14 23:03:59.295852 2022] [ssl:warn] [pid 18592:tid 220] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 14 23:03:59.297852 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00455: Apache/2.4.53 (Win64) OpenSSL/1.1.1n configured -- resuming normal operations
[Thu Apr 14 23:03:59.297852 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00456: Apache Lounge VS16 Server built: Mar 16 2022 11:26:15
[Thu Apr 14 23:03:59.298852 2022] [core:notice] [pid 18592:tid 220] AH00094: Command line: 'httpd.exe -d C:/Users/naraadia/.softwares/Apache24_2.4.53'
[Thu Apr 14 23:03:59.320854 2022] [mpm_winnt:notice] [pid 18592:tid 220] AH00418: Parent: Created child process 14840
[Thu Apr 14 23:04:00.406963 2022] [ssl:warn] [pid 14840:tid 228] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Apr 14 23:04:00.449967 2022] [mpm_winnt:notice] [pid 14840:tid 228] AH00354: Child: Starting 64 worker threads.
and none of my pages being served by the server have HTTP2 or h2 protocol in developer tools. All the pages have http/1.1 protocol. Is there a better way to achieve HTTP2 protocol being pushed? I feel prefork is still not disabled.
I have downloaded the server zip file and not compiled the server.
EDIT 1 : After Reading the mod_http2 documentation, it's clear that winnt mpm strategy is being used.
I tried to check if curl helps in determining if HTTP2 is enabled or not but when I run
curl -I --http2 http://localhost:8083 | findstr HTTP
It returns nothing.
Can anyone help in enabling HTTP2 or help in determining what is missing?
I went and changed the httpd-mpm.conf and commented out the following statements:
Those statments were wrapped in an <IfModule mpm_prefork_module> so would only be used if that module was enabled.
EDIT 1 : After Reading the mod_http2 documentation, it's clear that winnt mpm strategy is being used.
That's correct. Apache on windows uses it's own mpm module, which is compatible with HTTP/2.
and none of my pages being served by the server have HTTP2 or h2 protocol in developer tools. All the pages have http/1.1 protocol. Is there a better way to achieve HTTP2 protocol being pushed? I feel prefork is still not disabled.
Browsers only support HTTP/2 over HTTPS. Looks like, from your curl command, that you are only using unencrypted HTTP, rather than HTTPS. So this will not work, even though you have enabled H2Direct - both client and server need to support this to work and you have only enabled it on the server and cannot enable this on the browser.
I tried to check if curl helps in determining if HTTP2 is enabled or not but when I run
curl -I --http2 http://localhost:8083 | findstr HTTP
It returns nothing.
Using HTTP/2 over HTTP (rather than HTTPS) requires an upgrade header and round trip, though that is going to be deprecated. You should use --http2-prior-knowledge if wanting to use HTTP/2 over HTTP and are sure the server supports it.

MAMP: Apache Server is shut down automatically in Windows 10

OS: Windows 10
MAMP: 4.1.1
After installation, every time I run the program, Apache light goes green for a second and then turns off automatically. MySQL runs fine though.
The log file located at C:\MAMP\logs\apache_error.log contains these lines.
[Fri Jan 17 18:03:42 2020] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Fri Jan 17 18:03:43 2020] [warn] pid file C:/MAMP/bin/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Jan 17 18:03:43 2020] [notice] Digest: generating secret for digest authentication ...
[Fri Jan 17 18:03:43 2020] [notice] Digest: done
I find a lot of people online encountered the same situation as mine. But I cannot find out the solution. So I come here to find the potential solution.
P.S. I don't have the common Port 80 confliction problem. So I'm sure my problem is not related to it.
Navigate to C:\MAMP\conf\apache\extra.
Edit the httpd-ssl.conf and comment the following line:
...
SSLSessionCache shmcb:/some/example/path/ssl_scache(512000)
...
To:
...
# SSLSessionCache shmcb:/some/example/path/ssl_scache(512000)
...
Also, check out https://cwiki.apache.org/confluence/display/HTTPD/SSLSessionCache for more info. Hope this helps.

Apache2 Request on SSL waits until time-out expired to return data

I am working with a server that I recently inherited from a departed developer. The server returns XML documents via a REST-ful interface over an SSL port. For small documents, the data is returned quickly. For larger (say, larger than 1 MB), the server waits until the server time-out value is exhausted and then returns the data.
I know this because if I set the time-out value to five minutes the data will be returned to a browser in a little over 300 seconds. If I drop the time-out value to two minutes, it will be returned in about 120 seconds. If I drop it to 10 seconds, then the data is returned in about 10 seconds.
Now, if I set my VirtualHost to port 80, the data is returned almost instantly, which is what I expect.
There are a number of diagnostics in the apache log files such as:
[Thu Apr 28 16:46:44.234689 2016] [ssl:info] [pid 22606] (70014)End of file found: [client 172.26.61.243:62030] AH01991: SSL input filter read failed.
[Thu Apr 28 16:46:44.237818 2016] [ssl:debug] [pid 22509] ssl_engine_io.c(1212): (70014)End of file found: [client 172.26.61.243:62030] AH02007: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
[Thu Apr 28 16:46:44.569913 2016] [ssl:debug] [pid 22426] ssl_engine_io.c(1212): (70007)The timeout specified has expired: [client 172.26.61.243:62031] AH02007: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!]
I do not know if these are relevant nor where to look for a solution. I have searched the internet, Apache and SSL documentation and found nothing relevant or useful.

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

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)

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.