Apache :: Capturing Internal Apache Errors Return Custom HTTP Status
Nov 15, 2013
Server Version: Apache/2.2.22 (Unix)
On our production service, we've been getting numerous malformed POST requests to some of our CGI scripts that are showing up as 500 errors in our logs. They are malformed in the sense that the actual content length doesn't match the Content-Length specified in the request.
Here's the most trivial example I can come up with that reproduces the problem for us:
In addition to the 500 error in the access log, we see the corresponding error in the error log:
(70014)End of file found: Error reading request entity data
Based on the nature of the POST request and the error response, it does appear that Apache is doing the right thing here.
The POST never actually makes it as far as the script being targeted (/some_valid_alias in the above example); in other words, Apache returns 500 to the client, writes the error to the error log and never executes the script.
Is there a way to capture/avoid internal Apache errors like 70014, and return some other HTTP status besides 500 (like 403)? It's particularly annoying in our case, because our server sends us an email for all 500 errors.
So far, our best "defense" against these 500 errors is to disallow POST for these aliases, which normally just ignore the POST data anyway (when the request is not malformed):
we have an option in WHM which we can view the Apache Process, but we don't have this option in PLESK, can I view Apache Process in PLESK too or from SSH?
how i can enable apache status like cPanel ! in directadmin
before im enabled
Location /httpd-status> SetHandler server-status </Location> but seems its not like cPanel ( dont show IP and where file now downloaded ... and more information)
Server Version: Apache/2.2.3 (CentOS) Server Built: May 28 2009 12:50:07
Current Time: Wednesday, 10-Jun-2009 05:59:10 EDT Restart Time: Tuesday, 09-Jun-2009 13:39:08 EDT Parent Server Generation: 0 Server uptime: 16 hours 20 minutes 1 second 19 requests currently being processed, 13 idle workers
Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request, "W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup, "C" Closing connection, "L" Logging, "G" Gracefully finishing, "I" Idle cleanup of worker, "." Open slot with no current process
PID Key:
4494 in state: W , 5241 in state: W , 3142 in state: _ 4318 in state: _ , 4319 in state: W , 5173 in state: _ 4175 in state: W , 5242 in state: W , 5174 in state: W ....
Pretty new to Apache and recently enabled teh Apache Server Status module.
A column is confusing me, after CONN/CHILD/SLOT is CLIENT, most of the addresses in this column are my own local addresses but I have a few which I don't recognise and show up on whois.net as follows;
203.188.201.201 = Yahoo Mail 199.87.232.177 = No Result 141.44.51.95 = Query terms are ambiguous 58.218.204.102 = CHINANET-JS
In Cpanel, If i click on Apache Status it tells me aload of website that have been visited recently, under the vhost column. It shows this but sometimes under those it shows aload of (unavailable). Why is this. Is this normal?
I've been asked to put an Apache Reverse Proxy in place as per guidance from SAP - [URL] - but have come across an issue where the CSS file is not rewritten by the reverse proxy. The below is the Virtual Hosts entry from the test httpd.conf that i'm running to get it working. I'll be moving this to vhosts entries when it eventually works (optimism slowly vanishing! ).
Listen 443 <VirtualHost *:443> SSLEngine On SSLProxyEngine On ProxyRequests Off ProxyPreserveHost On SSLProxyCheckPeerCN off SSLProxyCheckPeerName off AllowEncodedSlashes On SSLCertificateFile /Apache24/conf/FILE.crt SSLCertificateKeyFile /Apache24/conf/KEYFILE.key SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown ServerName Gateway.External.co.uk ProxyPass / http://SAPGateway.Internal:8010/ nocanon ProxyPassReverse / http://SAPGateway.Internal:8010/ ErrorLog "C:/Apache24/logs/error.log" TransferLog "C:/Apache24/logs/access.log" </VirtualHost>
Each post I come across with a similar issue mentions the trailing '/' on the ProxyPass entries, unfortunately - for me - they're there!
I'm not sure I understand the server-status page enough to know if this is a problem or not, but I have several processes that seem to run forever, or until I restart Apache. e.g.
Code: 13-1 21045 0/697/4264 W 59.45 19641 0 0.0 43.28 274.97 66.249.66.133 www.example.com GET /wp/2005/01/ HTTP/1.1 19-1 408 1/834/1831 C 83.52 32463 0 14.8 149.66 263.48 66.249.66.133 www.example.com GET /wp/ HTTP/1.1 30-1 14416 0/430/431 W 35.19 13347 0 0.0 37.42 37.44 66.249.66.133 www.example.com GET /wp/category/issues/ HTTP/1.1
They are almost always on a single domain (there's about 100 on the server) that's a Wordpress site. These processes are also almost always a search engine.
On the rare case I see them running on other domains on the same server they're always on Wordpress sites.
The longer the processes run, the more processor/memory they use, the more they slow the server down.
It seems to have just started in the past few weeks, I've had the site there for a couple years.
Whenever am trying to post anything there server load increse upto 90 and Post takes so much time to publish.
and at that time sometime am getting this error
Error establishing the database connection
Here is the screenshot of the Cpanel stats:
[url]
and am getting these error in my apache error logs
[Wed Oct 28 19:46:19 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/webadmin [Wed Oct 28 19:46:19 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/myadmin [Wed Oct 28 19:46:18 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/mysql [Wed Oct 28 19:46:18 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/mysqlmanager [Wed Oct 28 19:46:17 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/sqlmanager [Wed Oct 28 19:46:17 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/admin [Wed Oct 28 19:46:16 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/PMA [Wed Oct 28 19:46:16 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/web [Wed Oct 28 19:46:16 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/db [Wed Oct 28 19:46:15 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/phpMyAdmin [Wed Oct 28 19:46:15 2009] [error] [client 222.103.225.163] File does not exist: /usr/local/apache/htdocs/phpmyadmin
We are currently using Apache 2.2.10 as the reverse proxy for the SAP portal server 7.3.1. The SAP applications are built based on webdynpro abap technology.2 of the apps are getting intermittent spinning circles. The Apache server will ultimately timeout and give the "bad request" and HTTP 400. We were never able to reproduce the problem except we do see users are running into them. Obviously, the problems occur very randomly, but often enough to generate a lot of support tickets. No error was generated in the sap system log.
Here is what I see from the apache access log and error log:
[31/Jul/2014:23:50:26 -0400] TLSv1 AES128-SHA "POST /sap/bc/webdynpro/sap/ZR_SSEPP_OPERATIONAL_SCHEDULE;sap-ext-sid=VcFRQjFOvu8TJYp9gDoeAA--4x1GQAg0MPPjCUEQif5iWQ--?sap-contextid=SID%3aANON%3asapprd_PR3_03%3aezUnW-FXtaYVyXREaAD7rxW0k8o5pk_n9RfjPfcB-NEW HTTP/1.1" 400 3004 "https://xxxxx/sap/bc/webdynpro/sap/ZR_SSEPP_OPERATIONAL_SCHEDULE;sap-ext-sid=VcFRQjFOvu8TJYp9gDoeAA--4x1GQAg0MPPjCUEQif5iWQ--" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)" 706345611
[Fri Aug 01 14:19:07 2014] [error] [client 10.4.53.198] (70014)End of file found: proxy: error reading status line from remote server xxxxxx, referer: https://xxxxx/sap/bc/webdynpro/sap/ZR_SSEPP_OPERATIONAL_SCHEDULE;sap-ext-sid=RaH2yjQlV6o7wVaj6wv6zA--LXTMFzjjKvcuwT*DXWoBmA--
I found bug 37770 and went to see the apache admin. But he thinks that the parameter(proxy-initial-not-pooled=1) that fixes the bug only applies to mod_proxy_http. However, we are using mod_proxy.
I want to make it an internal rewrite though, not an external redirect. If I remove the [R=303] I still end up with a redirect (a 302). I assume mod_rewrite is forcing an external redirect because it's to a different [sub]domain.
Is there any way I can overcome this and make the change internal?
This is just an internal server setup to learn web programming and looking to create a environment close as possible to the real world setup. I'm using xxxx.dlinkddns.com
However, when I put the extra code at the end of my redirect in .htaccess I get "Bad flag delimiters" and the internal server error page.I am using Apache 2.4 with PHP 5.4.11 on Windows.
I'm looking to pass the entries to a web form, via Apache, to an external process (listening on a port say 4321) running on the same host as Apache.Is there a way to "coerce" Apache into doing this?
I'm in the process of trying to pin down a couple errors I've been running into, and after installing and configuring SSL I have occasionally been receiving the following error:
Suddenly on a particular website (possibly following an easyapache php minor version update) if I specify a folder rather than a specific file I get a 503 response.
If I do the same on https it's ok. But http always gets a 503.
If I specify a file it's fine, but the folder always hits a 503.
I have removed the htaccess file and php.ini to rule that out and indeed they weren't factors - it seems like it goes wrong before reading the htaccess file.