Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Steve Hay
Hi,

I posted this problem the other day, deep inside a thread about 
something else, and didn't get any replies; maybe nobody spotted it?

Does anybody have Apache::Dispatch working on Windows with Perl 5.8.0?   
Randy?

I'm trying to build it on Windows XP (MSVC++ 6) with Perl 5.8.0 / Apache 
1.3.27 / mod_perl 1.28, but I get these errors:

[...]
  link -out:blib\arch\auto\Apache\Dispatch\Dispatch.dll -dll 
-nologo -node
faultlib -release  -libpath:C:\perl5\lib\CORE  -machine:x86 
Dispatch.obj   C:\
perl5\lib\CORE\perl58.lib libeay32.lib  oldnames.lib kernel32.lib 
user32.lib gdi
32.lib winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib 
oleaut32.li
b  netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib  version.lib 
odbc32.lib o
dbccp32.lib msvcrt.lib -def:Dispatch.def
 Creating library blib\arch\auto\Apache\Dispatch\Dispatch.lib and 
object blib\
arch\auto\Apache\Dispatch\Dispatch.exp
Dispatch.obj : error LNK2001: unresolved external symbol 
_perl_perl_merge_dir_co
nfig
Dispatch.obj : error LNK2001: unresolved external symbol 
_perl_cmd_perl_TAKE1
Dispatch.obj : error LNK2001: unresolved external symbol 
__imp__ap_register_clea
[EMAIL PROTECTED]
Dispatch.obj : error LNK2001: unresolved external symbol 
_perl_perl_cmd_cleanup
Dispatch.obj : error LNK2001: unresolved external symbol 
__imp__ap_null_cleanup
Dispatch.obj : error LNK2001: unresolved external symbol [EMAIL PROTECTED]
Dispatch.obj : error LNK2001: unresolved external symbol _perl_clear_symtab
Dispatch.obj : error LNK2001: unresolved external symbol 
__imp__ap_remove_module
@4
Dispatch.obj : error LNK2001: unresolved external symbol 
__imp__ap_find_linked_m
[EMAIL PROTECTED]
Dispatch.obj : error LNK2001: unresolved external symbol 
_perl_get_startup_pool
Dispatch.obj : error LNK2001: unresolved external symbol 
[EMAIL PROTECTED]
blib\arch\auto\Apache\Dispatch\Dispatch.dll : fatal error LNK1120: 11 
unresolved
externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.

Any ideas?

- Steve




Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Thomas Klausner
Hi!

On Thu, Sep 11, 2003 at 08:33:31AM +0100, Steve Hay wrote:

 I posted this problem the other day, deep inside a thread about 
 something else, and didn't get any replies; maybe nobody spotted it?
 
 Does anybody have Apache::Dispatch working on Windows with Perl 5.8.0?   
 Randy?

Randy posted this some time ago:

 I just made one up, which you can install as
 C:\ ppm install
 http://theoryx5.uwinnipeg.ca/ppmpackages/Apache-Dispatch.ppd

Maybe this works for you?

See:
http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/Looking_for_Apache::Dispatch_PPD_P73122/


-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Thomas Klausner
Hi!

On Thu, Sep 11, 2003 at 08:59:23AM +0100, Steve Hay wrote:

 I would rather be able to build the module myself anyway, rather than 
 using a PPM package.

I guess (and Geoffrey (who BTW transfered maintainership of Apache::Dispatch
to me..) suggested something) the problem lies within the custom configuration
directives used by Apache::Dispatch.

I'm planning to make these optional in the next release of Apache::Dispatch,
so you could either use
  DispatchPrefix Bar
(which needs compiling)
or 
  PerlSetVar DispatchPrefix Bar
(which doesn't need compiling and should thus make installation easier)

 BTW, do other people have it working under Perl 5.8.0 on other 
 platforms?  I'm not sure if this problem is Windows-related or 
 5.8.0-related.

There is one FAIL reported on:
http://testers.cpan.org/show/Apache-Dispatch.html

I complied it without problem on Linux Perl 5.8.0 and 5.6.1.



-- 
#!/usr/bin/perl   http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Custom Log files Under MP2

2003-09-11 Thread Tofu Optimist
Specifically,
I'd like to log certain image file requests (all files
with .jpg, .gif, and .png extensions) to a custom log,

image_log, logging IP, file, time, status, bytes,
referer, cookies, etc. 

I care about speed here.

