Re: mp2: multiple include paths accross virtual servers?

2003-07-25 Thread Carl Brewer


Stas Bekman wrote:


You need to add:

  PerlOptions +Parent
PerlOption `Parent' requires an ithreads enabled Perl

*doh*

Carl






Re: reverse proxy in depth tutorial?

2003-07-25 Thread Igor Sysoev
On Thu, 24 Jul 2003, Garrett Goebel wrote:

 Most everything I'm stumbled upon has been short on detail and examples. For
 instance, I never found an example of how to just reverse proxy everything
 for a given backend server. All the examples I saw showed how to proxy
 something like http://foo/bar but not http://foo. Eventually I came up with
 the following:
 
 [Reverse Proxy]
 ...
 Listen 192.168.1.1:80
 RewriteEngine on
 RewriteRule   ^/?(.*) http://127.0.0.1:80/$1 [P]
 ProxyPassReverse / http://127.0.0.1:80/
 ...
 
 [Backend Server]
 ...
 Listen 127.0.0.1:80
 ...
 
 Is this kosher? 
 
 Is there a better way to do this? 
 
 A way to do it without mod_rewrite using only mod_proxy directives?

It can be done easy without mod_rewrite:

ProxyPass /  http://127.0.0.1:80/
ProxyPassReverse  /  http://127.0.0.1:80/

 Are there any strong arguments against using a mod_proxy/mod_rewrite httpd
 accelerator? Or preferred alternatives?

I can not say about Apache2's mod_proxy (I do not use Apache2) but
Apache 1.3's one has several drawbacks when it serves the big responses
for the slow clients. It reads the backend response and synchronously
sends it to client. The maximum size of the data that can be read
from backend without delay is ProxyIOBufferSize + frontend kernel TCP
send buffer + frontend kernel TCP recieve buffer + backend kernel TCP
send buffer. Kernel TCP buffers are usually 16K-64K but can be made bigger.

To eliminate many mod_proxy drawbacks I had written more than two years
ago mod_accel module to do the reverse-proxing. mod_accel allows to configure
read buffer in memory but if the response is bigger then it saves it to
the temporary file and frees the backend as soon as possible.
mod_accel has directives to configure the caching backend responses, to
limit the connections to some backend to avoid the starvation of other
hosts and many other features.

mod_accel is clean module and is used for two years on several
Russian loaded sites. One of them serves 100 requests per seconds
without any segfaults.

The main mod_accel drawback for non-Russian users is that there's
no complete English documentation. Here is very incomplete documentaion
http://dapi.chaz.ru/articles/plain/en/mod_accel.xml
Also there're some English links on http://sysoev.ru/en/

 Using the loopback for the backend has the security advantage of completely
 isolating the backend from any direct communication with external hosts. How
 do I keep the backend on 127.0.0.1 _and_ handle name based virtual hosts?

Using mod_proxy you can set up backend listening on several loopback
addresses: 127.0.0.1, 127.0.0.2, etc. Of course, you need to configure these
additional addresses in OS before the use.  Also backend can listen
on several ports and the single address: 127.0.0.1:8000, 127.0.0.1:8001, etc.

Here is example for two virtual hosts on several addresses, note that
1) the frontend servers are name based while the backend ones are IP based;
2) ServerName of the virtual server pairs are the same.

[Reverse Proxy]

NameVirtualHost frontend

VirtualHost frontend
ServerName   name1
ProxyPass  /   http://127.0.0.1:80/
ProxyPassReverse   /   http://127.0.0.1:80/
...
/VirtualHost

VirtualHost frontend
ServerName   name2
ProxyPass  /   http://127.0.0.2:80/
ProxyPassReverse   /   http://127.0.0.2:80/
...
/VirtualHost

[Backend Server]

UseCanonicalName  on

VirtualHost 127.0.0.1
ServerName   name1
...
/VirtualHost

VirtualHost 127.0.0.2
ServerName   name2
...
/VirtualHost

Using mod_accel you can use the same scheme and also there's another way:
[PH] flag of the AccelPass directive preserves Host header.

[Reverse Proxy]

AccelPass   /   http://127.0.0.1/   [PH]

[Backend Server]

UseCanonicalName  on
NameVirtualHost 127.0.0.1

VirtualHost 127.0.0.1
ServerName   name1
...
/VirtualHost

VirtualHost 127.0.0.1
ServerName   name2
...
/VirtualHost

 What are the issues with regard to virtual hosting and ssl?

All your SSL-enabled sites have to be IP-based.

 Any tips on keeping the config files maintainable?

 For instance if I'm doing a mason site with co-branding through multiple
 component roots... What would minimal configurations for proxy and backend
 servers look like in order to redirect an externally exposed ip address on
 the proxy to a backend on 127.0.0.1 and still preserve the name based
 virtual hosts? It that possible?

Yes it's possible, see previous examples.

 What are the variations, tradeoffs, and
 issues scaling it out to multiple physical servers? etc.

mod_accel supports the primitive load balancing and fault tolerance using DNS.

mod_proxy in Apache 1.3 also has code that allows to connect to the next
server returned by DNS but this code is broken - it uses the same socket to
connect to the next backend and this always fails.


Igor Sysoev
http://sysoev.ru/en/



Re: mp2: multiple include paths accross virtual servers?

2003-07-25 Thread Stas Bekman
Carl Brewer wrote:


Stas Bekman wrote:


You need to add:

  PerlOptions +Parent


PerlOption `Parent' requires an ithreads enabled Perl
That's correct. prefork mpm is the same as mod_perl 1.



