Re: mp2 runs scripts as root?

2003-03-01 Thread Stas Bekman
Mark James wrote:
Stas Bekman wrote:

Mark James wrote:

Some of my scripts break when running under mp2 (cvs) because the UID
is set as root rather than the Apache user (which for me is "web").
The problem manifests with RCS file locking. Is there some switch
to set so that I can run scripts as "web"?


Eh? Are you talking about 'make test' or installed mod_perl? If the 
former, use the latest cvs where this should work if the latter, 
modify httpd.conf.


The latter.  Turned out to be a caused by the perl ENV not being
propogated to forked programs:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code 
Well, actually this is not the case. It behaves exactly the same as in modperl 
1.0. You can use Env::C module (available from CPAN) to easily debug this:

The following snippet prints the same under mp1 and mp2 (assuming that they 
are started under the same username)
print map { "Perl: $ENV{$_} C: " . Env::C::getenv($_) . "\n"}  qw(USER);
print "$< ", scalar getpwuid($<), "\n";

Fixed by adding:

$ENV{'USER'} = 'web';
$ENV{'LOGNAME'} = 'web';
to the start-up script.
Indeed. The point is that ENV is not passed from shell, you have to explicitly 
do that and this is an Apache thing. So you can do:

SetEnv USER web

or as you did, in perl.

In any case you probably want to rely on getpwuid($<), rather than $ENV{USER} 
if applicable.

__
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: Help needed to set up Apache, PERL, PHP and MySQL

2003-03-01 Thread Stas Bekman
Mo Elwaisi wrote:
Hi

I have been tryin to set the following on a Linux machine for the last 
few months, but i have been having problem, especialy with PERL and 
Apache 2. I have been advised to use Apache 1.3.27!. i have formated the 
system and installed Red Hat 8 once again but this time i did not 
include any packages with the install except MySQL. Anyone could please 
spend a little bit of time with helping me in order for me to perform 
this right. as i am really becoming frustrusted with all the problems i 
have had!!!
If you were a bit more specific about your problems you could already be on 
the way to having them resolved.

The modperl list is not a help-desk service, but a volunteer effort. Therefore 
you don't ask someone first if they are willing to listen to your troubles, 
but you simply go ahead and tell what your troubles are and if someone has the 
right knowledge and time they will help you.

If you have more than one problem, please report them in separate bug reports. 
To report problems you have to follow these guidelines:
mod_perl 1.0:
http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems
mod_perl 2.0:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

Finally, this reply is not an invitation to email me privately. You must keep 
all the discussions on the list unless requested otherwise.

Oh, and if you are willing to pay, I'm sure that you will be able to find more 
than one person on that list, that will provide the help-desk-like service for 
you.

__
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: [mp2] what is and why is it my log?

2003-03-01 Thread Ask Bjoern Hansen
On Thu, 20 Feb 2003, Nick Tonkin wrote:

> > >>In my logs when dumping a warn() I see this occasionally:
> > >>
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28.
> > >>192.168.0.24 at /home/wm/perl/WM/Auth/Access.pm line 28,  line 245.

It's a perl feature.  On warn's it'll add the filehandle and the
line number when it's relevant.

5.6.1:

$ ~perl/bin/perl -e 'warn "foo"; open F, ".bashrc"; warn "Foo" while ' 2>&1 | head 
-5
foo at -e line 1.
Foo at -e line 1,  line 1.
Foo at -e line 1,  line 2.
Foo at -e line 1,  line 3.
Foo at -e line 1,  line 4.

If you set $/ so it's not reading normal lines it'll say chunk
instead of line:

$ ~perl/bin/perl -e 'warn "foo"; $/ = undef; open F, ".bashrc"; warn "Foo" while ' 
2>&1 | head -5
foo at -e line 1.
Foo at -e line 1,  chunk 1.


Older perl's always said "chunk".

perl 5.5.3:

$ perl -e 'warn "foo"; open F, ".bashrc"; warn "Foo" while ' 2>&1 | head -5
foo at -e line 1.
Foo at -e line 1,  chunk 1.
Foo at -e line 1,  chunk 2.
Foo at -e line 1,  chunk 3.
Foo at -e line 1,  chunk 4.

 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: Apache::TicketAccess

2003-03-01 Thread Ask Bjoern Hansen
On Thu, 20 Feb 2003, Nick Tonkin wrote:

> > Is it the cookie doesn't get sent back thru the reverse proxy?
>
> As Perrin said, you need to see what is actually happening. Dumping the
> headers is a great way to start. Right at the top of your handler do

Or you can use Apache::DumpHeaders.

http://search.cpan.org/dist/Apache-DumpHeaders/DumpHeaders.pm


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Help needed to set up Apache, PERL, PHP and MySQL

2003-03-01 Thread Mo Elwaisi
Hi

I have been tryin to set the following on a Linux machine for the last few 
months, but i have been having problem, especialy with PERL and Apache 2. I 
have been advised to use Apache 1.3.27!. i have formated the system and 
installed Red Hat 8 once again but this time i did not include any packages 
with the install except MySQL. Anyone could please spend a little bit of 
time with helping me in order for me to perform this right. as i am really 
becoming frustrusted with all the problems i have had!!!

Cheers

Mel

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://messenger.msn.co.uk



Fwd: Re: [MP2] Apache::Reload date bug

2003-03-01 Thread Ron Savage
--- Original Message ---
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: Ron Savage <[EMAIL PROTECTED]>
Cc:
Sent: Sat, 01 Mar 2003 12:47:39 +1100
Subject: Re: [MP2] Apache::Reload date bug

>Ron Savage wrote:
>>On Tue, 25 Feb 2003 09:40:05 +1100, Stas Bekman wrote:
>>
>>Hi Stas
>>
>>
Output when run as /perl/main.cgi. Only the first line is
expected
(by me.) Ie why does the text from OK down, appear? :
-><8-
This is a string
OK
The server encountered an internal error or misconfiguration and
was
unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and
inform
them of the time the error occurred, and anything you might have
done
that may have caused the error.

More information about this error may be available in the server
error log.
>>>
>>
>>Thanx. This particular problem has been fixed.
>
>cool. please followup on the list. So others know as well.

Oops.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 02/03/2003
http://savage.net.au/index.html




Re: Apache dies when configure mod_perl for use with Apache::DBI

2003-03-01 Thread Richard Clarke
> PerlModule Apache::DBI;<<-- trouble line

This line belongs in your httpd.conf file.
PerlModule is an apache configuration directive, not a perl 'command'.

http://perl.apache.org/docs/1.0/guide/config.html#PerlModule_and_PerlRequire
_Directives

Ric.



Apache dies when configure mod_perl for use with Apache::DBI

2003-03-01 Thread Feite Brekeveld
Hi,

I'm trying to configure mod_perl for use with persistent database 
connections with Apache::DBI

RedHat 7.3
Apache 1.3.23
mod_perl 1.26
I've configured the following 'startup.pl' file:

-
#!/usr/bin/perl
BEGIN {
 use Apache ();
 use lib '/etc/httpd/lib/perl';
}
use Apache::Registry ();
use Apache::Constants();
use CGI qw(-compile :all);
use CGI::Carp ();
#
PerlModule Apache::DBI;<<-- trouble line
#use LWP ();
#
1;
---

As soon as I activate the line identified as 'trouble line', my apache 
server dies.

Any suggestions ?

Thanks,

Feite Brekeveld






Re: Can't connect to ppm-ia.ActiveState.com:80

2003-03-01 Thread Randy Kobes
On Sat, 1 Mar 2003, Richard Heintze wrote:

