HTML::Mason + Apache::Session problem

2002-09-11 Thread Ufuk Yuzereroglu

Hi

I am running a RedHat 7.3 server with kernel 2.4.18, Apache 1.3.26, 
mod_perl 1.26-5 and Apache::Session and HTML:Mason-1.05 modules. When I 
try to start apache i get the error message

Starting httpd: Subroutine status_mason redefined 
at /usr/lib/perl5/vendor_perl/5.6.1/i386-linux/Apache/Status.pm line 50.

But the server starts and operates. This bug is said to be fixed in 
Mason-0.85 but as you can see I still get it. I have the same 
components and code piece running on RedHat 7.0.

The other problem is, on the same system I have an 
authentication/session information structure on my website built using 
Apache::Session. I manage to log on with the right username and 
password and the Apache-Session file is created under /tmp with owner 
as apache:apache and file rights as 644. When I try to access the 
submenus after the initial login process, the server acts as if it 
cannot read the session files and does not grant me access. Well the 
the strangest thing is I can access the submenus after clicking on the 
link for 2-3 times. The first 1 or 2 does not grant access, but the 
last one always seems to work. This seems to me that apache cannot or 
does not read from the same Session file each time.

Can anyone please help? Thanks.



Mason 1.05 + Apache::Session problem!

2002-09-09 Thread Ufuk Yuzereroglu



HiI am running a RedHat 7.3 server with kernel 2.4.18, Apache 
1.3-26,  mod_perl 1.26-5 and Apache::Session 1.53 and HTML::Mason-1.05 
modules. When I try to start apache i get the error message:Starting 
httpd: Subroutine status_mason redefined at 
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux/Apache/Status.pm line 50.But 
the server starts and operates. This bug is said to be fixed 
in HTML::Mason-0.85 but as you can see I still get it. BTW I have the same 
components and code piece running on RedHat 7.0, apache 1.3-2x, mod_perl and 
Apache::Session 1.53 an HTML::Mason-1.05 modules.The other problem (and 
the main) is, on the same system I have an authentication/session information 
structure on my website built using Apache::Session. I manage to log on with the 
right username and password. Apache-Session file for the session is created 
under /tmp with owner as apache:apache and file rights as 644. But when I try to 
access the submenus from the main one, after the initial login process, the 
server acts as if it cannot read the session files and does not grant me access. 
The strangest thing is that I can access the submenus after clicking on the 
link for 2-3 times. The first 1 or 2 does not grant access, but the last one 
always seems to work. This seems to me that apache cannot or does not read from 
the same Session file each time.Can anyone please help? 
Thanks.UY


Re: Apache::Session problem with DBD::Oracle

2002-03-11 Thread Brian Lavender

The tests were writing to an NFS mounted directory, and I think
NFS was creating some lock files which prevented the directory
from being written to. I moved the install to a non NFS mounted
area, and it all worked.

brian

On Mon, Mar 11, 2002 at 12:00:47PM -0800, Brian Lavender wrote:
> Yup, that fixed it. 
> 
> I have another problem with the File portion. Seems that the test
> giving the following fail statements. I checked /tmp and there is a
> lock file. I am not sure about how File::Store all works, and I couldn't
> quite understand the test file either. Should I just
> 
> $ make install 
> 
> anyway?
> 
> t/99dbfile..File exists at t/99dbfile.t line 77.
> t/99dbfile..dubious  
> Test returned status 17 (wstat 4352, 0x1100)
> after all the subtests completed successfully
> t/99dbfilestore.File exists at t/99dbfilestore.t line 73.
> t/99dbfilestore.dubious  
> Test returned status 17 (wstat 4352, 0x1100)
> after all the subtests completed successfully
> 
> 
> On Mon, Mar 11, 2002 at 02:33:17PM -0500, Geoffrey Young wrote:
> > Brian Lavender wrote:
> > > 
> > > I am trying to install Apache::Session and it is failing on
> > > the DBD::Oracle tests. It is asking for a default user. Do
> > > I need to configure Oracle for a default user? Or do I need
> > > to set some environment variable with a user id and password?
> > 
> > well, looking at t/99oracle.t (line 45) it looks like you need to
> > define the following environment variables:
> > 
> > ORACLE_HOME (of course) 
> > AS_ORACLE_USER
> > AS_ORACLE_PASS
> > 
> > HTH
> > 
> > --Geoff
> 
> -- 
> Brian Lavender
> http://www.brie.com/brian/

