Re: [users@httpd] mod_proxy_html, HTML rewrite and content compression

2012-11-16 Thread Thomas Eckert

On 11/14/2012 06:12 PM, Nick Kew wrote:

On 14 Nov 2012, at 15:53, Thomas Eckert wrote:


Is there a way to work around this ? I do want the call to mod_xml2enc to 
happen but I also want the reverse proxy to support content compression.

That's a lot of correct analysis.

The output chain you want is INFLATE;xml2enc;proxy-html;DEFLATE .
What problems do you encounter (apart from processing overhead)
when you set all that?

I guess ideally ProxyHTMLEnable should detect compressed content
and insert INFLATE where necessary.  Maybe even have an option to
set DEFLATE.  But as of now it doesn't: I got the impression most
users prefer to disable compression, and avoid the substantial
processing overhead of zipping in a proxy.

Thanks for the hint but unfortunately manually adding xml2enc to the 
filtering chain does not help. The output is still broken. One thing I 
noticed was the DEFLATE filter is not necessary, since apache will do 
the compression anyway (even though I removed AddOutputFilter text/html 
DEFLATE from my global config). That's why it's not present below.


Here are some debug log extracts which confuse me. Note, I patched 
mod_proxy_html.c with a one-liner to get me Running proxy_html_filter 
into the log, otherwise mod_proxy_html only gives feedback in error 
situations and I wouldn't be able to defer from the log when 
mod_proxy_html is running.



SetOutputFilter INFLATE;proxy-html gets the page displayed correctly

[pid 14245:tid 2714090352] proxy_util.c(1998): AH00943: http: has 
released connection for (vhost01.backend03.local)
[pid 14245:tid 2714090352] mod_deflate.c(1283): [client 
10.10.10.10:40375] AH01398: Zlib: Inflated 348 to 674 : URL /
[pid 14245:tid 2714090352] [client 10.128.128.60:40375] Running 
proxy_html_filter
[pid 14245:tid 2714090352] mod_deflate.c(763): [client 
10.10.10.60:40375] AH01384: Zlib: Compressed 655 to 342 : URL /

 customized log message from LogFormat+CustomLog appears here 


SetOutputFilter INFLATE;xml2enc;proxy-html results in curl: (52) 
Empty reply from server


