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

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.

Related

Apache Internal Sever Error after 5 minutes of waiting for a response using Dev Desktop on Win 10

I use xdebug with VS Code to inspect variables on my local Drupal 8 installation on Win 10, but after approximately 5 minutes (it is always the same amount of time) I get an Internal Server Error and can't inspect my variables any longer. I tried increasing memory_limit in my php.ini file but to no effect. I increased max_execution_time in php.ini and nothing changed. I increased FcgidIOTimeout and FcgidMaxRequestLen in httpd.conf and nothing changed. I got the following output from C:\Program Files (x86)\DevDesktop\apache\logs\error.log :
[Sat May 25 12:37:02.785838 2019] [fcgid:warn] [pid 21796:tid 1112]
(OS 109)The pipe has been ended. : [client 127.0.0.1:61083]
mod_fcgid: get overlap result error, referer:
http://drupal.dd:8083/node [Sat May 25 12:37:02.785838 2019]
[core:error] [pid 21796:tid 1112] [client 127.0.0.1:61083] End of
script output before headers: index.php, referer:
http://drupal.dd:8083/node
Please help.

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.

WebServers cannot connect to app server ELB - AWS

I have a simple deployment with some webservers connected to an AWS ELB. This ELB in-turn has some application servers behind it.
The webservers are unable to connect to the application server ELB. The httpd error log is full of:
[Thu Dec 22 15:28:05.897273 2016] [proxy:error] [pid 10188] (70007)The timeout specified has expired: AH00957: HTTP: attempt to connect to 54.254.179.37:80 (elblinkhere) failed
[Thu Dec 22 15:28:05.897348 2016] [proxy:error] [pid 10188] AH00959: ap_proxy_connect_backend disabling worker for (elblinkhere) for 60s
[Thu Dec 22 15:28:05.897361 2016] [proxy_http:error] [pid 10188] [client 10.0.0.54:13789] AH01114: HTTP: failed to make connection to backend: elblinkhere
I have tried to check if this is an SELinux issue but that does not seem so.
I have also read a large number of threads on the internet about this and not come across any solutions.
My question(s):
1. What other methods can I use to resolve this?
2. How do I resolve this?
Did you configure your ELB as external and also enabled necessary port for ELB's security group?

Jboss Mod_cluster