-- 
Brian Lavender
http://www.brie.com/brian/



Re: Apache::Session problem with DBD::Oracle

2002-03-11 Thread Brian Lavender

Yup, that fixed it. 

I have another problem with the File portion. Seems that the test
giving the following fail statements. I checked /tmp and there is a
lock file. I am not sure about how File::Store all works, and I couldn't
quite understand the test file either. Should I just

$ make install 

anyway?

t/99dbfile..File exists at t/99dbfile.t line 77.
t/99dbfile..dubious  
Test returned status 17 (wstat 4352, 0x1100)
after all the subtests completed successfully
t/99dbfilestore.File exists at t/99dbfilestore.t line 73.
t/99dbfilestore.dubious  
Test returned status 17 (wstat 4352, 0x1100)
after all the subtests completed successfully


On Mon, Mar 11, 2002 at 02:33:17PM -0500, Geoffrey Young wrote:
> Brian Lavender wrote:
> > 
> > I am trying to install Apache::Session and it is failing on
> > the DBD::Oracle tests. It is asking for a default user. Do
> > I need to configure Oracle for a default user? Or do I need
> > to set some environment variable with a user id and password?
> 
> well, looking at t/99oracle.t (line 45) it looks like you need to
> define the following environment variables:
> 
> ORACLE_HOME (of course) 
> AS_ORACLE_USER
> AS_ORACLE_PASS
> 
> HTH
> 
> --Geoff

-- 
Brian Lavender
http://www.brie.com/brian/



Re: Apache::Session problem with DBD::Oracle

2002-03-11 Thread Ken Y. Clark

On Mon, 11 Mar 2002, Brian Lavender wrote:

> Date: Mon, 11 Mar 2002 11:24:35 -0800
> From: Brian Lavender <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Apache::Session problem with DBD::Oracle
>
> I am trying to install Apache::Session and it is failing on
> the DBD::Oracle tests. It is asking for a default user. Do
> I need to configure Oracle for a default user? Or do I need
> to set some environment variable with a user id and password?
>
> brian
>
> Here are the errors I am getting:
>
> t/99oracle..DBI->connect(sgum) failed: ORA-01004: default username feature 
>not supported; logon denied (DBD ERROR: OCISessionBegin) at 
>blib/lib/Apache/Session/Store/Oracle.pm line 45
> (in cleanup) DBI->connect(sgum) failed: ORA-01004: default username feature 
>not supported; logon denied (DBD ERROR: OCISessionBegin) at 
>blib/lib/Apache/Session/Store/Oracle.pm line 45
> t/99oracle..dubious
> Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-10
> Failed 10/10 tests, 0.00% okay
>

Oracle is fairly picky about the connection info.  Here's an example
of one I use:

use constant FooDataSource => 'dbi:Oracle:';
use constant FooDBUser => 
q{user/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521))(CONNECT_DATA=(SID=sid)))};
use constant FooDBPassword => '';
use constant FooDBOptions  => {
RaiseError   => 1,
FetchHashKeyName => 'NAME_lc',
LongReadLen  => 3000,
LongTruncOk  => 1,
};

my $db = DBI->connect(FooDataSource, FooDBUser, FooDBPassword, FooDBOptions);

I'm also fairly sure that some environment variables should be set.
If I grep my env for "ORA," I see:

ORACLE_SID=
ORACLE_BASE=/oracle1/app/oracle
ORACLE_HOME=/oracle1/app/oracle/product/8.0.5
ORACLE_TERM=xsun5

Obviously, the $ENV{'ORACLE_SID'} matches the "SID" in the "FooDBUser"
string.  The above string is used from a host other than the machine
that houses Oracle, so it may have more in it than you need if you're
on the same machine.

HTH,

ky




Re: Apache::Session problem with DBD::Oracle

2002-03-11 Thread Geoffrey Young

