Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 03:35, Dennis G. Allard wrote: (BTW, my more general goal is to have shared memory across multiple Apache threads as part of implementing sessions so that I can avoid doing a database write at every HTTP request just to save session IDs.) Hmmm, save session IDs? Why aren't you just putting those in a cookie or in the URLs? If you meant to say session data rather than IDs, there are several good ways to do this, and IPC::ShareLite isn't one of them. It's too slow. If this is for a single machine, try either IPC::MM or MLDBM::Sync. If it's for a cluster, it's pretty hard to beat MySQL. - Perrin
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 15:55, Dennis G. Allard wrote: MySQL ShmySQL. A database that didn't have transactions until last year and still has no stored procedures Uh, we're talking about session data here, right? Basically a remotely accessible hash? Stored procedures have no place there, and transactions don't have much of one either, as evidenced by the fact that many people simply use files for their session storage. With a simple table (probably just ID, DATA, and TIMESTAMP) and simple insert/update/select operations, MySQL pretty much blows everything else away. That's why I recommend it for this use. If you already have another database, that's fine too. If your OS has good NFS or SMB available, you can use MLDBM::Sync over that. You have to be certain that locking is well-supported on your OS though, and I doubt it will be faster than MySQL. BTW, I wanted to use Apache::Session or CGI::Session but had some problems with each, possibly related to my newness with Apache 2/mod_perl 2/compat/whatever. I haven't used either on mod_perl 2, but there's no reason why they shouldn't work. Neither of them makes any use of mod_perl or the Apache API. If you post more information about the problems, we may be able to fix them. So, I've decide to implement my own sessions for now, just for the hell of it, while I wait for Apache 2 dust to settle or land a project where I am forced to decipher the possibilities better. You could also simply use mod_perl 1. It is still actively maintained and remains a good choice for new development. - Perrin
Re: How tell what version of mod_perl is installed?
Hmmm. No one has actually answered the question, although I am getting all kinds of advice... (-; ... On Thu, 2003-06-05 at 01:42, Stas Bekman wrote: Thomas Klausner wrote: Hi! On Don, Jun 05, 2003 at 12:35:37 -0700, Dennis G. Allard wrote: I am running Red Hat 8.0, Apache/2.0.40. AFAIK, mod_perl 1.x won't run with Apache 2.0, so I'm quite sure you're running mod_perl 2 (which comes shipped with Red Hat 8) But Dennis, you don't want the version that comes with RH8, it's 1 year old! get 1.99_09 from here: http://perl.apache.org/download/index.html Thanks for that information, Stas. I'll take that to mean 'yes', I do have mod_perl 2.0 (although, per my previous post of my `strings /usr/lib/httpd/modules/mod_perl.so` output, my version is (I guess) 1.99_05-dev, which, you have to admit, does not look like '2.0'. Please note, though, one of my goals in life is to rely on my software providers to do the work of providing me with a stable, tested, updatable OS and associated tools. If I download 'out of band' updates, then I can no longer rely on Red Hat's network update tool, for example. With all due respect for your fine work, which is awesome, there are application developers such as myself out there who simply don't have time to track the bleeding edge except when absolutely forced to do so (which sometimes does happen). My heuristic is that I intentionally stay behind the curve. I don't use Oracle 9 yet, for example. My current need for mod_perl 2.0 is not critical, so I will give it another year or so before I dig in and make the (substantial) effort of coverting entirely to it. to check the version you can do: /home/stas perl-blead -Mmod_perl -le 'print mod_perl-VERSION' 1.2701 /home/stas perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION' 1.9910 As you can see, I have both. 1.9910 is mod_perl-2.0-tobe (but currently only 1.9909 is available, 1.9910 is a cvs version). Bummer, I don't have perl-blead and there are only 17 references to it in the entire history of Dejanews, none that seem to point to a download... [EMAIL PROTECTED] httpd]# perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION' bash: perl-blead: command not found [EMAIL PROTECTED] httpd]# [EMAIL PROTECTED] httpd]# whereis perl-blead perl-blead: [EMAIL PROTECTED] httpd]# locate perl-blead I could take time to find/download perl-blead, but hey, gotta go earn some money! (-; Outta here for now. __ 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 -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com
Re: How tell what version of mod_perl is installed?
Hi! On Thu, Jun 05, 2003 at 01:37:59PM -0700, Dennis G. Allard wrote: Please note, though, one of my goals in life is to rely on my software providers to do the work of providing me with a stable, tested, updatable OS and associated tools. If I download 'out of band' updates, then I can no longer rely on Red Hat's network update tool, for example. With all due respect for your fine work, which is awesome, there are application developers such as myself out there who simply don't have time to track the bleeding edge except when absolutely forced to do so (which sometimes does happen). The latest Red Hat comes with Apache 2 (because Apache 2 is quite stable). Unfortunatly mod_perl 2.0 is /not/ that finished (Sorry Stas..). But because Red Hat wants to provide mod_perl to its Users, they included the Beta Version in their distro. So blame them ... /home/stas perl-blead -Mmod_perl -le 'print mod_perl-VERSION' 1.2701 /home/stas perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION' 1.9910 Bummer, I don't have perl-blead and there are only 17 references to it in the entire history of Dejanews, none that seem to point to a download... You don't need perl-blead (which is probably Stas' install of the latest unstable Perl version) This will do the same job: % perl -Mmod-perl -le 'print mod_perl-VERSION' -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 13:08, Perrin Harkins wrote: On Thu, 2003-06-05 at 15:55, Dennis G. Allard wrote: MySQL ShmySQL. A database that didn't have transactions until last year and still has no stored procedures Uh, we're talking about session data here, right? Basically ... My point about MySQL was a general comment for why I did not use it (in the past), not just about sessions. Your suggestions for tools to implement sessions are all sound. Cheers, Dennis -- Dennis G. Allard [EMAIL PROTECTED] http://oceanpark.com
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 13:37, Thomas Klausner wrote: Hi! On Thu, Jun 05, 2003 at 01:37:59PM -0700, Dennis G. Allard wrote: [In reply to Stas] Please note, though, one of my goals in life is to rely on my software providers to do the work of providing me with a stable, tested, updatable OS and associated tools. If I download 'out of band' updates, then I can no longer rely on Red Hat's network update tool, for example. With all due respect for your fine work, which is awesome, there are application developers such as myself out there who simply don't have time to track the bleeding edge except when absolutely forced to do so (which sometimes does happen). The latest Red Hat comes with Apache 2 (because Apache 2 is quite stable). Unfortunatly mod_perl 2.0 is /not/ that finished (Sorry Stas..). But because Red Hat wants to provide mod_perl to its Users, they included the Beta Version in their distro. And once mod_perl 2.0 become stable, Red Hat will ship it, and those having my philosophy will begin developing with it! So blame them ... No blame needed. Everyone is doing a good job as fast as they can. /home/stas perl-blead -Mmod_perl -le 'print mod_perl-VERSION' 1.2701 /home/stas perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION' 1.9910 Bummer, I don't have perl-blead and there are only 17 references to it in the entire history of Dejanews, none that seem to point to a download... You don't need perl-blead (which is probably Stas' install of the latest unstable Perl version) This will do the same job: % perl -Mmod-perl -le 'print mod_perl-VERSION' Bummmer, that does not work either for me on Red Hat 8.0: [EMAIL PROTECTED] httpd]# perl -Mmod-perl -le 'print mod_perl-VERSION' Can't locate mod.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .). BEGIN failed--compilation aborted. I'm new to this list. Thanks for everyone's advice. -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com
Re: How tell what version of mod_perl is installed?
Hi! On Thu, Jun 05, 2003 at 01:56:58PM -0700, Dennis G. Allard wrote: You don't need perl-blead (which is probably Stas' install of the latest unstable Perl version) This will do the same job: % perl -Mmod-perl -le 'print mod_perl-VERSION' Bummmer, that does not work either for me on Red Hat 8.0: Sorry, typo: it should say -Mmod_perl instead of -Mmod-perl, i.e.: % perl -Mmod_perl -le 'print mod_perl-VERSION' -- #!/usr/bin/perl http://domm.zsi.at for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 16:37, Dennis G. Allard wrote: Hmmm. No one has actually answered the question, although I am getting all kinds of advice... (-; ... Thomas Klausner said that mod_perl 2 only runs on apache 2 and mod_perl 1 only runs on apache 1. He is correct. Red Hat gave you an early version of mod_perl 2 because they gave you apache 2. I'll take that to mean 'yes', I do have mod_perl 2.0 (although, per my previous post of my `strings /usr/lib/httpd/modules/mod_perl.so` output, my version is (I guess) 1.99_05-dev, which, you have to admit, does not look like '2.0'. The 2.x branch has not reached an official release yet. It is still basically considered beta. When it is officially released, it will be 2.0. Please note, though, one of my goals in life is to rely on my software providers to do the work of providing me with a stable, tested, updatable OS and associated tools. If I download 'out of band' updates, then I can no longer rely on Red Hat's network update tool, for example. If you want to use bleeding edge software, you do have to keep up. My heuristic is that I intentionally stay behind the curve. In that case, you should use apache 1 and mod_perl 1. My current need for mod_perl 2.0 is not critical, so I will give it another year or so before I dig in and make the (substantial) effort of coverting entirely to it. Most of us find that it's pretty easy to convert to mod_perl 1, provided you have clean Perl code to begin with. Bummer, I don't have perl-blead Bleedperl (aka perl-blead) is the name for the unreleased development version of Perl. You don't need it. - Perrin
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 13:53, Thomas Klausner wrote: Sorry, typo: it should say -Mmod_perl instead of -Mmod-perl, i.e.: % perl -Mmod_perl -le 'print mod_perl-VERSION' THANKS! (I should have caught that one myself, for crying out loud). For the sake of completeness: [EMAIL PROTECTED] root]# uname -a Linux oceanpark.com 2.4.20-18.8 #1 Thu May 29 07:20:39 EDT 2003 i686 athlon i386 GNU/Linux [EMAIL PROTECTED] root]# cat /etc/issue Red Hat Linux release 8.0 (Psyche) Kernel \r on an \m [EMAIL PROTECTED] root]# perl -Mmod_perl -le 'print mod_perl-VERSION' 1.9905 Cheers, Dennis -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com
Re: How tell what version of mod_perl is installed?
Hi there, On 5 Jun 2003, Dennis G. Allard wrote: Hmmm. No one has actually answered the question, although I am getting all kinds of advice... (-; ... It's been good advice. If the question to which you refer is the one in the subject line, then one answer is look in the error log. Apache tells you when it starts. It's generally about the first thing it says. Your error log is defined in your Apache configuration file (probably httpd.conf) in a line that starts ErrorLog You could also take a look at http://perl.apache.org/docs/2.0/user/intro/start_fast.html which has an example of the output in the error log from a server when it's started. If your question isn't the one in the subject line, please accept my apologies - I haven't been following this thread closely. Feel free to ask it again if it hasn't yet been answered. There's more FM to R if you work with Apache/mod_perl 1.x - if you're going to be doing a lot of work for a commercial application and you don't want to be involved in the mod_perl 2.x development, and you're going to want lots more people around to hold your hand, then that's what I'd recommend. There are good books too. Buy them. Read them. You're an exceptional individual if you can absorb it all the first time through, so read them again. Oh, heck. More advice. 73, Ged.
Re: How tell what version of mod_perl is installed?
On Thu, 2003-06-05 at 14:13, Ged Haywood wrote: ... If the question to which you refer is the one in the subject line, then one answer is look in the error log. Apache tells you when it starts. It's generally about the first thing it says. Your error log is defined in your Apache configuration file (probably httpd.conf) in a line that starts ErrorLog I know about that file. However, in my case (~stock Red Hat 8.0 Apache 2.0.40), my error log (/var/log/httpd/error_log) shows: [Thu Jun 05 02:54:44 2003] [notice] Apache/2.0.40 (Red Hat Linux) configured -- resuming normal operations I spent some time scrounging the Apache Web site and can't find any documentation on how to show what DSOs (Dynamic Shared Objects, aka Apache modules) are loaded. Google groups shows some other people having this question. For Apache 1.0, one can inspect the httpd.conf for LoadModule directives. For Apache 2.0 in Red Hat, one can do that but, also, for modules that are packaged as separate RPMs, one must examine /etc/httpd/conf.d/*. Such techniques do not constitute a documented API for finding that information, but are better than nothing. See: http://oceanpark.com/notes/howto_redhat8-apache2-mod_perl.html You can find out what modules are statically linked with your Apache image by doing, for example: [EMAIL PROTECTED] httpd]# httpd -l Compiled in modules: core.c prefork.c http_core.c mod_so.c apachetcl -l will also do that. But I don't have mod_perl statically linked. It is loaded by my /etc/httpd/conf.d/perl.conf file. You could also take a look at http://perl.apache.org/docs/2.0/user/intro/start_fast.html which has an example of the output in the error log from a server when it's started. But no documentation as to why or how that line is generated nor what it means. If your question isn't the one in the subject line, please accept my apologies - I haven't been following this thread closely. Feel free to ask it again if it hasn't yet been answered. It was in some earlier responses: [EMAIL PROTECTED] root]# perl -Mmod_perl -le 'print mod_perl-VERSION' 1.9905 There's more FM to R if you work with Apache/mod_perl 1.x - if you're going to be doing a lot of work for a commercial application and you don't want to be involved in the mod_perl 2.x development, and you're going to want lots more people around to hold your hand, then that's what I'd recommend. There are good books too. Buy them. Read them. You're an exceptional individual if you can absorb it all the first time through, so read them again. One of the best books I've ever read in my tenure doing software development is the excellent one by Lincoln Stein and Doug MacEachern, Writing Apache Modules with Perl and C. First thing I read back in 1999 when I started using mod_perl. I eagerly await an update that covers Apache 2.0 and mod_perl 2.0. Oh, heck. More advice. 73, Ged. All well founded advice is appreciated. Cheers, Dennis -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com
How tell what version of mod_perl is installed?
I ran into some problems trying to get a Perl CGI script to make use of IPC::Sharelite, so I want to understand the Apache and mod_perl threading model in order to be able to use shared memory across multiple Apache threads. For starters, I better make sure I learn more about mod_perl 2.0, as in, do I even have it on my system yet! I am running Red Hat 8.0, Apache/2.0.40. How do I tell if mod_perl 1.0 or mod_perl 2.0 is installed (or, at least, that the .so is the .so for mod_perl 2.0)? Some facts about my system that may help answer this question are provided below... [EMAIL PROTECTED] root]# httpd -V Server version: Apache/2.0.40 Server built: May 22 2003 05:19:58 Server's Module Magic Number: 20020628:0 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR=server/mpm/prefork -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT=/etc/httpd -D SUEXEC_BIN=/usr/sbin/suexec -D DEFAULT_PIDLOG=logs/httpd.pid -D DEFAULT_SCOREBOARD=logs/apache_runtime_status -D DEFAULT_LOCKFILE=logs/accept.lock -D DEFAULT_ERRORLOG=logs/error_log -D AP_TYPES_CONFIG_FILE=conf/mime.types -D SERVER_CONFIG_FILE=conf/httpd.conf [EMAIL PROTECTED] root]# strings /usr/lib/httpd/modules/mod_perl.so ... mod_perl/1.99_05-dev ... [EMAIL PROTECTED] root]# cat /etc/httpd/conf.d/perl.conf LoadModule perl_module modules/mod_perl.so # This will allow execution of mod_perl to compile your scripts to # subroutines which it will execute directly, avoiding the costly # compile process for most requests. # #Alias /perl /var/www/perl #Directory /var/www/perl # #dga- Here's my best guess at config so far: # Alias /perl /home/httpd/perl Directory /home/httpd/perl SetHandler perl-script PerlHandler ModPerl::Registry::handler PerlOptions +ParseHeaders Options +ExecCGI /Directory [EMAIL PROTECTED] root]# [EMAIL PROTECTED] root]# cat /home/httpd/perl/startup.pl #!/usr/bin/perl use Apache::compat (); 1; Thanks for any tips and help anyone might provide. (BTW, my more general goal is to have shared memory across multiple Apache threads as part of implementing sessions so that I can avoid doing a database write at every HTTP request just to save session IDs.) Cheers, Dennis -- Dennis G. Allard telephone: 1.310.399.4740 Ocean Park Software http://oceanpark.com
Re: How tell what version of mod_perl is installed?
Thomas Klausner wrote: Hi! On Don, Jun 05, 2003 at 12:35:37 -0700, Dennis G. Allard wrote: I am running Red Hat 8.0, Apache/2.0.40. AFAIK, mod_perl 1.x won't run with Apache 2.0, so I'm quite sure you're running mod_perl 2 (which comes shipped with Red Hat 8) But Dennis, you don't want the version that comes with RH8, it's 1 year old! get 1.99_09 from here: http://perl.apache.org/download/index.html to check the version you can do: /home/stas perl-blead -Mmod_perl -le 'print mod_perl-VERSION' 1.2701 /home/stas perl-blead -MApache2 -Mmod_perl -le 'print mod_perl-VERSION' 1.9910 As you can see, I have both. 1.9910 is mod_perl-2.0-tobe (but currently only 1.9909 is available, 1.9910 is a cvs version). __ 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