I have a jboss cluster with 2 nodes (a and b) + 1 apache working as mod_cluster (apache in a separate server)
If one of the nodeA goes down, mod cluster can't connect to another one.
So, if nodeA crashes, I can't access jboss aplication by http://apache_server/myapp, but I can by http://nodeb/myapp and vice-versa
I dig on google almost all i have found say that is related to sessions but I can't fnd whats is wron with my config. (Mod_cluster as configured with this tool Load Balancer Configuration Tool
NodeA Log
15/05/2016 07:45:22,741 ERROR [org.jgroups.protocols.TCP] (http-/nodeA:8080-90) failed sending message to jbossnodeb:jbossnodeb/web (4148 bytes): java.net.SocketException: Socket closed, cause: null
15/05/2016 07:45:22,790 ERROR [org.jgroups.protocols.TCP] (OOB-6464,shared=tcp) failed sending message to jbossnodeb:jbossnodeb/web (4141 bytes): java.net.SocketException: Broken pipe, cause: null
NodeB Log
15/05/2016 07:45:23,126 ERROR [org.jgroups.protocols.TCP] (OOB-4949,shared=tcp) failed sending message to jbossnodea:jbossnodea/web (79 bytes): java.net.SocketException: Broken pipe, cause: null
15/05/2016 07:45:53,457 WARN [org.jgroups.protocols.TCP] (Timer-1,shared=tcp) null: no physical address for jbossnodea:jbossnodea/web, dropping message
Apache mod_cluster server log
[Sun May 15 07:45:04 2016] [error] (70007)The timeout specified has expired: proxy: read response failed from (null) (nodeA_IP)
[Sun May 15 07:45:34 2016] [error] (70007)The timeout specified has expired: ajp_cping_cpong: apr_socket_recv failed
[Sun May 15 07:45:38 2016] [error] ajp_handle_cping_cpong: ajp_ilink_receive failed
[Sun May 15 07:45:38 2016] [error] (70007)The timeout specified has expired: proxy: AJP: cping/cpong failed to (null) (nodeA_IP)
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: ajp_cping_cpong: apr_socket_recv failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:44 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:44 2016] [error] (70007)The timeout specified has expired: proxy: dialog to nodeA_IP:8009 (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] (70007)The timeout specified has expired: proxy: dialog to (null) (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] (70007)The timeout specified has expired: proxy: dialog to (null) (nodeA_IP) failed
[Sun May 15 07:45:45 2016] [error] ajp_read_header: ajp_ilink_receive failed
[Sun May 15 07:45:45 2016] [error] proxy: CLUSTER: (balancer://clusterjboss). All workers are in error state
Config apache mod_cluster
AdvertiseGroup 225.0.1.107:23364
KeepAliveTimeout 60
ManagerBalancerName clusterjboss
ServerAdvertise On
AdvertiseFrequency 5
EnableMCPMReceive
CreateBalancers 0
AllowDisplay On
ProxyPass / balancer://clusterjboss/ stickysession=JSESSIONID|jsessionid nofailover=On
Visibility
JBoss worker instances must be able to contact your ```EnableMCPMReceive`` VirtualHost
Your JBoss worker instances report their IP address and AJP port to the Apache HTTP Server
Your Apache HTTP Server must be able to contact them back on those reported addresses
ProxyPass
JGroups, Infinispan, Domains, Clustering
mod_cluster, i.e. modcluster subsystem has nothing to do with the aforementioned whatsoever. The subsystem is completely oblivious to the fact that there is some cluster formed or that you have your instances in a domain -- which is also irrelevant to having your instances in a cluster in the first place. Don't bother with JGroups messages while investigating mod_cluster configuration.
Although, if your JGroups cluster is broken...
Infinispan - i.e. distributed or replicated cache of your web session data in this case, relies on JGroups for forming a cluster and for exchanging messages in this cluster. If your instances cannot for a cluster or fail to exchange messages, you might experience a loss of session data on failover.
For example: Apache HTTP Server mod_cluster balacner decides to send request with JSESSIONID yadayadaXXX.worker-1 to worker-2, because worker-1 is down. Due to a network configuration error, worker-1 and worker-2 has never correctly formed a cluster, so worker-2 does not have the session data of worker-1. The result is a web application with a new session created, i.e. your client lost his context, e.g. shopping cart (popular showcase).
ProxyPass
Don't use it unless you have something specific in mind. The whole point of mod_cluster is that it creates all proxy directives in memory, on the fly dynamically as your worker nodes and their web applications come and go. You start fiddling with additional ProxyPass directives if you want to:
react to special error codes from a special web applciation, e.g. to treat HTTP codes that are supposed to mean an error as valid and vice versa
to serve static content directly from the Apache HTTP Server and not from worker nodes - e.g. pictures...
to load balance some contexts to mod_cluster-aware JBoss worker nodes and some contexts to non-mod_cluster servers, e.g. another Apache HTTP Server running Drupal in PHP...
ManagerBalancerName
It is not clear to me why you would need to change it. If you change the default value, you have to also alter balancer="new_value" in your Jboss modcluster subsystem configuration. What is actually does is that it tells mod_cluster in the Apache HTTP Server to create more separate named ProxyPass Balacners internally. One then could use ProxyPass directives to tweak them separately. Do you need to tweak them? According to the rest of your config I am convinced it is not the case. For example, the session stickiness is configured in JBoss nodes in mod_cluster subsystems - worker ndoes report this to the Apache HTTP Server balancer.
HTH, -K-
Possible changes that need to be done in domain.xml:
1. Under < domain-controller>, add < remote host="< ip-address-of-master-node>" port="< port>" security-realm="ManagementRealm"/>
2. Under < servers>, add < server name="slave-node" group="server-group" auto-start="true">
3. Under mod-cluster subsystem, add < mod-cluster-config advertise-socket="modcluster" proxy-list="< ip-address>:< port-in-mod-cluster-config" connector="ajp">
In mod-cluster configuration:
1. Allow from all
2. ManagerBalancerName server-group (exact name as above)
Also, are you using any virtualization/containers? To deal problems with session replication in such cases, you might need to try out "sticky session".

Apache and mod_wsgi returning 504 error when posting specific SVG string

I have a wierd 504 error occuring in Apache + mod_wsgi when I post a specific SVG string. The backend application is Python Flask, but it does not seem to get to the application at all.
Here is one request that returns a 504 error:
curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28style'
And here is another one that returns with 200:
curl 'https://some.domain.com/api/export/png' --data 'svg=%22%3E%28styl'
The difrrerence is that I only removed one character from the POST data
The SVG data is cut down to the smallest one that could produce an error. The original SVG string is much larger.
The error that appears in the apache error log is:
[Tue Jun 09 14:27:26 2015] [error] [client X.X.X.X] (104)Connection reset by peer: mod_wsgi (pid=19254): Unable to get bucket brigade for request., referer: https://some.domain.com/
[Tue Jun 09 14:27:26 2015] [error] [client X.X.X.X] mod_wsgi (pid=19252): Exception occurred processing WSGI script '/var/www/ade/src/interface.wsgi'.
[Tue Jun 09 14:27:26 2015] [error] [client X.X.X.X] IOError: failed to write data
It is interestig that the the error appears in the error log imidietly after I make the request, before the post data upload finishes.
Here are the version numbers we have:
Ubunut 12.04
Apache/2.2.22 (Ubuntu)
mod_ssl/2.2.22
OpenSSL/1.0.1
mod_wsgi/3.3
Python/2.7.3
Any clues what might be causing this?
UPDATE: We updated mod_wsgi to 4.4.12 and the error message changed in the error.log
[Wed Jun 10 05:48:35 2015] [error] [client X.X.X.X] mod_wsgi (pid=5019): Request data read error when proxying data to daemon process: Connection reset by peer., referer: http://devade.annalect.com/
This might be related to AWS load balancers in front of the web server. Will try to investigate on that end.
http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ts-elb-error-message.html#ts-elb-errorcodes-http504