Brian Lavender wrote:
> 
> I am trying to install Apache::Session and it is failing on
> the DBD::Oracle tests. It is asking for a default user. Do
> I need to configure Oracle for a default user? Or do I need
> to set some environment variable with a user id and password?

well, looking at t/99oracle.t (line 45) it looks like you need to
define the following environment variables:

ORACLE_HOME (of course) 
AS_ORACLE_USER
AS_ORACLE_PASS

HTH

--Geoff



Apache::Session problem with DBD::Oracle

2002-03-11 Thread Brian Lavender

I am trying to install Apache::Session and it is failing on
the DBD::Oracle tests. It is asking for a default user. Do
I need to configure Oracle for a default user? Or do I need
to set some environment variable with a user id and password?

brian

Here are the errors I am getting:

t/99oracle..DBI->connect(sgum) failed: ORA-01004: default username feature not 
supported; logon denied (DBD ERROR: OCISessionBegin) at 
blib/lib/Apache/Session/Store/Oracle.pm line 45
(in cleanup) DBI->connect(sgum) failed: ORA-01004: default username feature 
not supported; logon denied (DBD ERROR: OCISessionBegin) at 
blib/lib/Apache/Session/Store/Oracle.pm line 45
t/99oracle..dubious  
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-10
Failed 10/10 tests, 0.00% okay
-- 
Brian Lavender
http://www.brie.com/brian/



RE: Apache::Session Problem -- Addendum

2001-11-28 Thread Perrin Harkins

On Thu, 22 Nov 2001, Jonathan M. Hollin wrote:
> My code now includes:
> 
> 35:  # Session handler...
> 36:  my %session; undef my $session_id;
> 37:  use Apache::Session::MySQL;
> 38:  tie %session, 'Apache::Session::MySQL', $session_id,
> 39:  { DataSource => 'dbi:mysql:sessions', UserName   => 'db_user', Password
> => 'secret' };
> 40:  $session_id = "session_id=$session{_session_id};";
> 
> I am using Apache-Session v1.54.
> 
> The above code generates the following error:
> 
> [Thu Nov 22 10:31:38 2001] [error] PerlRun: `Can't connect(
> HASH(0xbdcf54)), no database driver specified and DBI_DSN env var not set at
> E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36 (in cleanup)
> Can't connect(   HASH(0x47e2f14)), no database driver specified and DBI_DSN
> env var not set at E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36'

You aren't following the documentation.  perldoc Apache::Session::MySQL.  
It says to pass in connection info for a lock connection.
- Perrin




RE: Apache::Session Problem -- Addendum

2001-11-22 Thread Paul DuBois

At 10:43 AM + 11/22/01, Jonathan M. Hollin wrote:
>Thank you everyone for the quality of help I've so far received and your
>rapid responses.  However...  :-(

At the rist of making a shameless plug, you can visit
http://www.kitebird.com/mysql-perl/ and grab the webdb
source distribution there.  This accompanies the book
for which the aforementioned URL is the home site.  Said
book has a chapter on sessions focusing on Apache::Session,
so you may find the example scripts useful for helping
you solve your problem.

>
>My code now includes:
>
>35:  # Session handler...
>36:  my %session; undef my $session_id;
>37:  use Apache::Session::MySQL;
>38:  tie %session, 'Apache::Session::MySQL', $session_id,
>39:  { DataSource => 'dbi:mysql:sessions', UserName   => 'db_user', Password
>=> 'secret' };
>40:  $session_id = "session_id=$session{_session_id};";
>
>I am using Apache-Session v1.54.
>
>The above code generates the following error:
>
>[Thu Nov 22 10:31:38 2001] [error] PerlRun: `Can't connect(
>HASH(0xbdcf54)), no database driver specified and DBI_DSN env var not set at
>E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36 (in cleanup)
>Can't connect(   HASH(0x47e2f14)), no database driver specified and DBI_DSN
>env var not set at E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36'
>
>So, as you can see, I've moved on a little - but still don't have a working
>session handler.  Any offers?
>
>Note:  I know how boring it is to keep reading the same thread - I'll drop
>it if I don't solve this today.
>
>Kindest regards,
>
>Jonathan M. Hollin - WYPUG Co-ordinator
>West Yorkshire Perl User Group
>http://wypug.pm.org/
>
>:: -Original Message-
>:: From: Tatsuhiko Miyagawa [mailto:[EMAIL PROTECTED]]
>:: Sent: 22 November 2001 04:34
>:: To: [EMAIL PROTECTED]
>:: Cc: mod_perl Mailing List
>:: Subject: Re: Apache::Session Problem -- Addendum
>::
>::
>:: On Wed, 21 Nov 2001 23:23:33 -
>:: "Jonathan M. Hollin" <[EMAIL PROTECTED]> wrote:
>::
>:: > 42: tie %session, 'Apache::Session::DBI',
>:: > 43: {DataSource => "dbi:$db_driver:sessions:$db_address"};
>::
>:: put $sid (session id: undef for fresh) after 'Apache::Session::MySQL'.
>::
>:: --
>:: Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
>::