> The mod_perl installation works fine on my home
> machine. (I' have not actually tried it yet, but I
> don't get errors about contacting
> http://theoryx5.uwinopeg
> 
> The office machine can browse the internet but still
> gives me errors when running "perl mpinstall". 
> 
> The office machine connects to the internet via a
> proxy server -- perhaps that is the problem. Is there
> a way for mpinstall to accommodate a proxy server?
> 
> How can I manually fetch the files that mpinstall is
> trying to get and install locally?
>Thanks,
>  Siegfried

The mpinstall script uses the getstore() routine of LWP::Simple,
so if you have to do something special to get getstore() to
work with your settings, you'd have to do the same thing for
the mpinstall script.

To install things manually,
- get mod_perl.ppd from http://theoryx5.uwinnipeg.ca/ppms/
- get mod_perl.tar.gz from http://theoryx5.uwinnipeg.ca/ppms/x86/
  and place it in the same directory as mod_perl.ppd
- get mod_perl.so from http://theoryx5.uwinnipeg.ca/ppms/scripts/
  and copy it to your Apache2 modules directory (eg, C:\Apache2\modules)
- edit the HREF attribute of the CODEBASE tag in mod_perl.ppd
  to just read HREF="mod_perl.tar.gz"
- run, from the directory where you saved mod_perl.ppd,
C:\> ppm install mod_perl.ppd

This is all for ActivePerl build 8xx and Apache 2 / mod_perl 2.

-- 
best regards,
randy



Re: Can't connect to ppm-ia.ActiveState.com:80

2003-03-01 Thread Richard Heintze
The mod_perl installation works fine on my home
machine. (I' have not actually tried it yet, but I
don't get errors about contacting
http://theoryx5.uwinopeg

The office machine can browse the internet but still
gives me errors when running "perl mpinstall". 

The office machine connects to the internet via a
proxy server -- perhaps that is the problem. Is there
a way for mpinstall to accommodate a proxy server?

How can I manually fetch the files that mpinstall is
trying to get and install locally?
   Thanks,
 Siegfried



--- Randy Kobes <[EMAIL PROTECTED]> wrote:
> On Fri, 28 Feb 2003, Richard Heintze wrote:
> 
> > I've searched the archives for "connect" and could
> > find no hints.
> > 
> > As per the mod_perl installation instructions, I
> type
> > the following command:
> > C:\Program Files\Apache
> > Group\APACHE2\mod_perl-1.99_08>ppm install
> >
>
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
> 
> You don't want to do that - rather, try
>  C:\> ppm install
> http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd
> The address
> 
>
http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer58
> is what you can set the repository to within the ppm
> shell.
>  
> > And I get these errors (see below). I have
> installed
> > Apache 2 and perl 5.8 and I'm trying to install
> > mod_perl2.
> > 
> > Error: No valid repositories: Error: 500 Can't
> connect to
> > ppm.ActiveState.com:80 (Bad hostname
> > 'ppm.ActiveState.com') at
> > D:/Perl/site/lib/PPM/Repository.pm line 84 Error:
> 500
> > Can't connect to
> > ppm-ia.ActiveState.com:80 (Bad hostname
> > 'ppm-ia.ActiveState.com') at
> > D:/Perl/site/lib/PPM/Repository.pm line 84
> 
> There was recent discussion on the perl-win32-users
> mailing list
> (archives at http://www.activestate.com/) about
> this. Part of the
> problem I think is that ppm-ia.ActiveState.com isn't
> running yet.
> One recommendation was to use ppm2 for now.
> 
> -- 
> best regards,
> randy kobes
> 


__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


Re: mp2 runs scripts as root?

2003-03-01 Thread Mark James
Stas Bekman wrote:
Mark James wrote:

Some of my scripts break when running under mp2 (cvs) because the UID
is set as root rather than the Apache user (which for me is "web").
The problem manifests with RCS file locking. Is there some switch
to set so that I can run scripts as "web"?
Eh? Are you talking about 'make test' or installed mod_perl? If the 
former, use the latest cvs where this should work if the latter, modify 
httpd.conf.
The latter.  Turned out to be a caused by the perl ENV not being
propogated to forked programs:
http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html#C_Libraries_Don_t_See_C__ENV__Entries_Set_by_Perl_Code
Fixed by adding:

$ENV{'USER'} = 'web';
$ENV{'LOGNAME'} = 'web';
to the start-up script.

Thanks for the reply -- Mark