__
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


problem with method auth_type

2003-07-25 Thread jehan procaccia
hello,
I followed the thread :
http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/mod_perl_2.0_question_about_$r-%3Econnection-%3Eauth_type_P51273/#51273
While using module AuthCookieLDAP based on AuthCookie I got exactly the 
same error:
   

Use of uninitialized value.
[Wed Jul 23 16:25:54 2003] [error] [client 127.0.0.1] Can't locate object
method auth_type via package Apache::Connection at
/usr/lib/perl5/site_perl/5.8.0/Apache/AuthCookie.pm line 182.!, referer:
http://localhost/ldap
I am trying to Authenticate HTTP connection to an openldap Server, using 
AuthCookie and AuthCookieLDAP, both written for apache 1.3.X and 
mod_perl 1.X. 
Here I use Apache 2.0.40 and mod_perl-1.99_07-5 (which is supposed to be 
mod_perl 2.0 I understood !?) on a RedHat 9 system.
Although I added PerlModule Apache::compat and PerlOptions 
+GlobalRequest in httpd.conf , I still get the above mentioned error :-(

Any help ?
Thanks.
PS: The author of AuthCookie is about to port its module to mod_perl 
2.0, maybe that would solve the problem, but when, and why doesn't it 
work now with Apache::compat ?



Re: Undocumented behaviour in Apache-print()?

2003-07-25 Thread Steve Hay
Steve Hay wrote:

Stas Bekman wrote:


 I have attempted to shoe-horn this into mod_perl's print() method (in
 src/modules/perl/Apache.xs).  Here's the diff against mod_perl 1.28:
 [Unfortunately, I've had to comment-out the first part of that if
 block, because I got an unresolved external symbol error relating 
to the
 PerlIO_isutf8() function otherwise (which may be because that function
 isn't documented in the perlapio manpage).]

mod_perl 1.x doesn't use perlio, hence you have this problem. adding:

#include perlio.h

should resolve it I think. 


No.  The error was unresolved external symbol, which means that the 
compiler is happy (it evidently has pulled in perlio.h, or something 
else that declares PerlIO_isutf8() as extern ...), but that the 
linker couldn't find the definition of that function.

(Check: If I change PerlIO_isutf8 to PerlIO_isutf (deliberate 
typo) then I get a different error - undefined; assuming extern 
returning int - because now no declaration has been supplied.)

Listing the symbols exported from perl58.lib shows that PerlIO_isutf8 
is *not* one of them.  So where's the definition supposed to come from?

I'll ask about this on the perlxs mailing list, I think. 
Having asked about this, it turns out that the problem was 
PerlIO_isutf8() not being exported from perl58.lib on Windows (and other 
platforms where the symbols to export have to be explicitly listed).

I sent a patch off to p5p which fixes this 
(http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-07/msg01096.html), 
and it has been integrated as #20203.

So presumably this will not be a problem in the upcoming perl-5.8.1, but 
how do we cope with the perl-5.8.0 case?

I've attached a new patch (against mod_perl-1.28) which (I believe) 
fixes the UTF-8 problem, but it won't build on Windows with perl-5.8.0 
without #20203.

Steve
--- Apache.xs.orig  2003-06-06 12:31:10.0 +0100
+++ Apache.xs   2003-07-18 08:47:59.0 +0100
@@ -1119,11 +1119,27 @@
SV *sv = sv_newmortal();
SV *rp = ST(0);
SV *sendh = perl_get_sv(Apache::__SendHeader, TRUE);
+#if PERL_VERSION = 8
+   PerlIO *fp = IoOFP(GvIOp(defoutgv));
+#endif
 
if(items  2)
do_join(sv, sv_no, MARK+1, SP); /* $sv = join '', @_[1..$#_] */
 else
sv_setsv(sv, ST(1));
+#if PERL_VERSION = 8
+   if (PerlIO_isutf8(fp)) {
+   if (!SvUTF8(sv))
+   sv_utf8_upgrade(sv = sv_mortalcopy(sv));
+   }
+   else if (DO_UTF8(sv)) {
+   if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE)
+ckWARN_d(WARN_UTF8))
+   {
+   Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print);
+   }
+   }
+#endif
 