RE: Apache::Session Problem -- Addendum

2001-11-22 Thread Jonathan M. Hollin

Thank you everyone for the quality of help I've so far received and your
rapid responses.  However...  :-(

My code now includes:

35:  # Session handler...
36:  my %session; undef my $session_id;
37:  use Apache::Session::MySQL;
38:  tie %session, 'Apache::Session::MySQL', $session_id,
39:  { DataSource => 'dbi:mysql:sessions', UserName   => 'db_user', Password
=> 'secret' };
40:  $session_id = "session_id=$session{_session_id};";

I am using Apache-Session v1.54.

The above code generates the following error:

[Thu Nov 22 10:31:38 2001] [error] PerlRun: `Can't connect(
HASH(0xbdcf54)), no database driver specified and DBI_DSN env var not set at
E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36 (in cleanup)
Can't connect(   HASH(0x47e2f14)), no database driver specified and DBI_DSN
env var not set at E:/Apache/site/lib/Apache/Session/Lock/MySQL.pm line 36'

So, as you can see, I've moved on a little - but still don't have a working
session handler.  Any offers?

Note:  I know how boring it is to keep reading the same thread - I'll drop
it if I don't solve this today.

Kindest regards,

Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/

:: -Original Message-
:: From: Tatsuhiko Miyagawa [mailto:[EMAIL PROTECTED]]
:: Sent: 22 November 2001 04:34
:: To: [EMAIL PROTECTED]
:: Cc: mod_perl Mailing List
:: Subject: Re: Apache::Session Problem -- Addendum
::
::
:: On Wed, 21 Nov 2001 23:23:33 -
:: "Jonathan M. Hollin" <[EMAIL PROTECTED]> wrote:
::
:: > 42: tie %session, 'Apache::Session::DBI',
:: > 43: {DataSource => "dbi:$db_driver:sessions:$db_address"};
::
:: put $sid (session id: undef for fresh) after 'Apache::Session::MySQL'.
::
:: --
:: Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
::




Re: Apache::Session Problem -- Addendum

2001-11-21 Thread Tatsuhiko Miyagawa

On Wed, 21 Nov 2001 23:23:33 -
"Jonathan M. Hollin" <[EMAIL PROTECTED]> wrote:

> 42: tie %session, 'Apache::Session::DBI',
> 43: {DataSource => "dbi:$db_driver:sessions:$db_address"};

put $sid (session id: undef for fresh) after 'Apache::Session::MySQL'.

--
Tatsuhiko Miyagawa <[EMAIL PROTECTED]>




Re: Apache::Session Problem -- Addendum

2001-11-21 Thread Perrin Harkins

> I changed "Apache::Session::DBI" to "Apache::Session::MySQL" and tried
> again.

What's the version number of your Apache::Session?  It should be 1.54.

> 42: tie %session, 'Apache::Session::DBI',
> 43: {DataSource => "dbi:$db_driver:sessions:$db_address"};

With Apache::Session::MySQL, the docs say you should be passing the user
name and password.

- Perrin




Apache::Session Problem -- Addendum

2001-11-21 Thread Jonathan M. Hollin

Thanks to Ilya Martynov for his response...

I changed "Apache::Session::DBI" to "Apache::Session::MySQL" and tried
again.  The following error graced my error log:

[Wed Nov 21 23:01:13 2001] [error] PerlRun: `Died at
E:/Apache/site/lib/Apache/Session/Generate/MD5.pm line 40.'

Looking at MD5.pm - line 39, 40 and 41 read as follows:

if ($session->{data}->{_session_id} !~ /^[a-fA-F0-9]+$/) {
die;
}

I adjusted line 40 to read:

die "$session->{data}->{_session_id}";

The error log now gets:

[Wed Nov 21 23:07:54 2001] [error] PerlRun: `HASH(0x48acc64) at
E:/Apache/site/lib/Apache/Session/Generate/MD5.pm line 40.'

Yikes!

Any ideas?...


[original email follows...]
Fellow Perl Mongers,

Can anyone help with my latest programming riddle?

I am trying to take advantage of the session-handling features of
Apache::Session.  My program includes the following code (line numbers added
for clarity):

20: # Session handler (I)...
21: use Apache::Session::DBI;

[cut]

40: # Session handler (II)...
41: my %session;
42: tie %session, 'Apache::Session::DBI',
43: {DataSource => "dbi:$db_driver:sessions:$db_address"};
44: my $session_cookie = "session_id=$session{_session_id};";

[cut]

The variables $db_driver and $db_address are imported from a small
configuration file that defines them as "mysql" and "192.168.0.201"
respectively.

My program dies when called (via CGI under mod_perl) with an "500 Internal
Server Error" with the following line appended to error.log:

[Wed Nov 21 22:25:12 2001] [error] PerlRun: `Can't locate object method
"TIEHASH" via package "Apache::Session::DBI" at
e:/apache/htdocs/shapeshifter/system/logon.cgi line 42.'



Platform:  Win2K, Apache, mod_perl, MySQL...

Any suggestions (apart from quit programming and take up farming instead)?

Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/




Re: Apache::Session Problem

2001-11-21 Thread Ilya Martynov

> On Wed, 21 Nov 2001 22:49:46 -, "Jonathan M. Hollin" 
><[EMAIL PROTECTED]> said:

Jonathan> Fellow Perl Mongers,
Jonathan> Can anyone help with my latest programming riddle?

Jonathan> I am trying to take advantage of the session-handling
Jonathan> features of Apache::Session.  My program includes the
Jonathan> following code (line numbers added for clarity):

Jonathan> 20: # Session handler (I)...
Jonathan> 21: use Apache::Session::DBI;

Jonathan> [..skip..]

Jonathan> Platform:  Win2K, Apache, mod_perl, MySQL...

Jonathan> Any suggestions (apart from quit programming and take up
Jonathan> farming instead)?

I'm not sure why your code doesn't work but why are you using such old
Apache::Session? Take new Apache::Session which provides MySQL support
via Apache::Session::MySQL.

-- 
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/)  TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80  E4AE BE1A 53EB 323B DEE6 |
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



