libapreq behaving differently on RedHat vs Debian...
Hi, I'm using libapreq to do http file uploads, works just fine on my Debian/unstable desktop system, running Apache 1.3.14, mod_perl 1.25. When I use the exact same code to do the same on my RedHat 7.0 server, running Apache 1.3.14, mod_perl 1.24 - the access_log shows that the POST occurs, but the log_error() statements that I have in the handler for the POST request aren't executed - and the browser gets redirected to /, apparently after the upload occurs, since the browser hangs for about that long. Anyone know why this is? The reason I'm using modperl 1.24 on the RedHat system and 1.25 on the Debian system is that that is that 1.25 is what debian's dselect gave me, and 1.24 on the RedHat system is what I downloaded from CPAN. Is this a known problem in 1.24? If so, does 1.25 solve it for RedHat? The HTML looks something like this: HEAD /HEAD BODY bgcolor=#FF FORM METHOD=POST ENCTYPE=multipart/form-data TARGET=main ACTION=areaj?pg=upload TABLE TR TDSelect File:/TD TDINPUT TYPE=file NAME=filename SIZE=40 MAXLENGTH=200/TD /TR TR TD/TD TDINPUT TYPE=submit NAME=Upload VALUE=Upload/TD /TR /TABLE /FORM /BODY And showing the perl isn't really important, since it doesn't get called. Any ideas, anyone? Thanks, //Thomas Thomas K. Burkholder [EMAIL PROTECTED]
Re: libapreq behaving differently on RedHat vs Debian...
On Mon, May 21, 2001 at 01:35:11AM -0700, Thomas K. Burkholder wrote: Hi, I'm using libapreq to do http file uploads, works just fine on my Debian/unstable desktop system, running Apache 1.3.14, mod_perl 1.25. ... The HTML looks something like this: HEAD /HEAD BODY bgcolor=#FF FORM METHOD=POST ENCTYPE=multipart/form-data TARGET=main ACTION=areaj?pg=upload Wild guess, change it in: FORM METHOD=POST ENCTYPE=multipart/form-data TARGET=main ACTION=areaj input type=hidden name=pg value=upload TABLE TR TDSelect File:/TD TDINPUT TYPE=file NAME=filename SIZE=40 MAXLENGTH=200/TD /TR TR TD/TD TDINPUT TYPE=submit NAME=Upload VALUE=Upload/TD /TR /TABLE /FORM /BODY And showing the perl isn't really important, since it doesn't get called. Any ideas, anyone? Thanks, //Thomas Thomas K. Burkholder [EMAIL PROTECTED] -- The Moon is Waning Crescent (4% of Full) nieuw.nl - 2dehands.nl
[DIGEST] mod_perl digest 05/13/01
-- mod_perl digest May 13, 2001 - May 19, 2001 -- Recent happenings in the mod_perl world... Features o mod_perl status o cvs patches o module announcements o mailing list highlights o news o links mod_perl status o mod_perl - stable: 1.25 (released January 29, 2001) [1] - development: 1.25_01-dev [2] o Apache - stable: 1.3.19 (released February 28, 2001) [3] - development: 1.3.21-dev [4] o Perl - stable: 5.6.1 (released April 9, 2001) [5] - development: 5.7.1 [6] cvs patches o adjust perl_clear_symtab() to deal properly bleedperl's version of cv_undef() (which broke modules with directive handlers) [7] module announcements o HTML::Mason 1.03 - component-based web site development system with caching, debugging, and previewing facilities [8] o Apache::PageKit 1.00 - web application framework that uses HTML::Template and XML to separate the Model, View, Content, and Controller [9] o HTML::Embperl 1.3.2 - embed Perl code in your HTML documents [10] mailing list highlights Overall it was a pretty dull week on the list... o Some ideas about preventing duplicate form submissions when using Apache::Session [11] o An attempt to compile mod_perl on Mac OS X (Darwin) is going on in earnest [12] [13] news o Apache 1.3.20 has been rolled, but no official release announcement yet (one should be forthcoming shortly) [14] New features of note: - Added NOESCAPE (NS) flag to RewriteRule and enabled use of '\' to allow escaping of special characters. - Add support for Win32 apxs - Integrate support for the Cygwin 1.x platform - Correct a vulnerability in the Win32 and OS2 ports see the CHANGES [15] for a full list of new features and bug fixes links o The Apache/Perl Integration Project [16] o mod_perl documentation [17] o mod_perl modules on CPAN [18] o mod_perl homepage [19] o mod_perl news and advocacy [20] o mod_perl list archives [21] [22] happy mod_perling... --Geoff [EMAIL PROTECTED] -- [1] http://perl.apache.org/dist/ [2] http://perl.apache.org/from-cvs/modperl/ [3] http://www.apache.org/dist/httpd/ [4] http://dev.apache.org/from-cvs/apache-1.3/ [5] http://www.cpan.org/src/stable.tar.gz [6] http://www.cpan.org/src/devel.tar.gz [7] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=98995529722642w=2 [8] http://forum.swarthmore.edu/epigone/modperl/prenprinbreld [9] http://forum.swarthmore.edu/epigone/modperl/dwermstumsnan [10] http://forum.swarthmore.edu/epigone/modperl/thenpaqui [11] http://forum.swarthmore.edu/epigone/modperl/phushermpimp [12] http://marc.theaimsgroup.com/?t=9898989751w=2r=1 [13] http://marc.theaimsgroup.com/?t=9899834701w=2r=1 [14] http://marc.theaimsgroup.com/?l=apache-new-httpdm=99013486214433w=2 [15] http://dev.apache.org/dist/CHANGES_1.3.20 [16] http://perl.apache.org [17] http://perl.apache.org/#docs [18] http://www.cpan.org/modules/by-module/Apache/ [19] http://www.modperl.com [20] http://www.take23.org [21] http://forum.swarthmore.edu/epigone/modperl/ [22] http://marc.theaimsgroup.com/?l=apache-modperlr=1w=2
Re: Lightweight CGI.pm for PerlHandlers
On Fri, 18 May 2001 23:28:06 -0400, Neil Conway wrote: I'd like to be able to use something similar to CGI.pm's HTML generation methods in a PerlHandler I'm writing. Since I'm not ever going to be using CGI directly (and also, the HTML I'm doing is pretty simple), CGI.pm seems like overkill -- and from looking at some basic memory usage data, it seems like you pay for this complexity/flexibility. Is there a simple (fast, light) module that generates HTML in a similar style to CGI.pm, for use with mod_perl? If you just care about CGI.pm's stickiness, my HTML::StickyForms module in combination with Apache::Request will generate form elements. You'll have to do the other elements yourself, though. -- Peter Haworth [EMAIL PROTECTED] This seems dangerously close to COBOL, something difficult to argue in favor of. -- Tom Christiansen
Re: [DIGEST] mod_perl digest 05/13/01
On Mon, 21 May 2001, Geoffrey Young wrote: -- mod_perl digest May 13, 2001 - May 19, 2001 -- [ .. ] news o Apache 1.3.20 has been rolled, but no official release announcement yet (one should be forthcoming shortly) [14] New features of note: - Added NOESCAPE (NS) flag to RewriteRule and enabled use of '\' to allow escaping of special characters. - Add support for Win32 apxs - Integrate support for the Cygwin 1.x platform - Correct a vulnerability in the Win32 and OS2 ports see the CHANGES [15] for a full list of new features and bug fixes [15] http://dev.apache.org/dist/CHANGES_1.3.20 Something else that's worth noting for Win32 mod_perl and Apache_1.3.20 is that the service problem that several people ran into has been solved. best regards, randy kobes
Strange status returns from perl_handler
We've just upgraded a SunOS machine from Apache 1.3.9 + mod_perl 1.21 (dynamically linked) to Apache 1.3.19 + mod_perl 1.25 (statically linked). I have a CGI/Perl script, handled as normal by perl-script and Apache::Registry. Now, this CGI script sometimes returns a page with status something like '403 Forbidden', including full content and full headers. With the old version, the perl_handler function returned with status=0 (OK), even if the HTTP status was going to be 403, and then Apache was quite happy with this. However, in the current combination, the perl_handler function returns with the HTTP status, so that the Apache core adds on its own content. I am not sure what interactions are going on here, as at first sight, this doesn't appear to happen with Linux running the same combination (dynamically linked, though). Any ideas, anyone? Julian -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Julian Gilbey, Dept of Maths, Queen Mary, Univ. of London Debian GNU/Linux Developer, see http://people.debian.org/~jdg Donate free food to the world's hungry: see http://www.thehungersite.com/
Re: libapreq behaving differently on RedHat vs Debian...
You are totally correct; you've saved me the cost of a new monitor, which was about to receive my forehead through it if I stared at this any longer. Can't believe I made such a silly error - I have other forms where I deliberately used the hidden field in exactly the way you point out, to avoid the possibility of this problem. Thanks!!! //Thomas Thomas K. Burkholder [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Mon, May 21, 2001 at 01:35:11AM -0700, Thomas K. Burkholder wrote: Hi, I'm using libapreq to do http file uploads, works just fine on my Debian/unstable desktop system, running Apache 1.3.14, mod_perl 1.25. ... The HTML looks something like this: HEAD /HEAD BODY bgcolor=#FF FORM METHOD=POST ENCTYPE=multipart/form-data TARGET=main ACTION=areaj?pg=upload Wild guess, change it in: FORM METHOD=POST ENCTYPE=multipart/form-data TARGET=main ACTION=areaj input type=hidden name=pg value=upload TABLE TR TDSelect File:/TD TDINPUT TYPE=file NAME=filename SIZE=40 MAXLENGTH=200/TD /TR TR TD/TD TDINPUT TYPE=submit NAME=Upload VALUE=Upload/TD /TR /TABLE /FORM /BODY And showing the perl isn't really important, since it doesn't get called. Any ideas, anyone? Thanks, //Thomas Thomas K. Burkholder [EMAIL PROTECTED] -- The Moon is Waning Crescent (4% of Full) nieuw.nl - 2dehands.nl
Connection to MySQL DB fails when mod_perl enabled...
This is driving me crazy... is there anything special I need to do when using DBI (DBD::MySQL) with mod_perl. A script that works just fine sans mod_perl dies with error 500 (Internal Server Error) when mod_perl is enabled for that file type: Web Server: Apache/1.3.19(Win32) mod_perl/1.24_01 on a Windows 2000 server -- connecting to a MySQL 3.23.38-nt DB-server. Sample of httpd.conf: # BEGIN MOD_PERL CONFIG LoadModule perl_module modules/ApacheModulePerl ScriptAlias /perl-bin/ perl-bin/ PerlSendHeader On Location /perl-bin SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Location Files *.pl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files # END MOD_PERL CONFIG Error Log entry: [Tue May 22 00:13:09 2001] nul: DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 29 [Tue May 22 00:13:09 2001] [error] Can't call method prepare on an undefined value at e:/pad/htdocs/internet/system/frontpage.cgi line 30. Perl Code: use DBI(); $driver = mysql; $dsn = DBI:$driver:database=shapeshifter;host=localhost; $dbh = DBI-connect($dsn, dbusrname, dbpassword); my $sth = $dbh-prepare(SELECT * FROM frontpage); $sth-execute(); while (my $ref = $sth-fetchrow_hashref()) { $body .= qq~Found a row: id = $ref-{'serial_number'}, name = $ref-{'position'}BR~; } $sth-finish(); $dbh-disconnect(); Any help appreciated. I have RTFMs but I can't reach any conclusions about contention between mod_perl and MySQL... Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
Jonathan M. Hollin wrote: This is driving me crazy... is there anything special I need to do when using DBI (DBD::MySQL) with mod_perl. A script that works just fine sans mod_perl dies with error 500 (Internal Server Error) when mod_perl is enabled for that file type: Web Server: Apache/1.3.19(Win32) mod_perl/1.24_01 on a Windows 2000 server -- connecting to a MySQL 3.23.38-nt DB-server. Sample of httpd.conf: # BEGIN MOD_PERL CONFIG LoadModule perl_module modules/ApacheModulePerl ScriptAlias /perl-bin/ perl-bin/ PerlSendHeader On Location /perl-bin SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Location Files *.pl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files # END MOD_PERL CONFIG Error Log entry: [Tue May 22 00:13:09 2001] nul: DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 29 [Tue May 22 00:13:09 2001] [error] Can't call method prepare on an undefined value at e:/pad/htdocs/internet/system/frontpage.cgi line 30. Perl Code: use DBI(); $driver = mysql; $dsn = DBI:$driver:database=shapeshifter;host=localhost; $dbh = DBI-connect($dsn, dbusrname, dbpassword); how bout adding a 'or die DBI-errstr' to the above line to find out whats happening. my $sth = $dbh-prepare(SELECT * FROM frontpage); $sth-execute(); while (my $ref = $sth-fetchrow_hashref()) { $body .= qq~Found a row: id = $ref-{'serial_number'}, name = $ref-{'position'}BR~; } $sth-finish(); $dbh-disconnect(); Any help appreciated. I have RTFMs but I can't reach any conclusions about contention between mod_perl and MySQL... Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
Hmm... Tried that, it returns nothing!!! :-( Kindest regards, Jonathan M. Hollin Digital-Word.com :: Jonathan M. Hollin wrote: :: :: This is driving me crazy... is there anything special I need :: to do when :: using DBI (DBD::MySQL) with mod_perl. A script that works :: just fine sans :: mod_perl dies with error 500 (Internal Server Error) when mod_perl is :: enabled for that file type: :: :: Web Server: Apache/1.3.19(Win32) mod_perl/1.24_01 on a Windows 2000 :: server -- connecting to a MySQL 3.23.38-nt DB-server. :: :: Sample of httpd.conf: :: :: # BEGIN MOD_PERL CONFIG :: LoadModule perl_module modules/ApacheModulePerl :: ScriptAlias /perl-bin/ perl-bin/ :: PerlSendHeader On :: Location /perl-bin :: SetHandler perl-script :: PerlHandler Apache::Registry :: Options ExecCGI :: /Location :: :: Files *.pl :: SetHandler perl-script :: PerlHandler Apache::Registry :: Options ExecCGI :: /Files :: :: Files *.cgi :: SetHandler perl-script :: PerlHandler Apache::Registry :: Options ExecCGI :: /Files :: :: # END MOD_PERL CONFIG :: :: Error Log entry: :: :: [Tue May 22 00:13:09 2001] nul: DBI-connect failed: Can't :: connect to MySQL :: server on 'localhost' (10061) at :: e:/pad/htdocs/internet/system/frontpage.cgi :: line 29 :: [Tue May 22 00:13:09 2001] [error] Can't call method prepare on an :: undefined value at e:/pad/htdocs/internet/system/frontpage.cgi line 30. :: :: Perl Code: :: :: use DBI(); :: $driver = mysql; :: $dsn = DBI:$driver:database=shapeshifter;host=localhost; :: $dbh = DBI-connect($dsn, dbusrname, dbpassword); :: :: how bout adding a 'or die DBI-errstr' to the above line to find :: out whats :: happening. :: :: :: my $sth = $dbh-prepare(SELECT * FROM frontpage); :: $sth-execute(); :: while (my $ref = $sth-fetchrow_hashref()) { :: $body .= qq~Found a row: id = :: $ref-{'serial_number'}, name = :: $ref-{'position'}BR~; :: } :: $sth-finish(); :: $dbh-disconnect(); :: :: Any help appreciated. I have RTFMs but I can't reach any :: conclusions about :: contention between mod_perl and MySQL... :: :: Kindest regards, :: Jonathan M. Hollin :: Digital-Word.com ::
Re: Connection to MySQL DB fails when mod_perl enabled...
A script that works just fine sans mod_perl dies with error 500 (Internal Server Error) when mod_perl is enabled for that file type: This indicates that ~something~ should have gone to the error log. Can you tell us what else is there? Can you get a DB connection with regular CGI? --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
:: This indicates that ~something~ should have gone to the error :: log. Can you tell us what else is there? Nothing, except: [Tue May 22 00:44:37 2001] nul: DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 29 [Tue May 22 00:44:37 2001] [error] Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 29. :: Can you get a DB connection with regular CGI? Yes, no problem at all with regular CGI. But I already like the massive speed increase I've seen under mod_perl and don't want to lose it. If I comment out the DBI code the rest of the script works fine. I have test the MOD_PERL environment string and mod_perl is definitely running okay. Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
JH If I comment out the DBI code the rest of the script works fine. I have JH test the MOD_PERL environment string and mod_perl is definitely running JH okay. You have several pieces of mod_perl configuration. If you leave it all in place, and try some mod_perl CGI without a DB connection, what happens? --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
:: You have several pieces of mod_perl configuration. If you leave it all in :: place, and try some mod_perl CGI without a DB connection, what happens? Everything works fine (tested several scripts yet and had no other problems - none of the others use DBI though). I am also using CGI.pm in the script that's failing. Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
[EMAIL PROTECTED] (Jonathan M. Hollin) wrote: [EMAIL PROTECTED] (Mike Cameron) wrote: :: how bout adding a 'or die DBI-errstr' to the above line to find :: out whats :: happening. Hmm... Tried that, it returns nothing!!! :-( This is suspicious. The connect() is definitely where the error is happening given what you wrote earlier. Try making sure, change it to: use DBI(); $driver = mysql; $dsn = DBI:$driver:database=shapeshifter;host=localhost; $dbh = DBI-connect($dsn, dbusrname, dbpassword) or die Error: $DBI::errstr; (include the whole string there) ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
RE: Connection to MySQL DB fails when mod_perl enabled...
Oh the connect is definitely where it's failing. If I comment that out then everything works fine... I'll try your code though - watch this space. Kindest regards, Jonathan M. Hollin Digital-Word.com :: :: how bout adding a 'or die DBI-errstr' to the above line to find :: :: out whats :: :: happening. :: :: Hmm... Tried that, it returns nothing!!! :-( :: :: This is suspicious. The connect() is definitely where the error is :: happening given what you wrote earlier. Try making sure, change it to: :: :: use DBI(); :: $driver = mysql; :: $dsn = DBI:$driver:database=shapeshifter;host=localhost; :: $dbh = DBI-connect($dsn, dbusrname, dbpassword) :: or die Error: $DBI::errstr; :: :: (include the whole string there)
Fw: Connection to MySQL DB fails when mod_perl enabled...
Hey Jon, You sent this one straight to me... - Original Message - From: Jonathan M. Hollin [EMAIL PROTECTED] JH Yes I also have PHP4 installed and running properly (and am able to connect JH to the MySQL server fine with PHP). I'll comment out the PHP code from JH httpd.config and see if that helps... Cool, that could be it. If not, I'd get suspicious of anything else that can access Mysql. --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
:: This is suspicious. The connect() is definitely where the error is :: happening given what you wrote earlier. Try making sure, change it to: :: :: use DBI(); :: $driver = mysql; :: $dsn = DBI:$driver:database=shapeshifter;host=localhost; :: $dbh = DBI-connect($dsn, dbusrname, dbpassword) :: or die Error: $DBI::errstr; Done this - failed! Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
:: JH Yes I also have PHP4 installed and running properly (and am able to :: connect :: JH to the MySQL server fine with PHP). I'll comment out the :: PHP code from :: JH httpd.config and see if that helps... :: :: Cool, that could be it. If not, I'd get suspicious of anything :: else that can :: access Mysql. Removed PHP from Apache, that didn't help. Nothing else is connecting to the MySQL server. Interestingly, the MySQL server error log contains nothing. No failed access attempts, no other error codes. I presume this is significant? Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
JH Yes I also have PHP4 installed and running properly (and am able JH to connect to the MySQL server fine with PHP). Good, that establishes that your DB is working. JH Removed PHP from Apache, that didn't help. JH Nothing else is connecting to the MySQL server. I've never used a non-*NIX Apache. Do you need to restart you machine to get something(s) out of memory? Compile a new binary (I doubt it)? JH Interestingly, the MySQL server error log contains nothing. No failed JH access attempts, no other error codes. I presume this is significant? My thought would be that this indicates a driver problem. I would suggest creating a terribly minimized configuration that only includes the requisits and mod_perl stuff. Then see if that works. --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
[EMAIL PROTECTED] (Jonathan M. Hollin) wrote: :: This is suspicious. The connect() is definitely where the error is :: happening given what you wrote earlier. Try making sure, change it to: :: :: use DBI(); :: $driver = mysql; :: $dsn = DBI:$driver:database=shapeshifter;host=localhost; :: $dbh = DBI-connect($dsn, dbusrname, dbpassword) :: or die Error: $DBI::errstr; Done this - failed! What does 'failed' mean? What was the error? That's the point, you have to see the particular error string, starting with Error:, to find out what's happening. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
RE: Connection to MySQL DB fails when mod_perl enabled...
:: JH Yes I also have PHP4 installed and running properly (and am able :: JH to connect to the MySQL server fine with PHP). :: :: Good, that establishes that your DB is working. Yes the database is working fine. Let me reiterate: DB is accessible via mysqladmin; DB is accessible via PHP; DB is accessible via CGI; DB is NOT accessible via mod_perl. :: JH Removed PHP from Apache, that didn't help. :: JH Nothing else is connecting to the MySQL server. :: :: I've never used a non-*NIX Apache. Do you need to restart you :: machine to get :: something(s) out of memory? Compile a new binary (I doubt it)? I don't think I have to restart the machine. I thought I only had to kill the Apache process, then restart it. However, I'll try a reboot... :: JH Interestingly, the MySQL server error log contains nothing. :: No failed :: JH access attempts, no other error codes. I presume this is :: significant? :: :: My thought would be that this indicates a driver problem. I would suggest :: creating a terribly minimized configuration that only includes :: the requisits :: and mod_perl stuff. Then see if that works. Yes, I think I should try this. I'll reboot now, then test. Then I'll build minimal script and test that. Will advise list of results. I would just like to say thank you to everyone for their help thus far. I am completely new to mod_perl, but an old hand with Perl and CGI. I appreciate your efforts. Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
:: What does 'failed' mean? What was the error? That's the point, you :: have to see the particular error string, starting with Error:, to find :: out what's happening. I appreciate what you were looking for Ken. But that's the point - I don't get an error string. All I get is an Internal Server Error. Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
I appreciate what you were looking for Ken. But that's the point - I don't get an error string. All I get is an Internal Server Error. Sorry if I'm pointing out the obvious, but that's what you usually see in the browser. The real error message will be in your apache logs, quite often in /var/log/httpd/error_log, but defined in your apache configuration. -- Tom Lancaster Red Hat, Inc. [EMAIL PROTECTED] (510)-986-8770 x 354
RE: Connection to MySQL DB fails when mod_perl enabled...
:: Sorry if I'm pointing out the obvious, but that's what you usually see in :: the browser. The real error message will be in your apache logs, :: quite often in /var/log/httpd/error_log, but defined in your apache :: configuration. I know Tom. I already posted the error log entry, but here goes anyway: [Tue May 22 01:39:47 2001] [error] DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 33 Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
I see what Tom is saying. You said that you found this in your error log: [Tue May 22 01:39:47 2001] [error] DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/frontpage.cgi line 33 But a previous message suggested trying to propogate your own error in the Perl code like this: $dbh = DBI-connect($dsn, dbusrname, dbpassword) or die Error: $DBI::errstr; If you use this method, then you should get a record in your error log simular to: Error: some error message Tom is saying that your error message should actually include the string: 'Error: '. I'm wondering the same thing, what did ~that ~ error message say? --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
:: I see what Tom is saying. You said that you found this in your error log: :: :: [Tue May 22 01:39:47 2001] [error] DBI-connect failed: Can't :: connect to :: MySQL server on 'localhost' (10061) at :: e:/pad/htdocs/internet/system/frontpage.cgi line 33 :: :: But a previous message suggested trying to propogate your own :: error in the :: Perl code like this: :: :: $dbh = DBI-connect($dsn, dbusrname, dbpassword) :: or die Error: $DBI::errstr; :: :: If you use this method, then you should get a record in your error log :: simular to: :: Error: some error message :: :: Tom is saying that your error message should actually include the string: :: 'Error: '. I'm wondering the same thing, what did ~that ~ error :: message say? That's my point. I DO have the or die code in my script - it hasn't changed the message reported in error.log. Believe me guys, I'm as confused as you are. Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
[EMAIL PROTECTED] (Jonathan M. Hollin) wrote: :: Tom is saying that your error message should actually include the string: :: 'Error: '. I'm wondering the same thing, what did ~that ~ error :: message say? That's my point. I DO have the or die code in my script - it hasn't changed the message reported in error.log. Believe me guys, I'm as confused as you are. Okay, then that's the problem. It's not running the script you think it's running. If you don't see 'Error:' in the error log, then you could change that script all day and your changes will never have any effect. So either you're just running the wrong script, or the script has gotten cached under Apache::Registry and it's not noticing the latest version on disk. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Still not talking!
Okay... Rebooting the computer made no difference whatsoever. So I built a minimal script as follows: #!perl print (Content-type: text/html\n\n); use strict; use vars qw($query $dsn $driver $db_username $db_password $dbh); require 5.006; $| = 1; ($0 =~ m,(.*)/[^/]+,) unshift (@INC, $1); ($0 =~ m,(.*)\\[^\\]+,) unshift (@INC, $1); use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; $CGI::POST_MAX = (1024 * 0); $CGI::DISABLE_UPLOADS = 1; $query = new CGI; use DBI(); $driver = mysql; $dsn = DBI:$driver:database=shapeshifter;host=localhost; $db_username = ; $db_password = ; warn Before DBI-connect(): [$$]; $dbh = DBI-connect($dsn, $db_username, $db_password, {'RaiseError' = 1}) or die sprintf Error: %s.\n, DBI-errstr; warn After DBI-connect() [$$]; my $sth = $dbh-prepare(SELECT * FROM frontpage); $sth-execute(); while (my $ref = $sth-fetchrow_hashref()) { print qq~Found a row: id = $ref-{'serial_number'}, name = $ref-{'position'}BR~; } $sth-finish(); $dbh-disconnect(); if ($ENV{'MOD_PERL'}) { print Mod_perl is installed on this server: $ENV{'MOD_PERL'}brbr\n; } else { print Mod_perl is not installed on this serverbrbr\n; } When running this I get a 200 OK message in the browser as follows: 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. Apache/1.3.19 Server at localhost Port 80 The error.log file (Apache) contains the following: [Tue May 22 02:35:03 2001] nul: Before DBI-connect(): [500] at e:/pad/htdocs/internet/system/db_test.cgi line 20. [Tue May 22 02:35:03 2001] [error] DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/db_test.cgi line 21 Now I'm completely stumped. Can anyone spot anything obvious from this? FYI, I have attached my httpd.conf in its entirety in case that helps. Kindest regards, Jonathan M. Hollin Digital-Word.com httpd.conf
RE: Connection to MySQL DB fails when mod_perl enabled...
:: Okay, then that's the problem. It's not running the script you think :: it's running. If you don't see 'Error:' in the error log, then you :: could change that script all day and your changes will never have any :: effect. But it is running the script I am requesting - I know this because when I comment out the DBI-connect it works perfectly. :: So either you're just running the wrong script, or the script has gotten :: cached under Apache::Registry and it's not noticing the latest version :: on disk. cached under Apache::Registry - well that's outside of my [limited] knowledge of Apache. Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Still not talking!
$db_username = ; $db_password = ; warn Before DBI-connect(): [$$]; $dbh = DBI-connect($dsn, $db_username, $db_password, {'RaiseError' = 1}) or die sprintf Error: %s.\n, DBI-errstr; You're probably not getting your error message because you have RaiseError on. From the DBI pod: RaiseError (boolean, inherited) This attribute can be used to force errors to raise exceptions rather than simply return error codes in the normal way. It is off by default. When set on, any method which results in an error will cause the DBI to effectively do a die($class $method failed: $DBI::errstr), where $class is the driver class and $method is the name of the method that failed. E.g., DBD::Oracle::db prepare failed: ... error text here ... So DBI is dying before your die ... as to why you can't connect? I'm not sure yet. Still thinking ... -- Jason Bodnar [EMAIL PROTECTED]
RE: Still not talking!
:: You're probably not getting your error message because you have :: RaiseError on. Have corrected that - but the results haven't changed in any way. Kindest regards, Jonathan M. Hollin Digital-Word.com
Re: Connection to MySQL DB fails when mod_perl enabled...
OK, here's the relevant part of your conf: # BEGIN MOD_PERL CONFIG LoadModule perl_module modules/ApacheModulePerl ScriptAlias /perl-bin/ perl-bin/ PerlSendHeader On Location /perl-bin SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Location Files *.pl SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files # END MOD_PERL CONFIG I propose that you reduce it to: # BEGIN MOD_PERL CONFIG LoadModule perl_module modules/ApacheModulePerl Files *.mpl SetHandler perl-script PerlHandler Apache::Registry /Files # END MOD_PERL CONFIG You'll see that I'm using *.mpl. This will insure that you don't have some other assosiation interfering. --- Rodney Broom
RE: Connection to MySQL DB fails when mod_perl enabled...
Rodney, :: I propose that you reduce it to: :: :: # BEGIN MOD_PERL CONFIG :: LoadModule perl_module modules/ApacheModulePerl :: :: Files *.mpl :: SetHandler perl-script :: PerlHandler Apache::Registry :: /Files :: :: # END MOD_PERL CONFIG :: :: You'll see that I'm using *.mpl. This will insure that you don't :: have some :: other assosiation interfering. I had already tried .plx to no avail. I have made the change as you suggest and I still have the same error. I'm probably going to have to forfeit mod_perl after all. :-( Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
Incidentally, I am using the following module versions: DBD-MySQL [1.2214]; DBI [1.13] Does this have any bearing on my problem? Kindest regards, Jonathan M. Hollin Digital-Word.com LATEST NEWS: Digital-Word.com releases e-gateway v3.0. See: http://e-gateway.1-1IT.Net/ for further details... IMPORTANT: This e-mail and the information that it contains may be confidential, legally privileged and protected by law. Access by the intended recipient only is authorised. Any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting, on any information contained in this e-mail is hereby excluded. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Copyright in this e-mail and attachments created by us belongs to The Digital Word Company Limited: the author also asserts the right to be identified as such and object to any misuse. The Digital Word Company Limited. Registered in the United Kingdom, number: 3416629. Registered Office: Batley Business Technology Centre, Technology Drive, Batley, WF17 6ER, England. Internet: http://v3.digital-word.com/
RE: Connection to MySQL DB fails when mod_perl enabled...
[EMAIL PROTECTED] (Jonathan M. Hollin) wrote: I'm probably going to have to forfeit mod_perl after all. :-( Okay, last idea: you say you can connect to mysql from the command line, from regular CGI, and from PHP. I'm guessing that in all of those situations, you're acting as the same user (win2k user, not mysql user). However, under mod_perl you'll be acting as whatever user your web server runs as. That's probably the only real difference between mod_perl and the other situations. So if you can become that user and try connecting to the database, perhaps you can get more insight into the problem. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
RE: Connection to MySQL DB fails when mod_perl enabled...
:: Okay, last idea: you say you can connect to mysql from the command line, :: from regular CGI, and from PHP. I'm guessing that in all of those :: situations, you're acting as the same user (win2k user, not mysql user). :: However, under mod_perl you'll be acting as whatever user your web :: server runs as. That's probably the only real difference between :: mod_perl and the other situations. :: :: So if you can become that user and try connecting to the database, :: perhaps you can get more insight into the problem. I would like to try that (anything to get this working). Er... how do I do that? Kindest regards, Jonathan M. Hollin Digital-Word.com
RE: Connection to MySQL DB fails when mod_perl enabled...
[EMAIL PROTECTED] (Jonathan M. Hollin) wrote: :: Okay, last idea: you say you can connect to mysql from the command line, :: from regular CGI, and from PHP. I'm guessing that in all of those :: situations, you're acting as the same user (win2k user, not mysql user). :: However, under mod_perl you'll be acting as whatever user your web :: server runs as. That's probably the only real difference between :: mod_perl and the other situations. :: :: So if you can become that user and try connecting to the database, :: perhaps you can get more insight into the problem. I would like to try that (anything to get this working). Er... how do I do that? Under win2k, I have no idea. Under unix, you'd use su or a similar identity-switching mechanism. You'll probably have to find a win2k person to help with that. Let me also gently suggest that you should take this off-list, as there have been a lot of messages on your topic already. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: Connection to MySQL DB fails when mod_perl enabled...
Ken Williams wrote: [EMAIL PROTECTED] (Jonathan M. Hollin) wrote: :: Okay, last idea: you say you can connect to mysql from the command line, :: from regular CGI, and from PHP. I'm guessing that in all of those :: situations, you're acting as the same user (win2k user, not mysql user). :: However, under mod_perl you'll be acting as whatever user your web :: server runs as. That's probably the only real difference between :: mod_perl and the other situations. :: :: So if you can become that user and try connecting to the database, :: perhaps you can get more insight into the problem. I would like to try that (anything to get this working). Er... how do I do that? Under win2k, I have no idea. Under unix, you'd use su or a similar identity-switching mechanism. You'll probably have to find a win2k person to help with that. Let me also gently suggest that you should take this off-list, as there have been a lot of messages on your topic already. But please post your resolution as it may be useful to someone else down the road. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
That annoying DB guy again... ;-)
I know you all want me to go away, so I apologise for the noise. Anyway, at http://perl.apache.org/guide/databases.html#Why_Relational_SQL_Databases there is a reference to an Apache::DBI module. I DON'T have this module installed - is this the reason why CGI connects work yet mod_perl requests don't? I wonder... Kindest regards, Jonathan M. Hollin Digital-Word.com LATEST NEWS: Digital-Word.com releases e-gateway v3.0. See: http://e-gateway.1-1IT.Net/ for further details... IMPORTANT: This e-mail and the information that it contains may be confidential, legally privileged and protected by law. Access by the intended recipient only is authorised. Any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting, on any information contained in this e-mail is hereby excluded. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Copyright in this e-mail and attachments created by us belongs to The Digital Word Company Limited: the author also asserts the right to be identified as such and object to any misuse. The Digital Word Company Limited. Registered in the United Kingdom, number: 3416629. Registered Office: Batley Business Technology Centre, Technology Drive, Batley, WF17 6ER, England. Internet: http://v3.digital-word.com/
Re: That annoying DB guy again... ;-)
On Tue, 22 May 2001, Jonathan M. Hollin wrote: I know you all want me to go away, so I apologise for the noise. Anyway, at http://perl.apache.org/guide/databases.html#Why_Relational_SQL_Databases there is a reference to an Apache::DBI module. I DON'T have this module installed - is this the reason why CGI connects work yet mod_perl requests don't? I wonder... No, that module is not required. Apache::DBI will cache DBI connections for you. It is something you might want to look at after you get your problem fixed. As to Ken's suggestion of trying to access MySQL from the command line using the same user as apache is running as, you could try running the mysql command line interpreter as a different user: mysql -u username -p databasename The -p just means it will prompt you for a password. I would have a good read of the MySQL docs on access permissions. Or try running Apache as a different user that you know has access to the database. Please don't let this discourage you from using mod_perl. It is probably one of those simple mistakes that everyone makes. And if you really can't solve your problem, you could always scrap windows and use Unix instead of scapping mod_perl and using VB ;) Cees
Re: That annoying DB guy again... ;-)
Jonathan M. Hollin wrote: I know you all want me to go away, so I apologise for the noise. Anyway, at http://perl.apache.org/guide/databases.html#Why_Relational_SQL_Databases there is a reference to an Apache::DBI module. I DON'T have this module installed - is this the reason why CGI connects work yet mod_perl requests don't? I wonder... That should not be a problem. Apache::DBI just allows for persistent DB connections but DBI alone should work just fine Kindest regards, Jonathan M. Hollin Digital-Word.com LATEST NEWS: Digital-Word.com releases e-gateway v3.0. See: http://e-gateway.1-1IT.Net/ for further details... IMPORTANT: This e-mail and the information that it contains may be confidential, legally privileged and protected by law. Access by the intended recipient only is authorised. Any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting, on any information contained in this e-mail is hereby excluded. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Copyright in this e-mail and attachments created by us belongs to The Digital Word Company Limited: the author also asserts the right to be identified as such and object to any misuse. The Digital Word Company Limited. Registered in the United Kingdom, number: 3416629. Registered Office: Batley Business Technology Centre, Technology Drive, Batley, WF17 6ER, England. Internet: http://v3.digital-word.com/
[OT] Fast DB access
Hi, This is a follow up of mails sent to this mailing list last month. We were benchmarking several db access methods and comparing them with postgres. Lots of people advised us to try pg 7.1 instead of pg 6.5.3 This turns out to be good advice as regards performance. (We would like to implement one application before commenting on stability) We ran the same benchmark as last time. Benchmark is some configurable number of selects on a composite primary key. The results are number of selects: 100postgres4605 wallclock secs (858.69 usr + 115.92 sys = 974.61 CPU)pg 7.13297 wallclock secs (835.19 usr + 96.86 sys = 932.05 CPU)mldbm1286 wallclock secs (.71 usr + 161.86 sys = 1273.57 CPU) As you can see pg 7.1 is 30% faster than pg 6.5.3 and 3 times slower than MLDBM. If people are interested in the benchmark script itself, please write to us. Thanks and Regards, Murali S Muthu Ganesh Differentiated Software Solutions Pvt. Ltd.,90, 3rd Cross,2nd Main, Ganga Nagar,Bangalore - 560 032Phone : 91 80 3631445, 3431470Visit us at www.diffsoft.com BEGIN:VCARD VERSION:2.1 N:;Murali FN:Murali ORG:Differentiated Software Solutions Pvt. Ltd TITLE:Director TEL;WORK;VOICE:91 80 3431470 TEL;HOME;VOICE:91 80 3431470 ADR;WORK;ENCODING=QUOTED-PRINTABLE:;;90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar;Bangalore;Karnataka;560032;India LABEL;WORK;ENCODING=QUOTED-PRINTABLE:90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar=0D=0ABangalore, Karnataka 560032= =0D=0AIndia ADR;HOME;ENCODING=QUOTED-PRINTABLE:;;90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar;Bangalore;Karnataka;560032;India LABEL;HOME;ENCODING=QUOTED-PRINTABLE:90, 3rd Cross, 2nd Main,=0D=0AGanga Nagar=0D=0ABangalore, Karnataka 560032= =0D=0AIndia X-WAB-GENDER:2 URL:http://www.diffsoft.com URL:http://www.diffsoft.com EMAIL;PREF;INTERNET:[EMAIL PROTECTED] REV:20010522T042158Z END:VCARD
RE: Still not talking!
Hi, These are my 5 cents to the problem :) In the error log is a error code 10061 (Which stands for connection refused) this means that the application cannot even open a connection to the mysql server. Maybe you should also provide the DSN with a port number. Or try to use 127.0.0.1 instead of localhost. Greetings Guido Moonen -Original Message- From: Jonathan M. Hollin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 22, 2001 3:38 AM To: [EMAIL PROTECTED] Subject: Still not talking! Okay... Rebooting the computer made no difference whatsoever. So I built a minimal script as follows: #!perl print (Content-type: text/html\n\n); use strict; use vars qw($query $dsn $driver $db_username $db_password $dbh); require 5.006; $| = 1; ($0 =~ m,(.*)/[^/]+,) unshift (@INC, $1); ($0 =~ m,(.*)\\[^\\]+,) unshift (@INC, $1); use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; $CGI::POST_MAX = (1024 * 0); $CGI::DISABLE_UPLOADS = 1; $query = new CGI; use DBI(); $driver = mysql; $dsn = DBI:$driver:database=shapeshifter;host=localhost; $db_username = ; $db_password = ; warn Before DBI-connect(): [$$]; $dbh = DBI-connect($dsn, $db_username, $db_password, {'RaiseError' = 1}) or die sprintf Error: %s.\n, DBI-errstr; warn After DBI-connect() [$$]; my $sth = $dbh-prepare(SELECT * FROM frontpage); $sth-execute(); while (my $ref = $sth-fetchrow_hashref()) { print qq~Found a row: id = $ref-{'serial_number'}, name = $ref-{'position'}BR~; } $sth-finish(); $dbh-disconnect(); if ($ENV{'MOD_PERL'}) { print Mod_perl is installed on this server: $ENV{'MOD_PERL'}brbr\n; } else { print Mod_perl is not installed on this serverbrbr\n; } When running this I get a 200 OK message in the browser as follows: 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. -- -- Apache/1.3.19 Server at localhost Port 80 The error.log file (Apache) contains the following: [Tue May 22 02:35:03 2001] nul: Before DBI-connect(): [500] at e:/pad/htdocs/internet/system/db_test.cgi line 20. [Tue May 22 02:35:03 2001] [error] DBI-connect failed: Can't connect to MySQL server on 'localhost' (10061) at e:/pad/htdocs/internet/system/db_test.cgi line 21 Now I'm completely stumped. Can anyone spot anything obvious from this? FYI, I have attached my httpd.conf in its entirety in case that helps. Kindest regards, Jonathan M. Hollin Digital-Word.com