PUSHMARK(sp);
XPUSHs(rp);
@@ -1176,6 +1192,20 @@
int sent = 0;
 SV *sv = SvROK(ST(i))  (SvTYPE(SvRV(ST(i))) == SVt_PV) ?
  (SV*)SvRV(ST(i)) : ST(i);
+#if PERL_VERSION = 8
+   PerlIO *fp = IoOFP(GvIOp(defoutgv));
+   if (PerlIO_isutf8(fp)) {
+   if (!SvUTF8(sv))
+   sv_utf8_upgrade(sv = sv_mortalcopy(sv));
+   }
+   else if (DO_UTF8(sv)) {
+   if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE)
+ckWARN_d(WARN_UTF8))
+   {
+   Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print);
+   }
+   }
+#endif
buffer = SvPV(sv, len);
 #ifdef APACHE_SSL
 while(len  0) {


Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?

2003-07-25 Thread Stas Bekman
Shannon Eric Peevey wrote:
[...]
*handler = MP2 ? \handler2 : \handler1;

I am leaving the MP2 code in both of the subroutines, as I don't know if 
there is a prettier way to do this...  (I will remove it, if there is not)

Although this hasn't been tested extensively, it should be working fine 
now.

thanks for the help!
speeves
cws
PS  It did complain about Prototype mismatch: sub 
Apache::AuthenNTLM::handler vs ($$) at 
/usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm until I added the code 
into both subroutines. 
I've added a new section to the porting tutorial that shows examples of how to 
handle this situation:
http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers

__
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


Re: [mp1] Safe segfaults with mp1

2003-07-25 Thread Stas Bekman
Stas Bekman wrote:
[...]
It's handy to have p5p people sitting next to you. Just asked this 
question Tim Bunce, and he replied:

  Safe is a failed experiment. It works only for several cases. 
TIEHANDLE is
  not one of them [print under mod_perl uses a tied STDOUT]. Do not use 
it if
  it doesn't work for you.

I'm supposed to ask Dan Sugalsky whether perl6 will have this 
functionality designed from the ground up.
I just did that and Dan has replied:

  Of course! It's working already!

So if anybody has a few minutes to port mod_perl to perl6

__
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


Re: problem with method auth_type

2003-07-25 Thread Stas Bekman
jehan procaccia wrote:
hello,
I followed the thread :
http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/mod_perl_2.0_question_about_$r-%3Econnection-%3Eauth_type_P51273/#51273 

While using module AuthCookieLDAP based on AuthCookie I got exactly the 
same error:
   

Use of uninitialized value.
[Wed Jul 23 16:25:54 2003] [error] [client 127.0.0.1] Can't locate object
method auth_type via package Apache::Connection at
/usr/lib/perl5/site_perl/5.8.0/Apache/AuthCookie.pm line 182.!, referer:
http://localhost/ldap
I am trying to Authenticate HTTP connection to an openldap Server, using 
AuthCookie and AuthCookieLDAP, both written for apache 1.3.X and 
mod_perl 1.X. Here I use Apache 2.0.40 and mod_perl-1.99_07-5 (which is 
supposed to be mod_perl 2.0 I understood !?) on a RedHat 9 system.
Although I added PerlModule Apache::compat and PerlOptions 
+GlobalRequest in httpd.conf , I still get the above mentioned error :-(

Any help ?
Thanks.
PS: The author of AuthCookie is about to port its module to mod_perl 
2.0, maybe that would solve the problem, but when, and why doesn't it 
work now with Apache::compat ?
http://perl.apache.org/docs/2.0/user/porting/compat.html#C__connection_E_gt_auth_type_

Have you tried the latest cvs of mod_perl2? Apache::compat provides the 
necessary code there:

package Apache::Connection;

# auth_type and user records don't exist in 2.0 conn_rec struct
# 'PerlOptions +GlobalRequest' is required
sub auth_type { shift; Apache-request-ap_auth_type(@_) }
sub user  { shift; Apache-request-user(@_)  }
For more info see:
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution


__
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


compile latest CVS

2003-07-25 Thread jehan procaccia
hello

I just donwloaded latest cvs as stated in :
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
Now I don't really understand what directory is supposed to contain the 
MP_AP_PREFIX variable ?
Nothing is not a solution:
[EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
$ perl Makefile.PL
!!! Unable to determine server version, aborting.
!!! Please specify MP_APXS or MP_AP_PREFIX.

When I point it to apache 2.0.47 sources in configure ok apparently:
[EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
$ perl Makefile.PL MP_AP_PREFIX=/usr/src/redhat/BUILD/httpd-2.0.47/
Reading Makefile.PL args from @ARGV
  MP_AP_PREFIX = /usr/src/redhat/BUILD/httpd-2.0.47/
Configuring Apache/2.0.47 mod_perl/1.99_10-dev Perl/v5.8.0
   generating script t/TEST
...
But after while compiling :

[EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
$ make
cd src/modules/perl  make -f Makefile.modperl
make[1]: Entering directory 
`/usr/local/src/Mod_perl/modperl-2.0/src/modules/perl'

I get hundreds of error about ap* header files apparently;

In file included from /usr/src/redhat/BUILD/httpd-2.0.47/include/httpd.h:72,
from modperl_apache_includes.h:11,
from mod_perl.h:4,
from mod_perl.c:1:
/usr/src/redhat/BUILD/httpd-2.0.47/include/ap_config.h:58:17: apr.h: No 
such file or directory
In file included from 
/usr/src/redhat/BUILD/httpd-2.0.47/include/ap_config.h:59, 
from /usr/src/redhat/BUILD/httpd-2.0.47/include/httpd.h:72,
from modperl_apache_includes.h:11,
from mod_perl.h:4,
from mod_perl.c:1:
/usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr-util/include/apr_hooks.h:58:17: 
apu.h: No such file or directory

However, apr.h for example is here:

$ locate apr.h
/usr/include/httpd/apr.h
/usr/include/apr-0/apr.h
/usr/src/redhat/BUILD/apr-0.9.3/include/apr.h.in
/usr/src/redhat/BUILD/apr-0.9.3/include/apr.hnw
/usr/src/redhat/BUILD/apr-0.9.3/include/apr.hw
/usr/src/redhat/BUILD/apr-0.9.3/include/apr.h
/usr/src/redhat/BUILD/apr-0.9.3/test/test_apr.h
/usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr/test/test_apr.h
/usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr/include/apr.h.in
/usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr/include/apr.hw
/usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr/include/apr.hnw
/usr/src/redhat/BUILD/httpd-2.0.45/srclib/apr/include/apr.h.in
/usr/src/redhat/BUILD/httpd-2.0.45/srclib/apr/include/apr.hnw
/usr/src/redhat/BUILD/httpd-2.0.45/srclib/apr/include/apr.hw
/usr/src/redhat/BUILD/httpd-2.0.45/srclib/apr/test/test_apr.h
How can I compile mod_perl 2.0 ? mybe I should use MP_APXS instead, but 
again what directory should I point it to ?

thanks .




Re: compile latest CVS

2003-07-25 Thread Stas Bekman
jehan procaccia wrote:
hello

I just donwloaded latest cvs as stated in :
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution 

Now I don't really understand what directory is supposed to contain the 
MP_AP_PREFIX variable ?
It's the path where Apache was installed to. I'm not on RH so I'm not sure 
where it installs it to. But from looking at the RH rpms, it spreads things 
across different dirs.

There is a RH rpm package which includes the build instructions specific to 
RH, just grab the src.rpm from here:
http://fr.rpmfind.net/linux/rpm2html/search.php?query=mod_perlsubmit=Search+...

next look at the spec file, it says:

# Compile the module.
%{__perl} Makefile.PL /dev/null \
PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor \
MP_APXS=%{_sbindir}/apxs MP_APR_CONFIG=%{_bindir}/apr-config \
CCFLAGS=$RPM_OPT_FLAGS -fPIC
make
So I suppose that if you have installed the Apache rpm from RH you should say 
at least:

perl Makefile.PL MP_APXS=/usr/sbin/apxs MP_APR_CONFIG=/usr/bin/apr-config

adjust the paths to these scripts if my guess was wrong. You can use locate(1) 
to find them.

You can also try to use the latest src.rpm from rawhide, I'm not sure how 
recent it is 
http://fr.rpmfind.net//linux/RPM/rawhide/1.0/i386/RedHat/RPMS/mod_perl-1.99_09-6.i386.html
says Jul 16, which is very recent.

__
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


Re: compile latest CVS

2003-07-25 Thread Jrme Aug
On Fri, Jul 25, 2003 at 02:47:36PM +0200, jehan procaccia wrote:
 
 I just donwloaded latest cvs as stated in :
 http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
 Now I don't really understand what directory is supposed to contain the 
 MP_AP_PREFIX variable ?
 Nothing is not a solution:
 [EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
 $ perl Makefile.PL
 !!! Unable to determine server version, aborting.
 !!! Please specify MP_APXS or MP_AP_PREFIX.
 
 When I point it to apache 2.0.47 sources in configure ok apparently:
 [EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
 $ perl Makefile.PL MP_AP_PREFIX=/usr/src/redhat/BUILD/httpd-2.0.47/
 Reading Makefile.PL args from @ARGV
   MP_AP_PREFIX = /usr/src/redhat/BUILD/httpd-2.0.47/
 Configuring Apache/2.0.47 mod_perl/1.99_10-dev Perl/v5.8.0
generating script t/TEST
 ...
 
 But after while compiling :
 
 [EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
 $ make
 cd src/modules/perl  make -f Makefile.modperl
 make[1]: Entering directory 
 `/usr/local/src/Mod_perl/modperl-2.0/src/modules/perl'
 
 I get hundreds of error about ap* header files apparently;
 
 In file included from /usr/src/redhat/BUILD/httpd-2.0.47/include/httpd.h:72,
 from modperl_apache_includes.h:11,
 from mod_perl.h:4,
 from mod_perl.c:1:
 /usr/src/redhat/BUILD/httpd-2.0.47/include/ap_config.h:58:17: apr.h: No 
 such file or directory
 In file included from 
 /usr/src/redhat/BUILD/httpd-2.0.47/include/ap_config.h:59, 
 from /usr/src/redhat/BUILD/httpd-2.0.47/include/httpd.h:72,
 from modperl_apache_includes.h:11,
 from mod_perl.h:4,
 from mod_perl.c:1:
 /usr/src/redhat/BUILD/httpd-2.0.47/srclib/apr-util/include/apr_hooks.h:58:17: 
 apu.h: No such file or directory
 
 How can I compile mod_perl 2.0 ? mybe I should use MP_APXS instead, but 
 again what directory should I point it to ?
 

You don't need the full Apache sources, on redhat you just need the
'httpd' and 'httpd-devel' package, then MP_APXS should point to your
apxs, on redhat 8 it is:

  $ perl Makefile.PL MP_APXS=/usr/sbin/apxs

Regards,
Jérôme

--



Re: compile latest CVS

2003-07-25 Thread jehan procaccia
You guessed very well !
now it compiles with no problem, so on a redhat system use:
[EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
$ perl Makefile.PL MP_APXS=/usr/sbin/apxs MP_APR_CONFIG=/usr/bin/apr-config
I'll continue with my AuthCookie now ... good weekend !

Stas Bekman wrote:

jehan procaccia wrote:

hello

I just donwloaded latest cvs as stated in :
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution 

Now I don't really understand what directory is supposed to contain 
the MP_AP_PREFIX variable ?


It's the path where Apache was installed to. I'm not on RH so I'm not 
sure where it installs it to. But from looking at the RH rpms, it 
spreads things across different dirs.

There is a RH rpm package which includes the build instructions 
specific to RH, just grab the src.rpm from here:
http://fr.rpmfind.net/linux/rpm2html/search.php?query=mod_perlsubmit=Search+... 

next look at the spec file, it says:

# Compile the module.
%{__perl} Makefile.PL /dev/null \
PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor \
MP_APXS=%{_sbindir}/apxs MP_APR_CONFIG=%{_bindir}/apr-config \
CCFLAGS=$RPM_OPT_FLAGS -fPIC
make
So I suppose that if you have installed the Apache rpm from RH you 
should say at least:

perl Makefile.PL MP_APXS=/usr/sbin/apxs MP_APR_CONFIG=/usr/bin/apr-config

adjust the paths to these scripts if my guess was wrong. You can use 
locate(1) to find them.

You can also try to use the latest src.rpm from rawhide, I'm not sure 
how recent it is 
http://fr.rpmfind.net//linux/RPM/rawhide/1.0/i386/RedHat/RPMS/mod_perl-1.99_09-6.i386.html 

says Jul 16, which is very recent.

__
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




Re: compile latest CVS

2003-07-25 Thread jehan procaccia
Jérôme Augé wrote:

You don't need the full Apache sources, on redhat you just need the
'httpd' and 'httpd-devel' package, then MP_APXS should point to your
apxs, on redhat 8 it is:
 $ perl Makefile.PL MP_APXS=/usr/sbin/apxs

Regards,
Jérôme
 

Indeed, it works fine now with:

[EMAIL PROTECTED] /usr/local/src/Mod_perl/modperl-2.0]
$ perl Makefile.PL MP_APXS=/usr/sbin/apxs MP_APR_CONFIG=/usr/bin/apr-config
thanks .

--

 





RE: no_cache(1) and still cached?

2003-07-25 Thread Perrin Harkins
On Fri, 2003-07-25 at 04:32, Frank Maas wrote:
 But the idea of setting the Expiry header back in time is appealing...

Come to think of it, I have never had problems with mod_proxy caching
thing I didn't want cached.  Quite the opposite -- I had to be very
careful with Expires headers to get anything cached at all.

I think you might be mis-diagnosing the problem here.  Maybe it's an
issue on the backend instead.

- Perrin


Re: Advice sought for learning mod_perl (2 or 1)

2003-07-25 Thread Robert Lee
Ged Haywood wrote:

 Q1: Is there a similar module to Apache::Request?


Depends what you want to do, but not really.  Care to try porting it?
No no. Apache::Request 2 port is in works and it'll be available RSN thanks 
to Joe Schaefer and Randy Kobes who do an extraordinary job. Though it'll 
be released sooner if more people help with testing and polishing it. For 
more information see:
http://httpd.apache.org/apreq/
Thanks for the responses; they were very helpful.

BTW: No, there are no commercial pressures involved in this project, but 
just doing a possible/likely career transition from the embedded-telecom 
implosion to something more of the future. However, time (as always) is 
always of the essence, and I'll need to balance my choices available.

It's funny. I thought that Java would be a predominant player in the web 
world, but it looks like perl et al are the predominant players. That's ok 
as I'm was never a huge fan of Java anyhow ;p.

Enough of my rant. Thanks again.

Stas, if you have the email of Joe and Randy, please email me; I'll see if I 
am of any use to them.

Robert

_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



Database Connections Global Variables

2003-07-25 Thread Levon Barker
Hello,

I have a question. 

If I have a $dbh global variable in a particular module that I 'use'. I know
that Apache::DBI will give a cached connection to the module to use.

But what if I do something like $dbh-commit();

Is it possible that I am committing data for another session by accident?

Any thoughts on this are appreciated. (Including RTFM (but tell me where in
the FMTR))

Cheers,
Levon Barker
attachment: winmail.dat

Re: Database Connections Global Variables

2003-07-25 Thread Perrin Harkins
On Fri, 2003-07-25 at 14:55, Levon Barker wrote:
 If I have a $dbh global variable in a particular module that I 'use'. I know
 that Apache::DBI will give a cached connection to the module to use.

There is no need to use a global.  Apache::DBI caches it for you.  If
you put it in a global, then Apache::DBI doesn't get to do its ping.

 But what if I do something like $dbh-commit();
 
 Is it possible that I am committing data for another session by accident?

At the end of each request, Apache::DBI issues a rollback for any
uncommitted transactions.  That means that the only things that could be
committed are things that you did earlier in the current request.  And
remember, these are not shared between processes, so there's no need to
be worried about interference from other requests.

- Perrin


Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?

2003-07-25 Thread Shannon Eric Peevey
Stas Bekman wrote:

Shannon Eric Peevey wrote:
[...]
*handler = MP2 ? \handler2 : \handler1;

I am leaving the MP2 code in both of the subroutines, as I don't know 
if there is a prettier way to do this...  (I will remove it, if there 
is not)

Although this hasn't been tested extensively, it should be working 
fine now.

thanks for the help!
speeves
cws
PS  It did complain about Prototype mismatch: sub 
Apache::AuthenNTLM::handler vs ($$) at 
/usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm until I added the 
code into both subroutines. 


I've added a new section to the porting tutorial that shows examples 
of how to handle this situation:
http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers

I changed the code for Apache-AuthenNTLM-2.04 to reflect your example, 
and it works great! 
Thanks for the pointer :)

speeves
cws




re: AuthenNTLM - help

2003-07-25 Thread Shannon Eric Peevey
Shannon,
i put it working on Solaris, mod_perl, NTLM and mod_jk2 (to comunicate 
with Tomcat), but unfortunatily, it just works when i access from 
windows 9x and Linux. When i access by NT/2000/XP, it just doesn't work 
at all (no validation). So, i decide, for a while, make it work on 
Linux! I am using Conectiva 8, and it is working fine.
Thanks.

Shannon Eric Peevey escreveu:

Francisco de Assis Tristão wrote:

Shannon,
i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g 
mod_perl/1.25, all by hand,
but it only works fine when i use just http - when i access the pages 
with https, apache doesn't ask for the user...
Have you any idea about what is wrong?
The version of apache with mod_ssl i took from sunfreeware, mod_perl 
and ApacheAuthenNTLM i compiled by myself.


Sorry, I don't know why this might be happening...  Are you running 
through a proxy server?  I have seen a lot of problems when ntlm 
authentication through a proxy server...

speeves
cws
I am forwarding this to the modperl list...  Please include the list in 
your replies.

thanks,
speeves
cws


DProf on Mac OS X

2003-07-25 Thread John Siracusa
Has anyone gotten this to work on OS X?

From http://perl.apache.org/docs/1.0/guide/performance.html

  % setenv PERL5OPT -d:DProf
  % httpd -X -d `pwd` 
  ... make some requests to the server here ...
  % kill `cat logs/httpd.pid`
  % unsetenv PERL5OPT
  % dprofpp
I've used this profiling technique on other Unix-like OSes, so I think 
I'm doing it right.  But on OS X, I get a tiny tmon.out file that never 
grows after the initial server startup.  I don't see any error messages 
or log lines.

When I try to use Apache::DProf, I get a bus error on any request:

[Fri Jul 25 18:52:48 2003] [notice] child pid 3840 exit signal Bus 
error (10)

My setup:

apache 1.3.27, mod_perl 1.27

% uname -a
Darwin derkins 6.6 Darwin Kernel Version 6.6: Thu May  1 21:48:54 PDT 
2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC  Power Macintosh powerpc

% perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
osname=darwin, osvers=6.0, archname=darwin
uname='darwin derkins 6.0 darwin kernel version 6.0: sat jul 27 
13:18:52 pdt 2002; root:xnuxnu-344.obj~1release_ppc power macintosh 
powerpc '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef 
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-pipe -fno-common -no-cpp-precomp 
-fno-strict-aliasing',
optimize='-O3',
cppflags='-no-cpp-precomp -pipe -fno-common -no-cpp-precomp 
-fno-strict-aliasing'
ccversion='', gccversion='3.1 20020420 (prerelease)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
alignbytes=8, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -flat_namespace -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-lgdbm -ldbm -lm -lc
perllibs=-lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, 
libperl=libperl.dylib
gnulibc_version=''
  Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -flat_namespace -bundle -undefined 
suppress -L/usr/local/lib'

Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under darwin
  Compiled at Aug 24 2002 14:44:56
  %ENV:
PERL5DB=use Devel::DProf
PERL5OPT=-d:DProf
PERL_READLINE_NOWARN=
  @INC:
/Library/Perl/darwin
/Library/Perl
/Library/Perl/darwin
/Library/Perl
/Library/Perl