Apache::Session Problem

2001-11-21 Thread Jonathan M. Hollin

Fellow Perl Mongers,

Can anyone help with my latest programming riddle?

I am trying to take advantage of the session-handling features of
Apache::Session.  My program includes the following code (line numbers added
for clarity):

20: # Session handler (I)...
21: use Apache::Session::DBI;

[cut]

40: # Session handler (II)...
41: my %session;
42: tie %session, 'Apache::Session::DBI',
43: {DataSource => "dbi:$db_driver:sessions:$db_address"};
44: my $session_cookie = "session_id=$session{_session_id};";

[cut]

The variables $db_driver and $db_address are imported from a small
configuration file that defines them as "mysql" and "192.168.0.201"
respectively.

My program dies when called (via CGI under mod_perl) with an "500 Internal
Server Error" with the following line appended to error.log:

[Wed Nov 21 22:25:12 2001] [error] PerlRun: `Can't locate object method
"TIEHASH" via package "Apache::Session::DBI" at
e:/apache/htdocs/shapeshifter/system/logon.cgi line 42.'



Platform:  Win2K, Apache, mod_perl, MySQL...

Any suggestions (apart from quit programming and take up farming instead)?

Jonathan M. Hollin - WYPUG Co-ordinator
West Yorkshire Perl User Group
http://wypug.pm.org/