Would you suggest a native logging 
 http://www.modperlcookbook.org/chapters/ch16.pdf 

or take this route
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler

If the former, would you have any sample 
config code to illustrate?

Thanks!

-TO





--- Geoffrey Young [EMAIL PROTECTED] wrote:
 
 
 Tofu Optimist wrote:
  I would like to append a small line of log
 information
  to a file on certain apache2 requests.  For this
  application, I am very concerned about speed, so
 i'm
  looking for fast simple solutions. 
 
 if speed is the concern, just stick to apache's
 native logging mechanism.
 
 see recipe 16.5, Conditional Logging in the
 mod_perl developer's cookbook:
 
 http://www.modperlcookbook.org/chapters/ch16.pdf
 
 in mod_perl 2.0, it's still $r-subprocess_env(),
 but you need to load 
 APR::Table first.
 
 HTH
 
 --Geoff
 
 
 
 -- 
 Reporting bugs: http://perl.apache.org/bugs/
 Mail list info:
 http://perl.apache.org/maillist/modperl.html
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


Re: Custom Log files Under MP2

2003-09-11 Thread Geoffrey Young


Tofu Optimist wrote:
Specifically,
I'd like to log certain image file requests (all files
with .jpg, .gif, and .png extensions) to a custom log,
image_log, logging IP, file, time, status, bytes,
referer, cookies, etc. 

I care about speed here.

Would you suggest a native logging 
 http://www.modperlcookbook.org/chapters/ch16.pdf 

or take this route
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler
native Apache routines, written in C, will always be faster, so if you can 
get the same functionality from native routines use them.  it's the 
flexibility mod_perl offers that makes it special :)

If the former, would you have any sample 
config code to illustrate?
I think the conditional logging recipe is pretty descriptive.  see also the 
CustomLog directive description in the apache documentation

http://httpd.apache.org/docs-2.0/mod/directives.html

FilesMatch might also help.

--Geoff

Thanks!

-TO





--- Geoffrey Young [EMAIL PROTECTED] wrote:

Tofu Optimist wrote:

I would like to append a small line of log
information

to a file on certain apache2 requests.  For this
application, I am very concerned about speed, so
i'm

looking for fast simple solutions. 
if speed is the concern, just stick to apache's
native logging mechanism.
see recipe 16.5, Conditional Logging in the
mod_perl developer's cookbook:
http://www.modperlcookbook.org/chapters/ch16.pdf

in mod_perl 2.0, it's still $r-subprocess_env(),
but you need to load 
APR::Table first.

HTH

--Geoff



--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info:
http://perl.apache.org/maillist/modperl.html


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Randy Kobes
On Thu, 11 Sep 2003, Steve Hay wrote:

 Thomas Klausner wrote:

 On Thu, Sep 11, 2003 at 08:33:31AM +0100, Steve Hay wrote:
 
 I posted this problem the other day, deep inside a
 thread about something else, and didn't get any replies;
 maybe nobody spotted it?
 
 Does anybody have Apache::Dispatch working on Windows with Perl 5.8.0?
 Randy?
 
 Randy posted this some time ago:
 
 I just made one up, which you can install as
 C:\ ppm install
 http://theoryx5.uwinnipeg.ca/ppmpackages/Apache-Dispatch.ppd
 
 Maybe this works for you?
 
 Sadly, no - that URL is now a 404.  The directory there still exists,
 but there's no Apache-Dispatch.ppd in it.

Sorry about that - that package apparently didn't survive a
disc crash we had. I'll make up a new one and put it up
there tonight. However, this will be for Perl-5.6.1, so
won't be compatible with 5.8.0.

 I would rather be able to build the module myself anyway, rather than
 using a PPM package.

The problem you described before with the missing symbols
can be resolved by linking against the mod_perl.lib built
when you build mod_perl.so. This can be done by adding in
a LIBS attribute to WriteMakefile() in Makefile.PL with a
value of ' -L/Path/to/mod_perl_lib -lmod_perl'.

-- 
best regards,
randy


Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Geoffrey Young

The problem you described before with the missing symbols
can be resolved by linking against the mod_perl.lib built
when you build mod_perl.so. This can be done by adding in
a LIBS attribute to WriteMakefile() in Makefile.PL with a
value of ' -L/Path/to/mod_perl_lib -lmod_perl'.
ah, right.  thanks randy.