[pid 15039:tid 3007834992] proxy_util.c(1998): AH00943: http: has 
released connection for (vhost01.backend03.local)
[pid 15039:tid 3007834992] mod_deflate.c(1283): [client 
10.10.10.10:40388] AH01398: Zlib: Inflated 348 to 674 : URL /
[pid 15039:tid 3007834992] mod_xml2enc.c(183): [client 
10.10.10.10:40388] AH01430: Content-Type is text/html
[pid 15039:tid 3007834992] mod_xml2enc.c(259): [client 
10.10.10.10:40388] AH01434: Charset ISO-8859-1 not supported by libxml2; 
trying apr_xlate
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 674 bytes from bucket
[pid 15039:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40388] AH01441: xml2enc: converted 674/674 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] Running 
proxy_html_filter
[pid 15039:tid 3007834992] mod_deflate.c(763): [client 
10.10.10.10:40388] AH01384: Zlib: Compressed 655 to 342 : URL /
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 10 bytes from bucket
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 1/1 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40388] AH01441: xml2enc: converted 9/8 bytes
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 342 bytes from bucket

 customized log message from LogFormat+CustomLog appears here 
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 2/2 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 2/1 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 4/3 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 1/0 bytes
[pid 15039:tid 3007834992] [client 10.10.10.100:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(481): [client 
10.10.10.10:40388] AH01440: xml2enc: reinserting 332 unconsumed bytes 
from bucket
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01385: Zlib 
error -2 flushing zlib output buffer ((null))



ProxyHTMLEnable On results in  curl: (61) Error while processing 
content unencoding: invalid code lengths 

Re: [users@httpd] mod_proxy_fcgi + php-fpm + connection reset by peer

2012-11-16 Thread Jeff Trawick
On Thu, Nov 15, 2012 at 5:43 PM, Lazy lazy...@gmail.com wrote:

 Hi,

 we are using httpd 2.4.3 with php 5.4 running fpm mode.

 requests are passed to fpm using ProxyPassMatch. Everything works fine
 except,

 Sometimes database data gets corrupted. All of the data was visible in
 the form, but it gets truncated after ajax request commiting changes
 gets aborted (shows as aborted in firebug).

 in the access log:
 80.5.x.x - - [15/Nov/2012:14:03:43 +0100] POST
 /xxx,action,pollb,id,958.html HTTP/1.1 503 299
 https://xxx,action,pollb,id,958.html; Mozilla/5.0 (Windows NT 6.1;
 WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1

 in the error log:
 [Thu Nov 15 14:04:03.140026 2012] [proxy_fcgi:error] [pid 15633:tid
 140459279939328] (104)Connection reset by peer: [client
 80.5.x.x:34541] AH01075: Error dispatching request to :, referer:
 https://xxx,action,pollb,id,958.html

 There is haproxy and varnish before httpd, it is also doing ssl.
 80.5.x.x is remote clients ip (we are using mod_remoteip).

 What does the error code exactly mean ? Our client (haproxy) reset ed
 the connection ? Or was it php ?


PHP dropped the connection.

By chance is PHP_FCGI_MAX_REQUESTS set somewhere for the PHP process?  In
the old days it defaulted to 500 (exit after 500 requests), which led to
exactly this scenario, but with php-fpm it defaults to 0 (don't exit).



 Is it possible that somehow php processed the begining of the aborted
 POST truncating the data in the database ?


Unclear...  Do you have a way of tracking of crashes of php-fpm?  (Does it
have a log, or is there anything in the system log?)



 OpenSSL support in haproxy is new, and aborted connection directs
 suspicion on it (in case of httpd or varnish error there should be
 some kind of 5xx error not an aborted connection), but still I don't
 understand how the data got lost.


 Thanks for Your time,


 Regards,
 Michal Grzedzicki

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org




-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: [users@httpd] FcgidAccessChecker hangs.

2012-11-16 Thread Jeff Trawick
On Tue, Nov 13, 2012 at 8:59 PM, Peter Danenberg p...@roxygen.org wrote:

 mod_fcgid doesn't appear to have an external process manager; compare
 this process tree from mod_fastcgi where the access checker
 (872695a60a6d82aa9fc041bae44803af) is a child of fcgi is a child of
 httpd:

   /usr/local/apache2/bin/httpd -k start
\_ /usr/local/apache2/bin/fcgi- -k start
|   \_ 872695a60a6d82aa9fc041bae44803af

 to this one from mod_fcgid where the access checker is a direct
 descendant of httpd:

   /usr/local/apache2/bin/httpd -k start
|   \_ 872695a60a6d82aa9fc041bae44803af



mod_fcgid has a daemon-child of the httpd parent that spawns FastCGI
applications.  The backtrace will be something extremely similar to

apr_wait_for_io_or_timeout()  procmgr_peek_cmd() - pm_main() -
create_process_manager() - procmgr_post_config() - fcgid_init() -
ap_run_post_config() - main()



 I've attached straces from mod_fastcgi's process manager; as well as
 straces from 872695a60a6d82aa9fc041bae44803af running under mod_fcgid
 and mod_fastcgi, if that's helpful.

 Do you still have the original httpd-strace for mod_fcgid? If so, grep
 for access.scm; you'll see the script there.


Did you have a chance to compare the activity of the FastCGI app in both
circumstances, to see how the interaction differed?



 PS. I've since compiled mod_fastcgi against httpd-2.4.3; the only
 reason I was screwing around with mod_fcgid was that mod_fastcgi had
 stopped compiling against 2.4.3.

 It may be time to consider mod_fcgid abandonware, since I haven't
 heard from the authors; and go back to using mod_fastcgi in
 production.



Which version of mod_fcgid are you using?  Modern mod_fcgid (2.3.x) is
supported on this mailing list and in ASF Bugzilla.



  On Sun, Nov 11, 2012 at 8:41 PM, Peter Danenberg p...@roxygen.org
 wrote:
 
   Thanks for looking into this, Jeff; I've attached an strace with
   mod_fcgid (strace-fcgid), one with mod_fastcgi (strace-fastcgi) and
   one with mod_fcgid and relative time stamps so you can see where it
   hangs (strace-fcgid-with-relative-time).
  
 
  Ouch.  Is your script running in there somewhere?  I just saw httpd
  activity but no activity of your script.  (s/script/application/)
 
  Perhaps the most straightforward way to get a trace is to start httpd,
  identify the mod_fastcgi or mod_fcgid daemon process, start strace -fp
  DAEMON-PID, and then make the request.
 
  How to identify the mod_fcgid daemon: At startup, it logs a message at
  LogLevel info which says mod_fcgid: Process manager  started, where
   is the pid.
 
  mod_fastcgi?  I don't know.  But you may be very used to gdb and strace
  before this is over, so maybe you can pick the child that doesn't look
 like
  the others ;)
 
  --/--
 
  OTOH, how much effort is required to get your chicken-scheme script
 running
  on Linux?
 
 
 
  
   It looks like the immediate call is:
  
 rt_sigtimedwait(~[ILL TRAP ABRT BUS FPE KILL SEGV USR2 PIPE CONT
 STOP SYS RTMIN RT_1], NULL, NULL, 8) = 1
  
 
 
 
  
On Sunday, November 11, 2012, Peter Danenberg wrote:
   
 Digging a little deeper, mod_fcgid hangs on line 318 of
 fcgid_bridge.c:

   ap_scan_script_header_err_core(r, sbuf, getsfunc_fcgid_BRIGADE,
  brigade_stdout)

 I don't know enough about ap_scan_script_header_err_core yet to
 figure
 out why this might be the case.
   
   
Can You compare an strace/truss/dtruss of your script running with
 the
alternative modules?
   

  The following trivial script,[1] which simply returns a 200
 header,
  hangs under FcgidAccessChecker:
 
(call-with-dynamic-fastcgi-query
 (λ (query)
   (display-status-c.)))
 
  The same script works fine under mod_fastcgi with
  FastCgiAccessChecker; or handled as an fcgid-script or
   fastcgi-script.
 
  The output from error_log is as follows:
 
[Sun Nov 11 01:39:44 2012] [info] mod_fcgid: server
localhost:/usr/local/var/html/scm/api/access.scm(15965)
started
 
[Sun Nov 11 01:40:24 2012] [warn] [client 127.0.0.1] mod_fcgid:
   read
data timeout in 40 seconds
 
[Sun Nov 11 01:40:24 2012] [error] [client 127.0.0.1] Premature
   end of
script headers: access.scm
 
[Sun Nov 11 01:40:24 2012] [warn] [client 127.0.0.1] mod_fcgid:
   user
(null) access check failed, respond 500, URI
 /scm/api/access.scm
 
[Sun Nov 11 01:40:26 2012] [debug] fcgid_pm_main.c(357):
 mod_fcgid:
gracefully terminated 1 processes
 
  How can I diagnose the problem? I find it interesting that it
 works
  under mod_fastcgi but not mod_fcgid; I'm not sure whether that
   implies
  the problem is in mod_fcgid, however.
 
 
  Footnotes:
  [1]  The script is written in Chicken Scheme, by the way.
 
 
 
 

Re: [users@httpd] mod_proxy_fcgi + php-fpm + connection reset by peer

2012-11-16 Thread Jeff Trawick
On Fri, Nov 16, 2012 at 9:19 AM, Jeff Trawick traw...@gmail.com wrote:




 On Thu, Nov 15, 2012 at 5:43 PM, Lazy lazy...@gmail.com wrote:

 Hi,

 we are using httpd 2.4.3 with php 5.4 running fpm mode.

 requests are passed to fpm using ProxyPassMatch. Everything works fine
 except,

 Sometimes database data gets corrupted. All of the data was visible in
 the form, but it gets truncated after ajax request commiting changes
 gets aborted (shows as aborted in firebug).

 in the access log:
 80.5.x.x - - [15/Nov/2012:14:03:43 +0100] POST
 /xxx,action,pollb,id,958.html HTTP/1.1 503 299
 https://xxx,action,pollb,id,958.html; Mozilla/5.0 (Windows NT 6.1;
 WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1

 in the error log:
 [Thu Nov 15 14:04:03.140026 2012] [proxy_fcgi:error] [pid 15633:tid
 140459279939328] (104)Connection reset by peer: [client
 80.5.x.x:34541] AH01075: Error dispatching request to :, referer:
 https://xxx,action,pollb,id,958.html

 There is haproxy and varnish before httpd, it is also doing ssl.
 80.5.x.x is remote clients ip (we are using mod_remoteip).

 What does the error code exactly mean ? Our client (haproxy) reset ed
 the connection ? Or was it php ?


 PHP dropped the connection.

 By chance is PHP_FCGI_MAX_REQUESTS set somewhere for the PHP process?  In
 the old days it defaulted to 500 (exit after 500 requests), which led to
 exactly this scenario, but with php-fpm it defaults to 0 (don't exit).


whoops, the analogous php-fpm  setting is pm.max_requests
*
*





 Is it possible that somehow php processed the begining of the aborted
 POST truncating the data in the database ?


 Unclear...  Do you have a way of tracking of crashes of php-fpm?  (Does it
 have a log, or is there anything in the system log?)



 OpenSSL support in haproxy is new, and aborted connection directs
 suspicion on it (in case of httpd or varnish error there should be
 some kind of 5xx error not an aborted connection), but still I don't
 understand how the data got lost.


 Thanks for Your time,


 Regards,
 Michal Grzedzicki

 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org




 --
 Born in Roswell... married an alien...
 http://emptyhammock.com/




-- 
Born in Roswell... married an alien...
http://emptyhammock.com/


Re: [users@httpd] mod_proxy_html, HTML rewrite and content compression

2012-11-16 Thread Nick Kew
On Fri, 16 Nov 2012 11:31:38 +0100
Thomas Eckert thomas.eck...@sophos.com wrote:

 Thanks for the hint but unfortunately manually adding xml2enc to the 
 filtering chain does not help.

Looks like you've got problems over and above anything to do with
your configuration!

  SetOutputFilter INFLATE;proxy-html gets the page displayed correctly

I thought you said it had charset issues?


 [pid 15039:tid 3007834992] mod_xml2enc.c(259): [client 
 10.10.10.10:40388] AH01434: Charset ISO-8859-1 not supported by libxml2; 
 trying apr_xlate

That seems implausible.  How do you get a libxml2 install that
doesn't natively support ISO-8859-1 (latin1)?

 [pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
 [client 10.10.10.10:40388] AH01441: xml2enc: converted 1/1 bytes
 [pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
 invalid byte(s) in input stream!

 (and more conversion errors)

It looks as if your backend incorrectly identifies the charset
of the page in question.  Either that or you found a bug.
Do you have a URL where your unprocessed page could be viewed?

-- 
Nick Kew

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Re: Visual Studio C++ 6 Processor Pack

2012-11-16 Thread apache-admin

Hello Good Guy,

thanks for your answer.

I have looked through your suggested download list, but did not find
the Processor Pack for Visual C++ 6, that is needed to assemble the
SSL code with the build procedure.

Do you have another idea where to get this optional software pack ?

Thanks a lot.

apache-admin


Am 2012-11-16 02:30, schrieb Good Guy:

On 15/11/2012 20:36, apache-ad...@ultra-it.de wrote:

Hello,

I want to build the new version 2.2.23 of the Apache HTTPD
on myself to get involved in the debugging of the http server.

Unfortunately I was not able to find the Visual C++ 6.0
Processor Pack at microsofts download center nor on the web.
Does anyone know, where I can get this processor pack ?

Would be great, if you could help me.

Thanks a lot.

apache-admin



http://www.cnet.com/topic-software/microsoft-visual-c.html




-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] trouble cross compiling for e500v2

2012-11-16 Thread Ken Kelly-Turner
Hi all,

I'm trying to run apache on a powerpc board but whenever I try to run
it I get the following error

Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps:
Assertion `nlist  1' failed!

as soon as I try and start it.  Google seems to think it's an issue
with glibc but I've run other cross compiled applications and they've
run without issue.  If anyone has any idea of the potential
cause/solution I would really appreciate it as Google has failed to
provide any helpful results

Thanks,
Ken

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] trouble cross compiling for e500v2

2012-11-16 Thread Igor Galić


- Original Message -
 Hi all,
 
 I'm trying to run apache on a powerpc board but whenever I try to run
 it I get the following error
 
 Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps:
 Assertion `nlist  1' failed!
 
 as soon as I try and start it.  Google seems to think it's an issue
 with glibc but I've run other cross compiled applications and they've
 run without issue.  If anyone has any idea of the potential
 cause/solution I would really appreciate it as Google has failed to
 provide any helpful results

I'm not sure if I read this correctly: My suggestion is to disable
linker maps, if your linker supports that, and see how that works
out for your build.
 
 Thanks,
 Ken

i

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.ga...@brainsware.org
URL: http://brainsware.org/
GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] trouble cross compiling for e500v2

2012-11-16 Thread Ken Kelly-Turner
Hi Igor,

I'm new to cross-compilation and linkiners. How do I check disable
linker maps (using ld)

Thanks,
Ken

On Fri, Nov 16, 2012 at 2:06 PM, Igor Galić i.ga...@brainsware.org wrote:


 - Original Message -
 Hi all,

 I'm trying to run apache on a powerpc board but whenever I try to run
 it I get the following error

 Inconsistency detected by ld.so: dl-deps.c: 622: _dl_map_object_deps:
 Assertion `nlist  1' failed!

 as soon as I try and start it.  Google seems to think it's an issue
 with glibc but I've run other cross compiled applications and they've
 run without issue.  If anyone has any idea of the potential
 cause/solution I would really appreciate it as Google has failed to
 provide any helpful results

 I'm not sure if I read this correctly: My suggestion is to disable
 linker maps, if your linker supports that, and see how that works
 out for your build.

 Thanks,
 Ken

 i

 --
 Igor Galić

 Tel: +43 (0) 664 886 22 883
 Mail: i.ga...@brainsware.org
 URL: http://brainsware.org/
 GPG: 6880 4155 74BD FD7C B515  2EA5 4B1D 9E08 A097 C9AE


 -
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org