best way to configure for multiple developers?
Hi I have read through the lists looking for issues related to mp2 and @INC, and have read the part about +Parent and virtual hosts. What about the following scenario? One apache2 server w/ mp2 (no virtual hosts) and several perl coders using the server as a development site. Is there a best way to configure the apache/mp2 setup so that there doesn't have to be constant additions to startup.pl to adjust the INC path? What about name space conflicts? For example, I want developer1 to use /dev1, and developer2 /dev2. I want each developer to be able to build functions below there directories in as many subdirectories as projects they have going on. I don't want developer1's functions.pm code to interfere with developer2's functions.pm. Is such an arrangement even possible under mp2? I've been using Apache1/mp1 and this works fine, but all my tests with mp2 end up giving me ModPerl::Registry: Can't locate FUNC.pm in @INC (@INC contains: /usr...) types of errors. And for identically named files (e.g. functions.pm above), I get the subroutines from the first listed functions.pm in the @INC path, which are the wrong ones being called for. Can anyone push me in the write direction? Thanks for any help BCT
Re: best way to configure for multiple developers?
Brian C. Thomas wrote: I have read through the lists looking for issues related to mp2 and @INC, and have read the part about +Parent and virtual hosts. You should read the docs for tips on this, especially here: http://perl.apache.org/docs/general/control/control.html#Starting_a_Personal_Server_for_Each_Developer The strategies for this are mostly unaffected by mp 1 vs 2. Is there a best way to configure the apache/mp2 setup so that there doesn't have to be constant additions to startup.pl to adjust the INC path? If you don't need to restart the server, you could give each developer a separate virtual host with a separate pool of perl interpreters. These could each have a different @INC setting and would not share code. If you need people to be able to restart though, it has to be separate servers. For example, I want developer1 to use /dev1, and developer2 /dev2. I want each developer to be able to build functions below there directories in as many subdirectories as projects they have going on. I don't want developer1's functions.pm code to interfere with developer2's functions.pm. Well, what I mentioned above will let you do that, but how do you do it on the production server? You probably don't want to have multiple pools of interpreters there, since it would use more memory. If you keep these files in a separate namespace, it won't be an issue. Are these real modules, with package declarations? Is such an arrangement even possible under mp2? I've been using Apache1/mp1 and this works fine How are you doing it in mp1? There is no support for pools of interpreters in mp1, so all of your code must be using the same @INC. - Perrin
Re: best way to configure for multiple developers?
Hi Thanks for the info. I'll try setting up some virtual hosts. More below... On Wed, Apr 02, 2003 at 06:07:01PM -0500, Perrin Harkins wrote: Brian C. Thomas wrote: I have read through the lists looking for issues related to mp2 and @INC, and have read the part about +Parent and virtual hosts. You should read the docs for tips on this, especially here: http://perl.apache.org/docs/general/control/control.html#Starting_a_Personal_Server_for_Each_Developer The strategies for this are mostly unaffected by mp 1 vs 2. Is there a best way to configure the apache/mp2 setup so that there doesn't have to be constant additions to startup.pl to adjust the INC path? If you don't need to restart the server, you could give each developer a separate virtual host with a separate pool of perl interpreters. These could each have a different @INC setting and would not share code. If you need people to be able to restart though, it has to be separate servers. For example, I want developer1 to use /dev1, and developer2 /dev2. I want each developer to be able to build functions below there directories in as many subdirectories as projects they have going on. I don't want developer1's functions.pm code to interfere with developer2's functions.pm. Well, what I mentioned above will let you do that, but how do you do it on the production server? You probably don't want to have multiple pools of interpreters there, since it would use more memory. If you keep these files in a separate namespace, it won't be an issue. Are these real modules, with package declarations? Is such an arrangement even possible under mp2? I've been using Apache1/mp1 and this works fine How are you doing it in mp1? There is no support for pools of interpreters in mp1, so all of your code must be using the same @INC. Right, I guess it just feels like it is working under mp1, since I can get @INC to contain . (the current dir) and use StatINC in all the developer locations. In the mp2 server, it shows me a different @INC, that doesn't include . (is it possible in mp2?). Thanks again, BCT
Re: best way to configure for multiple developers?
Right, I guess it just feels like it is working under mp1, since I can get @INC to contain . (the current dir) and use StatINC in all the developer locations. In the mp2 server, it shows me a different @INC, that doesn't include . (is it possible in mp2?). You almost got me ;) I was looking for the place in mp2 that removes . from @INC. After awhile it struck me to check the perl source, and perl.c had: if (!PL_tainting) incpush(., FALSE, FALSE, TRUE); It's been there for a long time (tested with 5.005_03), though I didn't know/remember that :( # here you have . % perl -le 'warn join \n, @INC, ;' # and here you don't % perl -Tle 'warn join \n, @INC, ;' . is added to @INC only if you aren't running with -T. Nothing specific to mod_perl. You can still add it using: use lib qw(.); if you really have to. But it's especially bad idea with mp2/threaded mpm, where one should never use chdir during request time and rely on cwd. See: http://perl.apache.org/docs/2.0/user/coding/coding.html#Thread_environment_Issues __ 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
Best way to create a properties file for cgi/perl scripts
To all who may help, I have a few Perl scripts that updates our Novell Directory using the Net::LDAP module. My question is I have created a ldap properties file that has the bind user and a few other items like scope and base. I would like to know the best way to secure this file but still have my scripts able to access it. I am currently running apache 1.2.3 under Linux 7.1. Any thoughts are appreciated. K. Todd Cox NCI Network Support
Re: Best way to create a properties file for cgi/perl scripts
Cox, Todd (NCI) [EMAIL PROTECTED] writes: I have a few Perl scripts that updates our Novell Directory using the Net::LDAP module. My question is I have created a ldap properties file that has the bind user and a few other items like scope and base. I would like to know the best way to secure this file but still have my scripts able to access it. I am currently running apache 1.2.3 under Linux 7.1. Any thoughts are appreciated. Placing the properties file out of the web-directory tree (e.g: ~/htdocs/ == directory root ~/var/properties/ == place to put property files ) and making sure your properties file is read-only for the user that is running the cgi-bin process (with suEXEC this would be whoever's home directory it is in the above example) and running suEXEC. If your cgi-bin directory is at: ~/cgi-bin/ then just load up the properties file as: open PROPERTIES, ../var/properties/nds.csv; # etc If you're unable to run the cgi-bin with suEXEC, you might conider encrypting the properties file using public key encryption but I've only done the former suggestion myself. Elizabeth
Re: best way to handle my-website-configuration.xml?
On Tue, Sep 25, 2001 at 02:59:07PM +0200, Robin Berjon wrote: With AxKit you can seamlessly serve XML transformed by a variety of things, including XSLT. It is fast (esp 1.5 beta) and it has its own internal caching engine that makes it even faster. Also, it can cooperate with a number of dynamic generation packages. Is 1.4_82 this 1.5 beta you speak of? If not, where can 1.5 be found? Is cvs alive again? Thanks, Edward
Re: best way to handle my-website-configuration.xml?
On Tuesday 25 September 2001 18:12, Edward wrote: On Tue, Sep 25, 2001 at 02:59:07PM +0200, Robin Berjon wrote: With AxKit you can seamlessly serve XML transformed by a variety of things, including XSLT. It is fast (esp 1.5 beta) and it has its own internal caching engine that makes it even faster. Also, it can cooperate with a number of dynamic generation packages. Is 1.4_82 this 1.5 beta you speak of? If not, where can 1.5 be found? Unless a new release has come out, 1.4_82 would be it. Is cvs alive again? I don't know, but the site is nearly there (only DNS missing it seems). You can just give it a try with the IP instead of the host name. -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Work is the curse of the drinking class.
Best way to attach a module to /
What is the best way to attach a module to be run when a user first enters the site? use LocationMatch and set it to only match / as in ^/$ ? Thanks, Jamie Krasnoo [EMAIL PROTECTED]
Re: Best way to attach a module to /
Hi there, On Thu, 14 Jun 2001, Jamie Krasnoo wrote: What is the best way to attach a module to be run when a user first enters the site? Can you be a bit more specific? 73, Ged.
Re: Best way to attach a module to /
Hello, JKWhat is the best way to attach a module to be run when a user first JKenters the site? GEDCan you be a bit more specific? I think the question is better phrased by the subject, how can I use mod_perl to handle all requests? This is less intuitive than the much more easily understandable how can I use mod_perl to handle a request for a certain URL? In the latter case you can use Apache::Registry (and associate it with LocationMatch or FilesMatch or whatever) or an explicit handler. In the former case, it's not as obvious. One solution is to use a PerlTransHandler with a dispatch table in it. The PerlTransHandler will be called on all requests, and you can inspect $r-uri to see if you want to handle it. Return DECLINED if it's not something you're interested in handling (say a /images URL); otherwise, handle the request right away, internally redirect to another handler, or just directly add the handlers you want down the chain. Hope that helps-- Humbly, Andrew -- Andrew Ho http://www.tellme.com/ [EMAIL PROTECTED] Engineer [EMAIL PROTECTED] Voice 650-930-9062 Tellme Networks, Inc. 1-800-555-TELLFax 650-930-9101 --
Best way to handle gobal hash assignment under Apache::ASP
I have a configuration hash that controls all the aspects of my application. It is updated while the server is running so it needs to be "refreshed" for all processes. What is the best way to share it globally and insure that updates are read by all processes? I currently store the hash using the Storable module so it is always in a hash ( well ok a hash reference ) format, that is no database access or ini file to modify/keep track of. When updates are made the hash is saved in the Storable format. I have tried some of the suggestions outlined by Stas on the Perl Month web site, but I am getting inconsistent results. ( http://www.perlmonth.com/columns/perl_apache/perl_apache.html?issue=11 ) I need to have the values available inside of several preloaded modules as well as at the page level. The configuration file is working great, expect for having to reboot when changes are made. Aaron Johnson
What's the best way to display static HTML?
I'm using modperl for a site I'm developing. The basic structure (framework (header and footer)) is all dynamic and custom built for individual users. There are a series of static HTML documents, though, that need to be incorporated within the dynamic framework. IfI just stick the HTML into the modules and print, won't it make my server processes unnecessarily large (just holding static HTML in memory)?? Just wondering what the best method is to display static HTML within a dynamic framework. Speed and cache are probably important, but frequent dumps of the cache so as not to hold the memory. If anyone has any suggestions, I'd really appreciate it. Thanks! Arthur
Re: What's the best way to display static HTML?
"AMK" == Arthur M Kang [EMAIL PROTECTED] writes: AMK I'm using modperl for a site I'm developing. The basic structure (framework AMK (header and footer)) is all dynamic and custom built for individual users. AMK There are a series of static HTML documents, though, that need to be Is there something wrong with just linking them to the static html page?
RE: What's the best way to display static HTML?
"AMK" == Arthur M Kang [EMAIL PROTECTED] writes: AMK The framework is all dynamic content with dynamic links for each user. Apache::Include should be useful then. Just Apache::Include-virtual('/path/to/file.html'); -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Best way?
Hi, I have in every script my $user_language = library::language($user, $dbh) ; # is it finnish, english or swedish my %output = library::load_language($user_language) ; # ties %output to a dbm %output holds all the different outputs needed for each language then for my subs which are in a package library I pass a reference library::menu($db, \%output) ; #passes a reference to sub menu %output never gets modified only read. I am using mod_perl. Is this the most efficient way of doing things? I discovered the mistake I had when I turned on use strict in my library package. Before this I didn't pass %output to each sub ... to be honest I really didn't understand how each sub new the values in %output. After turning on use strict I had to pass \%output because %output was empty in the subs. hope this makes sense. Scott Scott Alexander tietoverkkosuunnittelija [EMAIL PROTECTED] gsm: +358 (0)40 7505640
RE: best way to call traceroute
On Fri, 7 Apr 2000, Karyn Ulriksen wrote: One of the reasons that I always like the nph- construction is that is showed the traceroute 'live' like it would from a console. Last I checked perl doesn't show the traceroute result until the sessions complete which could be a long time if there is trouble in the trace. Did you find a way to get past that? http://hesketh.net/traceroute?view-source=1 $r-rflush() works fine for me. Steve, welcoming feedback -- tired of being an underappreciated functionary in a soulless machine? hesketh.com is hiring: http://hesketh.com/careers/
best way to call traceroute
I want to call traceroute to the remote_host from within a mod_perl script, being a C/C++ programmer I don't the best way to do that. Is there a traceroute object I could use? If so, how? Otherwise how do I run traceroute from within a perl script? Sam
Re: best way to call traceroute
On Fri, 7 Apr 2000, Sam Carleton wrote: I want to call traceroute to the remote_host from within a mod_perl script, being a C/C++ programmer I don't the best way to do that. Is there a traceroute object I could use? If so, how? Otherwise how do I run traceroute from within a perl script? I'm getting ready to port an old and somewhat clunky traceroute CGI script to mod_perl, mostly to avoid the horrid 'nph-' construction. If you'd like I can make the source available. Steve -- tired of being an underappreciated functionary in a soulless machine? hesketh.com is hiring: http://hesketh.com/careers/
Re: best way to call traceroute
Steven Champeon wrote: On Fri, 7 Apr 2000, Sam Carleton wrote: I want to call traceroute to the remote_host from within a mod_perl script, being a C/C++ programmer I don't the best way to do that. Is there a traceroute object I could use? If so, how? Otherwise how do I run traceroute from within a perl script? I'm getting ready to port an old and somewhat clunky traceroute CGI script to mod_perl, mostly to avoid the horrid 'nph-' construction. If you'd like I can make the source available. That would be great! Any idea when it will be ready? Sam
RE: best way to call traceroute
One of the reasons that I always like the nph- construction is that is showed the traceroute 'live' like it would from a console. Last I checked perl doesn't show the traceroute result until the sessions complete which could be a long time if there is trouble in the trace. Did you find a way to get past that? -Original Message- From: Sam Carleton [mailto:[EMAIL PROTECTED]] Sent: Friday, April 07, 2000 7:18 AM To: mod_perl Mailing List Subject: Re: best way to call traceroute Steven Champeon wrote: On Fri, 7 Apr 2000, Sam Carleton wrote: I want to call traceroute to the remote_host from within a mod_perl script, being a C/C++ programmer I don't the best way to do that. Is there a traceroute object I could use? If so, how? Otherwise how do I run traceroute from within a perl script? I'm getting ready to port an old and somewhat clunky traceroute CGI script to mod_perl, mostly to avoid the horrid 'nph-' construction. If you'd like I can make the source available. That would be great! Any idea when it will be ready? Sam
Re: best way to call traceroute
On Fri, Apr 07, 2000 at 11:01:59AM -0700, Karyn Ulriksen wrote: One of the reasons that I always like the nph- construction is that is showed the traceroute 'live' like it would from a console. Last I checked perl doesn't show the traceroute result until the sessions complete which could be a long time if there is trouble in the trace. Did you find a way to get past that? This works for me, showing the results as they come, under Apache::Registry. my $r = shift; $r-content_type('text/html'); $r-send_http_header; ... $|=1; if (open (FILE, "/usr/sbin/traceroute $host 21 |")) { print while FILE; close FILE; } I think there's a Net::Traceroute on CPAN, might want to check that out to avoid the fork. -- Eric -Original Message- From: Sam Carleton [mailto:[EMAIL PROTECTED]] Sent: Friday, April 07, 2000 7:18 AM To: mod_perl Mailing List Subject: Re: best way to call traceroute Steven Champeon wrote: On Fri, 7 Apr 2000, Sam Carleton wrote: I want to call traceroute to the remote_host from within a mod_perl script, being a C/C++ programmer I don't the best way to do that. Is there a traceroute object I could use? If so, how? Otherwise how do I run traceroute from within a perl script? I'm getting ready to port an old and somewhat clunky traceroute CGI script to mod_perl, mostly to avoid the horrid 'nph-' construction. If you'd like I can make the source available. That would be great! Any idea when it will be ready? Sam -- Eric Cholet