examples of this can be found in Apache::WinBitHack, for example, the format 
of which should probably go in Apache::Dispatch (as well as just about all 
Apache:: modules to make sure they are Win32 compliant :)

--Geoff



$| doesn't work after upgrade

2003-09-11 Thread Tommy Falgout
Hey everyone,

First off, thanks a lot for your help on this, and all of your work to the
open source community.  And thanks in advance for the help.

The problem I'm having is that I was on RH8 with a manually built Apache 1.3
and mod_perl.  I have upgraded to RH9 with Apache 2.0 and now $| no longer
seems to work properly.  It buffers up some; however, it only seems to spit
out information every 3-5 minutes instead.

And example program that is failing is:  (Both IE 5.50 and Mozilla 1.4 and
lynx will
act as if it's still waiting on the server until the program is complete
instead of displaying each line on time)

#!/usr/bin/perl
$|= 1;
use CGI qw(:standard);
print header,
  start_html;
foreach (0 .. 4) {
 print  The current time is ,scalar(localtime),BR\n;
 sleep 1;
}

Here's the logistical info:

perl -MCGI -e 'print $CGI::VERSION' -- 2.89
perl -v -- This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Web Server:
[EMAIL PROTECTED] bin]$ httpd -v
Server version: Apache/2.0.43
Server built: Oct 11 2002 14:13:44
OS: RH9 Linux tatu 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386
GNU/Linux
Brower: Tested with Mozilla 1.4  IE 5.50

Thanks!
Tommy.


Re: $| doesn't work after upgrade

2003-09-11 Thread Stas Bekman
Tommy Falgout wrote:
[...]
Here's the logistical info:

perl -MCGI -e 'print $CGI::VERSION' -- 2.89
perl -v -- This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Web Server:
[EMAIL PROTECTED] bin]$ httpd -v
Server version: Apache/2.0.43
Server built: Oct 11 2002 14:13:44
OS: RH9 Linux tatu 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386
GNU/Linux
Brower: Tested with Mozilla 1.4  IE 5.50
Please resubmit the bug report, following the bug reporting guidelines 
http://perl.apache.org/bugs/

and to save ping-pong cycles, first upgrade to the latest mod_perl:
http://perl.apache.org/download/index.html
and try again.
Thanks.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


new in Apache::Test: t/SMOKE -bug_mode

2003-09-11 Thread Stas Bekman
It all started when I have noticed a few core files after running t/SMOKE on 
modperl-2.0's top-level test suite. I couldn't figure out which test caused 
them. So I have decided to rewrite the smoker to provide me that information. 
In the future we might autoextract the backtrace as well.

While working on it, I said, we also have a problem of mapping error_log 
errors to the tests that caused them. So I've added logic to extract only the 
relevant (added since the last successful test) part of error_log and 
access_log and print it out, in addition to the output of the client.

This mode also turns the tracing level to -trace=debug, so if the test fails 
and there were any debug printings in the handlers they will be run as well.

This should make bug reports much more useful. However it comes at a price of 
running much slower than the normal 'make test' would do, until 
Test::Harness::Straps won't provide the callbacks to be run after each test, 
eventually we might fold it back to 'make test'. but for now if your 'make 
test' fails, run 't/SMOKE -bug_report'.

Of course the normal t/SMOKE run now reports core files as well, as soon as 
they happen.

You will need to update the current modperl-2.0 cvs to get this functionality. 
Please report any problems that you may have noticed.

So here is how the new log will look:

/home/stas/apache.org/portland3 t/SMOKE -bug_mode
running t/TEST in the bug report mode
apache/add_configok
apache/cgihandlerok
apache/conftree..ok
apache/constants.ok
apache/cookieFAILED

*** run log ***
*** setting ulimit to allow core files
ulimit -c unlimited; ./TEST -verbose -run 'apache/cookie.t'
apache/cookie1..2
# Running under perl version 5.008001 for linux
# Current time local: Thu Sep 11 18:45:28 2003
# Current time GMT:   Fri Sep 12 01:45:28 2003
# Using Test.pm version 1.24
request has failed (the response code was: 500)
see t/logs/error_log for more details
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-2
Failed 2/2 tests, 0.00% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
apache/cookie.t  255 65280 24 200.00%  1-2
!!! error running tests (please examine t/logs/error_log)
*** /home/stas/apache.org/portland3/t/logs/error_log ***
[Thu Sep 11 18:45:28 2003] [error] [client 127.0.0.1] I shouldn't get the 
cookie at /home/stas/apache.org/portland3/t/response/TestApache/cookie.pm line 16.

