Re: perl's system() w/ apache under win2k
Terra Info wrote: [...] > application. If you would like to take output from that application then > you should write to STDOUT all text you want the perl application to see > as a return value from your system() call or `` (backticks) call. you probably meant qx(), as system doesn't return the sub-process' STDOUT, but only the exec status. __ 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: sed error in perl Makefile.pl
It ended up being the bad character tacked returned by my . It sometimes looks like 'nyc.rr.com\000' or the like. Bad DHCP setup on my part. Here's the a couple lines out of the offending sed. -e s%@conf_serveradmin@[EMAIL PROTECTED]%d00%g -e s%@conf_servername@%float1.nyc.rr.com%d00%g Thanks for that #!/bin/sh -x trick, Stas! I have to rebuild my perl and go through the Configure process to tell it to ignore `hostname`, unless you know a trick for that, too! -ciao for now, Josh --- Stas Bekman <[EMAIL PROTECTED]> wrote: > [.. > > When I run > > > > perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src > \ > > DO_HTTPD=1 USE_APACI=1 > EVERYTHING=1 \ > > > APACHE_PREFIX=/home/user/httpd/apache > > > > I see this (note the sed error) > > > > (cd ../apache_1.3.27 && CC="gcc" CFLAGS=" > -D_REENTRANT > > -DTHREADS_HAVE_PIDS -fno- > > strict-aliasing -I/usr/local/include" ./configure > > --activate-module=src/modules/ > > perl/libperl.a --disable-rule=EXPAT > > --prefix=/home/user/httpd/apache) > > CC="gcc" CFLAGS=" -D_REENTRANT -DTHREADS_HAVE_PIDS > > -fno-strict-aliasing > > -I/usr/local/include" ./configure > > --activate-module=src/modules/perl/libperl.a > > --disable-rule=EXPAT > --prefix=/home/user/httpd/apache > > Configuring for Apache, Version 1.3.27 > > + using installation path layout: Apache , > > (config.layout) > > + activated perl module (modules/perl/libperl.a) > > Creating Makefile > > sed: -e expression #44, char 46: Unknown option to > 's' > > Creating Configuration.apaci in src > > First, you need to figure out where this error is > coming from, sed isn't > very helpful here. Since we are talking about > ./configure errors, you > need to modify apache-1.3/configure to start with: > > #!/bin/sh -x > > (notice the -x) > > now log the build process into a file a look what > happens between two > strings: > Creating Makefile > and > Creating Configuration.apaci in src > > From what I see the error is in apache domain, but > since I don't have > this problem I could be wrong. > > __ > 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 > __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Question on possible effects of mod_perl on mod_cgi
Ugh! I checked the users list archives but I never checked the dev archives. I liked p5p back in the day because it was all one in the same. Chaos, but oddly efficient. Thanks for the pointer. As for the docs, I freely admit I missed it. I was not looking for PerlRun stuff when I went through that migration piece (I was looking for a different project) so when I started dealing with this I did not remember seeing it, therefore in my warped mind it did not exist. Right now, int/0 looks perfectly fine to me. Anyhow, I doubt listing all of them would help, just add in Apache::PerlRun into the header so it reads "The Apache::Registry and Apache::PerlRun Families" (or ~) and that would get people's attention a little bit better. Thanks, Tom Stas Bekman wrote: OK, now it's clear, thanks for the explanation. FWIW, there were discussions of possible pipes read/write deadlocks in the current mod_cgi implementation in Apache 2.0, so you may experience just that. Check the httpd-dev list archives. [...] * Given that, I noticed PerlRun was no longer prominintly displayed in the docs What made you think so? The PerlRun docs weren't touched for ages. and the migration FAQ did not to my knowledge even touch on it. Because all you have to do is to s/Apache::/ModPerl::/ for all registry handlers, which includes PerlRun. Do you think that it'll help to explicitly list them all? __ 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 -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 "The wireless telegraph is not difficult to understand. The ordinary telegraph is like a very long cat. You pull the tail in New York, and it meows in Los Angeles. The wireless is the same, only without the cat." -- Einstein
Re: perl's system() w/ apache under win2k
Here is that doc addition: Why can't my scripts execute external programs with GUI frontends from within Apache/mod_perl when I could under Win9.x? The issue is not an Apache/mod_perl issue per se. Any service that allows execution of external binaries that try to initialize and display GUI components will have problems under OSs like Windows 2K+, Unix, Linux and MacOS X. This would have worked in Win 98 because apps all run in the same user space (under the same user ID). Those resources happened to be, for the most part, linked to almost everything else running on the system. Hence when you ran a gui app from within Apache the system would display the gui part of it on the screen. The OS saw no difference between the web server running in the background and the user's desktop. The best way to deal with this is to see if the application you are trying to run has a /quiet switch or something that will keep it from trying to draw any GUI components/dialog boxes to the screen. If you wrote the application you are trying to execute then you should put a hook into it that will allow that option (obviously adding the code to bypass the gui code) and then execute it with the new option. The best way to execute programs under Perl's system call is to write a console application. If you would like to take output from that application then you should write to STDOUT all text you want the perl application to see as a return value from your system() call or `` (backticks) call. Tom Stas Bekman wrote: Terra Info wrote: I will write up a more publically palatable version of the below and post it for someone more intimately associated with the docs and development to merge into the tree. Great, thank you! Keep in mind that this is an issue not just for MP but also any CGI script or frankly any service that allows execution of external binaries that try to initialize and display GUI components. Although I have not tested it, I would imagine that this would be an issue on a Unix/linix variant as well as the design of the OS is similar to WinNT and up. Or the other way around if you want to follow the timeline correctly ;-}. I believe that Unix users are aware of this issue from the very first steps of using the system and therefore we hardly ever see this kind of questions on this list. Apparently permissions on winNT is something unexpected and new for those who are used to older win32 systems. Moreover, error_log usually tells what the exact problem is when the code is written properly to report errors (e.g., checking the return status of system()). My guess is that this should work on winNT too. If there are similar issues with MacOS X or other platforms, please send the info in, so we will add it to the docs. Though my guess is that MacOS X is based on FreeBSD and therefore all the normal Unix perms concepts apply as is. Correct me if I'm wrong. __ Stas Bekman JAm_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 -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 "The wireless telegraph is not difficult to understand. The ordinary telegraph is like a very long cat. You pull the tail in New York, and it meows in Los Angeles. The wireless is the same, only without the cat." -- Einstein
Re: Question on possible effects of mod_perl on mod_cgi
OK, now it's clear, thanks for the explanation. FWIW, there were discussions of possible pipes read/write deadlocks in the current mod_cgi implementation in Apache 2.0, so you may experience just that. Check the httpd-dev list archives. [...] * Given that, I noticed PerlRun was no longer prominintly displayed in the docs What made you think so? The PerlRun docs weren't touched for ages. and the migration FAQ did not to my knowledge even touch on it. Because all you have to do is to s/Apache::/ModPerl::/ for all registry handlers, which includes PerlRun. Do you think that it'll help to explicitly list them all? __ 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: Question on possible effects of mod_perl on mod_cgi
Stas Bekman wrote: I still don't understand you. When do you see the problem? When you run the script under mod_cgi or mod_perl? I don't understand why do you keep referring to mod_cgi. And we are talking about Apache/mod_perl 2.0 here, right? No. I am talking about mod_cgi when I say mod_cgi. In short you answered my questions with answers I pretty much expected but I wanted my asumptions valiidated. For that I am grateful. Long answer: Let me state why I was looking (ie; the [il]logic to my thinking) to eliminate mod_perl from the list of of possible reasons why a standard CGI would be failing. * It was a perl CGI. * It was failing in ways that were similar, although not directly alike, ways that poorly written perl apps under mod_perl fail. For example, it would hangup, it would bahave oddly like there were variables set that should have been cleared (ie; unscoped globals). * It was a perl CGI. Hence I know that because of the excellent integration of perl into apache (perl in conf files, etc) as a result of mod_perl, I was looking to see if anyone here on mod_perl's list knew of any interactions, etc that could have spilled over into mod_cgi's handling of perl scripts for instance. * Given that, I noticed PerlRun was no longer prominintly displayed in the docs and the migration FAQ did not to my knowledge even touch on it. I was thiking maybe it had become an automatic thing in mod_cgi for mod_perl enabled httpds to try to speed up perl CGI's by using an in-process perl interpretor instead of backticking it. If that was happening I figured someone here would probably know about it. I posted questions to apache's list but it has been slow going getting people knowledgable about mod_cgi to answer. * There was more (il)logic but I think that should be enough to fill in the holes. Thanks, Tom -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 "The wireless telegraph is not difficult to understand. The ordinary telegraph is like a very long cat. You pull the tail in New York, and it meows in Los Angeles. The wireless is the same, only without the cat." -- Einstein
Re: perl's system() w/ apache under win2k
Terra Info wrote: I will write up a more publically palatable version of the below and post it for someone more intimately associated with the docs and development to merge into the tree. Great, thank you! Keep in mind that this is an issue not just for MP but also any CGI script or frankly any service that allows execution of external binaries that try to initialize and display GUI components. Although I have not tested it, I would imagine that this would be an issue on a Unix/linix variant as well as the design of the OS is similar to WinNT and up. Or the other way around if you want to follow the timeline correctly ;-}. I believe that Unix users are aware of this issue from the very first steps of using the system and therefore we hardly ever see this kind of questions on this list. Apparently permissions on winNT is something unexpected and new for those who are used to older win32 systems. Moreover, error_log usually tells what the exact problem is when the code is written properly to report errors (e.g., checking the return status of system()). My guess is that this should work on winNT too. If there are similar issues with MacOS X or other platforms, please send the info in, so we will add it to the docs. Though my guess is that MacOS X is based on FreeBSD and therefore all the normal Unix perms concepts apply as is. Correct me if I'm wrong. __ 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: Question on possible effects of mod_perl on mod_cgi
Terra Info wrote: The threads issue is my bag. I know better but was busy and distracted, hence I just did a reply to all and trimmed out the excess. No prob. the comment was addressed to all subscribers. Anyhow, I think you may have misunderstood my question. Although I have a specific issue at hand, my question was more generic. My questions are more related to the overall design of mod_perl and its effects on the functioning of Apache's other components. Anyhow, in answer to your question, I have not tried it under mod_perl 1 or 2 because this script would never function under them. It is that poorly written. I meant the Apache::PerlRun from mod_perl 1.0. Obviously I wasn't trying to suggest for you to run it as a pure handler ;) Notice that ModPerl::PerlRun and others aren't exactly the same as their 1.0 counterparts. Due to the threading issues, currently 2.0's registry aren't chdir()'ing to the scripts directory. That may change in the future. But this may be unrelated to your problem. So, is there any link between mod_perl (1.99..) and mod_cgi (Apache 2)? No. Does mod_perl in anyway influence or maybe cause PerlRun like caching under mod_cgi? The two has nothing to do with each other. I realize the answers are probably no but I am at my wits end with this bug and am trying to elminate things as causes that normally I would not even think were related. So you have a better handle on why I am asking, I have a script that runs fine from the cmd line under all parameter combinations, runs fine in most situations under CGI but when a few param combinations occur it fails to execute to completion. The odd thing is the place it hangs up is the line before exit;. I added a warn('foo at line nnn') after every line and it warns all they way to the line for exit; but never exists and apache tells me that the script times out. That combined with the fact that the script, when executed on the command line, under a faked up ENV that matches exactly what it gets from httpd runs flawlessly and to completion, seems to suggest something is happening in the in-process handling of the CGI script. Does that problem lie in mod_cgi, perl or in some funky interaction between components? With some of the symptoms I saw I wanted to rule out mod_perl before I went any further. Thanks and I hope this made it more clear what I was looking for and why, I still don't understand you. When do you see the problem? When you run the script under mod_cgi or mod_perl? I don't understand why do you keep referring to mod_cgi. And we are talking about Apache/mod_perl 2.0 here, right? __ 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: perl's system() w/ apache under win2k
I will write up a more publically palatable version of the below and post it for someone more intimately associated with the docs and development to merge into the tree. Keep in mind that this is an issue not just for MP but also any CGI script or frankly any service that allows execution of external binaries that try to initialize and display GUI components. Although I have not tested it, I would imagine that this would be an issue on a Unix/linix variant as well as the design of the OS is similar to WinNT and up. Or the other way around if you want to follow the timeline correctly ;-}. Tom Stas Bekman wrote: Terra Info wrote: Two things: 1) this is not the list for this question. 2) a probable answer anyhow-> If that's a real pitfall and it's doomed to be a recurrent question, can we please document this under win32/? Also, Randy, it seems that there is whole lot of win32 issues which apply to all mod_perl versions (per our faq discussion), so rather than duplicating them in docs/1.0/os/win32 and docs/2.0/os/win32, we should probably have an area for general win32 issues, e.g. docs/general/os/win32 and point to it from both 1.0 and 2.0. The issue is not file permissions (per se) or anything like that. It is the way WinNT and up is built. What you were doing in Win 98 worked because apps all ran in the same user space. Despite logging into a 98 machine you were really executing all programs as the default user and inside that users memory space. That happened to be, for the most part, shared by almost everything else running on the system. Hence when you ran a gui app from within apache the system would display the gui part of it on the screen. Instead of going into how WinNT and up is designed (go over to mikeysoft's site and you may see something there or maybe a MCSE book on Win2K will have the design philosophy in it) let's just skip to the possible fix. Check to see if the user you run apache under is allowed to "interact with the desktop". It should be in the services CPL applet under the entry for that service. Check that and restart the service. This may allow your app to run but I doubt it. Also, keep in mind this is not secure at all and your best bet is to see if the app you are running has a /quiet switch or something that will keep it from trying to paint any dialog boxes. If you wrote that app then you should put a hook into it that will allow that option (obviously adding the code to bypass init'n the gui code) and then execute it with that option. Tom Philip Fibiger wrote: Hello all, I've got a pretty simple perl script that used to run on a windows 98 machine running apache just fine. It would use system() to launch a windows app that has a graphical display to sync a ms-sql database to a mysql one. Anyway, it's been replaced by a new machine running win2k, and I'm having some problems. When I attempt to use system() to execute the program under win2k, the program appears to start (it shows up in the task list) but it never gets past that point. The same thing happens with any program that has a gui. I checked permissions, and I can log in w/ the same account apache uses, and I can execute the program just fine. Is there some permissions issue, or some alternate way of launching the program via perl that i'm not seeing? Thanks! Philip -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 In time-keeping, in trading, in fighting, men counted numbers; and finally, as the habit grew, only numbers counted. Lewis Mumford
Re: Question on possible effects of mod_perl on mod_cgi
The threads issue is my bag. I know better but was busy and distracted, hence I just did a reply to all and trimmed out the excess. Anyhow, I think you may have misunderstood my question. Although I have a specific issue at hand, my question was more generic. My questions are more related to the overall design of mod_perl and its effects on the functioning of Apache's other components. Anyhow, in answer to your question, I have not tried it under mod_perl 1 or 2 because this script would never function under them. It is that poorly written. So, is there any link between mod_perl (1.99..) and mod_cgi (Apache 2)? Does mod_perl in anyway influence or maybe cause PerlRun like caching under mod_cgi? I realize the answers are probably no but I am at my wits end with this bug and am trying to elminate things as causes that normally I would not even think were related. So you have a better handle on why I am asking, I have a script that runs fine from the cmd line under all parameter combinations, runs fine in most situations under CGI but when a few param combinations occur it fails to execute to completion. The odd thing is the place it hangs up is the line before exit;. I added a warn('foo at line nnn') after every line and it warns all they way to the line for exit; but never exists and apache tells me that the script times out. That combined with the fact that the script, when executed on the command line, under a faked up ENV that matches exactly what it gets from httpd runs flawlessly and to completion, seems to suggest something is happening in the in-process handling of the CGI script. Does that problem lie in mod_cgi, perl or in some funky interaction between components? With some of the symptoms I saw I wanted to rule out mod_perl before I went any further. Thanks and I hope this made it more clear what I was looking for and why, Tom Stas Bekman wrote: [When starting a new thread, please remember to create a new mail, rather than doing a reply to one of the threads. If you don't do that, your mail software attaches reference ids to the original thread and your post gets folded into the thread you've replied to. people may delete the whole thread without seeing your post if they weren't interested in this thread. it also has an ill effect on mail archives.] Terra Info wrote: I am debugging a particularly nasty issue right now on a perl script that when written 2+ yrs ago worked fine. NB: It does not run under mod_perl and it has not been modified since then. You mean, it has never worked under mod_perl 1.0? Can you test it with mod_perl 1.0? I run it from the cmd line (with the identical query string and all referenced %ENV vars set identical as well) and it runs fine. I run it as a typical CGI and it has problems that, in *some* ways, mirror the behavior of a poorly written (symptoms associated with unscoped globals, etc;) perl app under mod_perl. And since this is a poorly written app I am curious. Is there any link between mod_perl (1.99..) and mod_cgi (Apache 2)? Does mod_perl in anyway influence or maybe cause PerlRun like caching under mod_cgi? I am just trying to eliminate all possibilities as this one has been a real PITFA. You can turn the debugging on and see whether it gets cached. in ModPerl::RegistryCooker set: use constant DEBUG => 4; restart the server and watch error_log, compare the output of Registry with PerlRun. __ 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 -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 In time-keeping, in trading, in fighting, men counted numbers; and finally, as the habit grew, only numbers counted. Lewis Mumford
Re: sed error in perl Makefile.pl
[...] When I run perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \ DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 \ APACHE_PREFIX=/home/user/httpd/apache I see this (note the sed error) (cd ../apache_1.3.27 && CC="gcc" CFLAGS=" -D_REENTRANT -DTHREADS_HAVE_PIDS -fno- strict-aliasing -I/usr/local/include" ./configure --activate-module=src/modules/ perl/libperl.a --disable-rule=EXPAT --prefix=/home/user/httpd/apache) CC="gcc" CFLAGS=" -D_REENTRANT -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include" ./configure --activate-module=src/modules/perl/libperl.a --disable-rule=EXPAT --prefix=/home/user/httpd/apache Configuring for Apache, Version 1.3.27 + using installation path layout: Apache , (config.layout) + activated perl module (modules/perl/libperl.a) Creating Makefile sed: -e expression #44, char 46: Unknown option to 's' Creating Configuration.apaci in src First, you need to figure out where this error is coming from, sed isn't very helpful here. Since we are talking about ./configure errors, you need to modify apache-1.3/configure to start with: #!/bin/sh -x (notice the -x) now log the build process into a file a look what happens between two strings: Creating Makefile and Creating Configuration.apaci in src From what I see the error is in apache domain, but since I don't have this problem I could be wrong. __ 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: perl's system() w/ apache under win2k
Terra Info wrote: Two things: 1) this is not the list for this question. 2) a probable answer anyhow-> If that's a real pitfall and it's doomed to be a recurrent question, can we please document this under win32/? Also, Randy, it seems that there is whole lot of win32 issues which apply to all mod_perl versions (per our faq discussion), so rather than duplicating them in docs/1.0/os/win32 and docs/2.0/os/win32, we should probably have an area for general win32 issues, e.g. docs/general/os/win32 and point to it from both 1.0 and 2.0. The issue is not file permissions (per se) or anything like that. It is the way WinNT and up is built. What you were doing in Win 98 worked because apps all ran in the same user space. Despite logging into a 98 machine you were really executing all programs as the default user and inside that users memory space. That happened to be, for the most part, shared by almost everything else running on the system. Hence when you ran a gui app from within apache the system would display the gui part of it on the screen. Instead of going into how WinNT and up is designed (go over to mikeysoft's site and you may see something there or maybe a MCSE book on Win2K will have the design philosophy in it) let's just skip to the possible fix. Check to see if the user you run apache under is allowed to "interact with the desktop". It should be in the services CPL applet under the entry for that service. Check that and restart the service. This may allow your app to run but I doubt it. Also, keep in mind this is not secure at all and your best bet is to see if the app you are running has a /quiet switch or something that will keep it from trying to paint any dialog boxes. If you wrote that app then you should put a hook into it that will allow that option (obviously adding the code to bypass init'n the gui code) and then execute it with that option. Tom Philip Fibiger wrote: Hello all, I've got a pretty simple perl script that used to run on a windows 98 machine running apache just fine. It would use system() to launch a windows app that has a graphical display to sync a ms-sql database to a mysql one. Anyway, it's been replaced by a new machine running win2k, and I'm having some problems. When I attempt to use system() to execute the program under win2k, the program appears to start (it shows up in the task list) but it never gets past that point. The same thing happens with any program that has a gui. I checked permissions, and I can log in w/ the same account apache uses, and I can execute the program just fine. Is there some permissions issue, or some alternate way of launching the program via perl that i'm not seeing? Thanks! Philip -- __ 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: Question on possible effects of mod_perl on mod_cgi
[When starting a new thread, please remember to create a new mail, rather than doing a reply to one of the threads. If you don't do that, your mail software attaches reference ids to the original thread and your post gets folded into the thread you've replied to. people may delete the whole thread without seeing your post if they weren't interested in this thread. it also has an ill effect on mail archives.] Terra Info wrote: I am debugging a particularly nasty issue right now on a perl script that when written 2+ yrs ago worked fine. NB: It does not run under mod_perl and it has not been modified since then. You mean, it has never worked under mod_perl 1.0? Can you test it with mod_perl 1.0? I run it from the cmd line (with the identical query string and all referenced %ENV vars set identical as well) and it runs fine. I run it as a typical CGI and it has problems that, in *some* ways, mirror the behavior of a poorly written (symptoms associated with unscoped globals, etc;) perl app under mod_perl. And since this is a poorly written app I am curious. Is there any link between mod_perl (1.99..) and mod_cgi (Apache 2)? Does mod_perl in anyway influence or maybe cause PerlRun like caching under mod_cgi? I am just trying to eliminate all possibilities as this one has been a real PITFA. You can turn the debugging on and see whether it gets cached. in ModPerl::RegistryCooker set: use constant DEBUG => 4; restart the server and watch error_log, compare the output of Registry with PerlRun. __ 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
Question on possible effects of mod_perl on mod_cgi
I am debugging a particularly nasty issue right now on a perl script that when written 2+ yrs ago worked fine. NB: It does not run under mod_perl and it has not been modified since then. I run it from the cmd line (with the identical query string and all referenced %ENV vars set identical as well) and it runs fine. I run it as a typical CGI and it has problems that, in *some* ways, mirror the behavior of a poorly written (symptoms associated with unscoped globals, etc;) perl app under mod_perl. And since this is a poorly written app I am curious. Is there any link between mod_perl (1.99..) and mod_cgi (Apache 2)? Does mod_perl in anyway influence or maybe cause PerlRun like caching under mod_cgi? I am just trying to eliminate all possibilities as this one has been a real PITFA. Thanks, Tom
Ports to unusual arches
Let's see. A Debian package can't go from unstable to testing until it passes certain tests on all of the following arches... i386 m68k sparc alpha powerpc arm mips and mipsel hppa ia64 s390 (see http://www.debian.org/ports) I was thinking it might help me to get a box with one of these arches, to help make the mod_perl stable packages as current as possible. Currently "testing" has mod_perl 1.26 So, which arch is the most broke? And/or which arch is only slightly broke, but has the least help available for testing? thx. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
RE: [OT] Redirect POST to POST off-site?
(sorry about the blank reply a minute ago) > I am looking into the more advanced paypal instant notification > stuff for the next version of my sw, but version one is using a > simpler approach to get it out the door. Even that paypal sw > wouldn't solve my problem, which is to make sure that the POST to > paypal actually matches the transaction that the user has built up. I found IPN to be *very* simple to use, logging the notifications to a DB and then acting as required. I would even be happy to send you my notification script, which uses Apache::Registry but is really just a simple POST BACK to paypal and when the response is 'OK', take the appropriate action (payment received, account terminated, etc) (but please reply privately if you want it). The only nits I experienced were A) forgetting to send back the "OK\r\n" to paypal that they expect to see from a successful notify. They called me and wondered if my script was broken... B) having to set up a unique index on my logging table on the "verify_sign" field, because in spite of the correct response chain, paypal has a tendency to notify repeatedly and redundantly. HTH! L8r, Rob
Re: perl's system() w/ apache under win2k
Two things: 1) this is not the list for this question. 2) a probable answer anyhow-> The issue is not file permissions (per se) or anything like that. It is the way WinNT and up is built. What you were doing in Win 98 worked because apps all ran in the same user space. Despite logging into a 98 machine you were really executing all programs as the default user and inside that users memory space. That happened to be, for the most part, shared by almost everything else running on the system. Hence when you ran a gui app from within apache the system would display the gui part of it on the screen. Instead of going into how WinNT and up is designed (go over to mikeysoft's site and you may see something there or maybe a MCSE book on Win2K will have the design philosophy in it) let's just skip to the possible fix. Check to see if the user you run apache under is allowed to "interact with the desktop". It should be in the services CPL applet under the entry for that service. Check that and restart the service. This may allow your app to run but I doubt it. Also, keep in mind this is not secure at all and your best bet is to see if the app you are running has a /quiet switch or something that will keep it from trying to paint any dialog boxes. If you wrote that app then you should put a hook into it that will allow that option (obviously adding the code to bypass init'n the gui code) and then execute it with that option. Tom Philip Fibiger wrote: Hello all, I've got a pretty simple perl script that used to run on a windows 98 machine running apache just fine. It would use system() to launch a windows app that has a graphical display to sync a ms-sql database to a mysql one. Anyway, it's been replaced by a new machine running win2k, and I'm having some problems. When I attempt to use system() to execute the program under win2k, the program appears to start (it shows up in the task list) but it never gets past that point. The same thing happens with any program that has a gui. I checked permissions, and I can log in w/ the same account apache uses, and I can execute the program just fine. Is there some permissions issue, or some alternate way of launching the program via perl that i'm not seeing? Thanks! Philip -- - Terra Novum Research [EMAIL PROTECTED] www.terranovum.com (617) 923-4132 PO Box 362 Watertown, MA 02471-0362 Nothing's so cold as closing the heart when all we need is to free the soul, but we wouldn't be that brave I know. - Glenn Philips
perl's system() w/ apache under win2k
Hello all, I've got a pretty simple perl script that used to run on a windows 98 machine running apache just fine. It would use system() to launch a windows app that has a graphical display to sync a ms-sql database to a mysql one. Anyway, it's been replaced by a new machine running win2k, and I'm having some problems. When I attempt to use system() to execute the program under win2k, the program appears to start (it shows up in the task list) but it never gets past that point. The same thing happens with any program that has a gui. I checked permissions, and I can log in w/ the same account apache uses, and I can execute the program just fine. Is there some permissions issue, or some alternate way of launching the program via perl that i'm not seeing? Thanks! Philip
sed error in perl Makefile.pl
Hi mod_perlers from josh narins! I'm following the simple instructions for the 1.x series with APACI I'm on a debian "sarge" system running linux kernel 2.4.20 on a powerpc I've seen this same error with bleadperl (built today) and the installed perl5.6.1 (the debian package) Sadly, I also remember seeing this error on my i386 debian woody 2.4.18 machine, but at some point I overcame it. Since I can't remember what I did last time... :( When I run perl Makefile.PL APACHE_SRC=../apache_1.3.xx/src \ DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 \ APACHE_PREFIX=/home/user/httpd/apache I see this (note the sed error) (cd ../apache_1.3.27 && CC="gcc" CFLAGS=" -D_REENTRANT -DTHREADS_HAVE_PIDS -fno- strict-aliasing -I/usr/local/include" ./configure --activate-module=src/modules/ perl/libperl.a --disable-rule=EXPAT --prefix=/home/user/httpd/apache) CC="gcc" CFLAGS=" -D_REENTRANT -DTHREADS_HAVE_PIDS -fno-strict-aliasing -I/usr/local/include" ./configure --activate-module=src/modules/perl/libperl.a --disable-rule=EXPAT --prefix=/home/user/httpd/apache Configuring for Apache, Version 1.3.27 + using installation path layout: Apache , (config.layout) + activated perl module (modules/perl/libperl.a) Creating Makefile sed: -e expression #44, char 46: Unknown option to 's' Creating Configuration.apaci in src + id: mod_perl/1.27 + id: Perl/v5.9.0 (linux) [/home/user/bin/perl] This is my perl -V (NOTE: Happens with vanilla perl5.6.1 debian package the same way) Summary of my perl5 (revision 5.0 version 9 subversion 0 patch 18378) configurat ion: Platform: osname=linux, osvers=2.4.20-ben1, archname=ppc-linux-thread-multi uname='linux float1 2.4.20-ben1 #1 tue dec 31 18:50:09 est 2002 ppc 7455, al tivec supported gnulinux ' config_args='-Dusedevel -Dcc=gcc -Dprefix=/home/user -Uinstallusrbinperl -Uu selargefiles -Dusethreads -des' hint=recommended, useposix=true, d_sigaction=define usethreads=define useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-stri ct-aliasing -I/usr/local/include', optimize='-O3', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasin g -I/usr/local/include' ccversion='', gccversion='2.95.4 20011002 (Debian 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 =4 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil -lrt perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil -lrt libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_ CONTEXT Locally applied patches: DEVEL18374 Built under linux Compiled at Jan 1 2003 17:28:16 @INC: /home/user/lib/perl5/5.9.0/ppc-linux-thread-multi /home/user/lib/perl5/5.9.0 /home/user/lib/perl5/site_perl/5.9.0/ppc-linux-thread-multi /home/user/lib/perl5/site_perl/5.9.0 /home/user/lib/perl5/site_perl . - __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Re: Database Pooling
> Sounds like you should have some more code in your finally > blocks. :) Well I don't quite like having to do that everywhere, especially in code I did not write. In Perl I only need one of them using some AUTOLOAD trickery :-). -- Dominique QUATRAVAUX Ingénieur développeur senior 01 44 42 00 35 IDEALX
Re: Apache::DBI
On Thu, 2 Jan 2003, Paul Simon wrote: > Hi all > > I have a feeling this may be [OT], "take it to the DBI > list..." But I'm hoping to eliminate as much as > possible any suspicion that Apache::DBI/mod_perl is > causing my headache. I'm trying to push this platform > at work ;) If anyone can shed some light on this then > I'd be very appreciative, of course. > > I have what's becoming a reoccuring problem with an > app running under: > > Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0 > > > I'm using Apache::compat and Apache::DBI for > persistent database connections. [ ... ] > > For completeness sake, here's the connection string: > my $DBH = DBI->connect("DBI:ODBC:$db", $user, $pass, > { RaiseError => 1, PrintError => 1, AutoCommit => 1 }) > or print( "Unable to connect to Database: > $DBI::errstr\n" ) ; > > Finally, the error message I'm getting is: > > DBI->connect(pdb9) failed: > [Oracle][ODBC][Ora]ORA-12535: TNS:operation timed out > (SQL-S1000)(DBD: db_login/SQLConnect err=-1) at > /Apache2/lib/perl/Apache/Standard3.pm line 29 > > This problem goes away if the ORacle server(on it's > own hardware running windows 2000 pro) is restarted. > The last time this happened the box Oracle resides on > needed a cold reboot! So far, I haven't had to restart > apache. > > Could Apache::DBI or mod_perl2 cause this behavior? When you say the problem goes away, does this mean that things work fine after the restart of the Oracle server? Or do you periodically have to do this restart? Are you using the latest versions of DBI and DBD::ODBC? If not, does an upgrade help? -- best regards, randy kobes
Re: Database Pooling
Sure. And beware of connections that are returned to the pool without being rollbacked, too - the app then deadlocks itself because it holds locks in the database and doesn't know it does. I get bitten by this under JDBC every so often, when an exception is thrown at the wrong time. Sounds like you should have some more code in your finally blocks. :) KS
RE: Apache::DBI
Hi Paul - It is my understanding that Apache::DBI is not yet implemented for Apache2/mod_perl2. I had to comment out my references to it in the startup script and/or the configuration file. Take a look at: http://beaucox.com/mason/mason-with-apmp2-mini-HOWTO.htm for further info. Aloha => Beau. -Original Message- From: Paul Simon [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 02, 2003 3:00 AM To: [EMAIL PROTECTED] Subject: Apache::DBI Hi all I have a feeling this may be [OT], "take it to the DBI list..." But I'm hoping to eliminate as much as possible any suspicion that Apache::DBI/mod_perl is causing my headache. I'm trying to push this platform at work ;) If anyone can shed some light on this then I'd be very appreciative, of course. I have what's becoming a reoccuring problem with an app running under: Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0 I'm using Apache::compat and Apache::DBI for persistent database connections. Here are the configurations in the httpd.conf file: # LoadFile "C:/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so PerlOptions +Parent PerlInterpStart 10 PerlInterpMax 50 PerlInterpMaxSpare 25 PerlRequire "C:/Apache2pl/conf/startup.pl" #- The startup.pl looks like this: #- #!C:/Perl/bin/Perl.exe use Apache2(); use lib('/Apache2pl/lib/perl/Apache'); use ModPerl::Registry(); use Apache::compat; use Apache::DBI; use DBI; use DBD::ODBC; use HTML::Template; use CGI::Lite; #$Apache::DBI::DEBUG = 2; use Standard3; 1; #- For completeness sake, here's the connection string: my $DBH = DBI->connect("DBI:ODBC:$db", $user, $pass, { RaiseError => 1, PrintError => 1, AutoCommit => 1 }) or print( "Unable to connect to Database: $DBI::errstr\n" ) ; Finally, the error message I'm getting is: DBI->connect(pdb9) failed: [Oracle][ODBC][Ora]ORA-12535: TNS:operation timed out (SQL-S1000)(DBD: db_login/SQLConnect err=-1) at /Apache2/lib/perl/Apache/Standard3.pm line 29 This problem goes away if the ORacle server(on it's own hardware running windows 2000 pro) is restarted. The last time this happened the box Oracle resides on needed a cold reboot! So far, I haven't had to restart apache. Could Apache::DBI or mod_perl2 cause this behavior? Paul
Apache::DBI
Hi all I have a feeling this may be [OT], "take it to the DBI list..." But I'm hoping to eliminate as much as possible any suspicion that Apache::DBI/mod_perl is causing my headache. I'm trying to push this platform at work ;) If anyone can shed some light on this then I'd be very appreciative, of course. I have what's becoming a reoccuring problem with an app running under: Apache/2.0.42 (Win32) mod_perl/1.99_08-dev Perl/v5.8.0 I'm using Apache::compat and Apache::DBI for persistent database connections. Here are the configurations in the httpd.conf file: # LoadFile "C:/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so PerlOptions +Parent PerlInterpStart 10 PerlInterpMax 50 PerlInterpMaxSpare 25 PerlRequire "C:/Apache2pl/conf/startup.pl" #- The startup.pl looks like this: #- #!C:/Perl/bin/Perl.exe use Apache2(); use lib('/Apache2pl/lib/perl/Apache'); use ModPerl::Registry(); use Apache::compat; use Apache::DBI; use DBI; use DBD::ODBC; use HTML::Template; use CGI::Lite; #$Apache::DBI::DEBUG = 2; use Standard3; 1; #- For completeness sake, here's the connection string: my $DBH = DBI->connect("DBI:ODBC:$db", $user, $pass, { RaiseError => 1, PrintError => 1, AutoCommit => 1 }) or print( "Unable to connect to Database: $DBI::errstr\n" ) ; Finally, the error message I'm getting is: DBI->connect(pdb9) failed: [Oracle][ODBC][Ora]ORA-12535: TNS:operation timed out (SQL-S1000)(DBD: db_login/SQLConnect err=-1) at /Apache2/lib/perl/Apache/Standard3.pm line 29 This problem goes away if the ORacle server(on it's own hardware running windows 2000 pro) is restarted. The last time this happened the box Oracle resides on needed a cold reboot! So far, I haven't had to restart apache. Could Apache::DBI or mod_perl2 cause this behavior? Paul
Re: Database Pooling
> > Well, it's going to be a pretty strange environment that doesn't have a > database connection in every process. Sure. And beware of connections that are returned to the pool without being rollbacked, too - the app then deadlocks itself because it holds locks in the database and doesn't know it does. I get bitten by this under JDBC every so often, when an exception is thrown at the wrong time. >From the app perspective, I tend to prefer viewing database connections as singletons rather than pooled objects. This avoids lots of problems like the two above, and enables fancy extensions. For example I can simulate nested transactions even on databases that do not support them: I can say "If a transaction is open in the (unique) database connection we have, don't start a new one and just up the (app-internal) nesting counter". -- Dominique QUATRAVAUX Ingénieur développeur senior 01 44 42 00 35 IDEALX