*** /home/stas/apache.org/portland3/t/logs/access_log ***
127.0.0.1 - - [11/Sep/2003:18:45:28 -0700] GET 
/TestApache__cookie?header HTTP/1.0 500 536


apache/cookie2...ok
apache/post..ok
apache/read..FAILED

*** run log ***
*** setting ulimit to allow core files
ulimit -c unlimited; ./TEST -verbose -run 'apache/read.t'
apache/readBareword asdfag not allowed while strict subs in use 
at apache/read.t line 18.
Execution of apache/read.t aborted due to compilation errors.
dubious
Test returned status 255 (wstat 65280, 0xff00)
!!! error running tests (please examine t/logs/error_log)


apache/scanhdrs..ok
apache/scanhdrs2.ok
apache/send_cgi_header...ok
apache/subprocessok
apache/write.FAILED

*** run log ***
*** setting ulimit to allow core files
ulimit -c unlimited; ./TEST -verbose -run 'apache/write.t'
apache/writerequest has failed (the response code was: 500)
see t/logs/error_log for more details
dubious
Test returned status 255 (wstat 65280, 0xff00)
!!! error running tests (please examine t/logs/error_log)
!!! oh nuts, server dumped core
!!! for stacktrace, run: gdb /home/stas/httpd/prefork/bin/httpd -core 
/home/stas/apache.org/portland3/t/core.7604

*** /home/stas/apache.org/portland3/t/logs/error_log ***
[Thu Sep 11 18:46:03 2003] [notice] child pid 7604 exit signal Aborted 
(6), possible coredump in /home/stas/apache.org/portland3/t


api/access...ok
api/aplogok
api/conn_rec.ok
api/lookup_uri...ok
api/lookup_uri2..ok
api/module...ok
api/r_subclass...ok
api/request_rec..ok
api/response.ok
api/rflush...ok

Re: Can't build Apache::Dispatch on Windows / Perl 5.8.0

2003-09-11 Thread Randy Kobes
On Thu, 11 Sep 2003, Geoffrey Young wrote:


  The problem you described before with the missing symbols
  can be resolved by linking against the mod_perl.lib built
  when you build mod_perl.so. This can be done by adding in
  a LIBS attribute to WriteMakefile() in Makefile.PL with a
  value of ' -L/Path/to/mod_perl_lib -lmod_perl'.
 

 ah, right.  thanks randy.

 examples of this can be found in Apache::WinBitHack, for
 example, the format of which should probably go in
 Apache::Dispatch (as well as just about all Apache::
 modules to make sure they are Win32 compliant :)

Here's a patch against the Apache-Dispatch Makefile.PL to
allow it to build on Win32 - I've also put up a ppm package
at http://theoryx5.uwinnipeg.ca/ppmpackages/ (for ActivePerl
6xx).
=
--- Makefile.PL.origWed Dec 27 09:01:04 2000
+++ Makefile.PL Thu Sep 11 22:16:00 2003
@@ -4,6 +4,9 @@
 use Apache::ExtUtils qw(command_table);
 use Apache::src ();
 use strict;
+use Config;
+
+my $is_win32 = ($^O =~ /Win32/i);

 require 5.005;

@@ -75,10 +78,26 @@

 command_table([EMAIL PROTECTED]);

+my %config;
+
+$config{INC} = Apache::src-new-inc;
+
+if ($is_win32) {
+  require Apache::MyConfig;
+
+  $config{DEFINE}  = ' -D_WINSOCK2API_ -D_MSWSOCK_ ';
+  $config{DEFINE} .= ' -D_INC_SIGNAL -D_INC_MALLOC '
+if $Config{usemultiplicity};
+
+  $config{LIBS} =
+qq{ -L$Apache::MyConfig::Setup{APACHE_LIB} -lApacheCore } .
+qq{ -L$Apache::MyConfig::Setup{MODPERL_LIB} -lmod_perl};
+}
+
 WriteMakefile(
   'NAME' = __PACKAGE__,
   'VERSION_FROM' = 'Dispatch.pm',
-  'INC'  = Apache::src-new-inc,
   'PREREQ_PM'= { mod_perl = 1.2401, },
   'clean'= { FILES = '*.xs*' },
+  %config,
 );

-- 
best regards,
randy