Re: threads in 5.8 (was: mod_perl2.0 / TIPool)
We are really having fun here of courseand personally I'm more interested in the features than the writing Thread or thread...but perhaps one place to draw the line would be If a directive or hint changes the behavior of the compiler or interpreter in a non-reversable fashion then it deserve to be called a pragma. ie the 'no mod' is not supported, similar to 'use diagnostics'. Anything else that can be turned on and off at run time, could be called a module. So 'use integer' falls in that category. This approach allows the interpreter designer to fully take advantages of the optimization opportunities or plan of actions. Having said that I was drawn to this language, because I (as a perl programmer) can be schizophrenic and the language accommodates me, Ican change everything at run timethanks Perl Matt Sergeant wrote: On Thursday 13 June 2002 11:50 pm, John Siracusa wrote: > On 6/13/02 6:40 PM, Matt Sergeant wrote: > >> Does anyone know the logic behind making the threads modules all > >> lowercase? I'd expect it to be Threads::Shared, not threads::shared. > > > > Pragmas are lowercase. And use threads; is really a pragma. > > A pragma with class methods? A pragma that exports functions? Maybe I'm > confused about the distinction between a pragma and a module... It's a really fine line ;-) See also use fields. -- ----- Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: persistent Mail::ImapClient and webmail
I was wondering why you implemented your own vs using any of the following - twig http://twig.screwdriver.net - Open WebMail http://www.openwebmail.org - WING http://users.ox.ac.uk/~mbeattie/wing/ - IMPhttp://www.horde.org/imp/ I am asking because I'm also interested in such an application (ie a webmail app) Did you find something wrong with the above list, etc... I tried WING, its PostgreSQL and Perl based, and very scalable but I found the installation a hellas all complex systems would be Thanks Joe Breeden wrote: We implemented a webmail front end with Mail::IMAPClient and Mail::IMAPClient::BodyStructure without persistent connections and it seems to work fine with several hundred connections. We just opened up a connection to server do what we want then disconnect on each request. I'm sure through persistent objectification we could have reduced the load on the IMAP server and sped up the retrieval process, but what we did worked fine. We use qmail/maildrop/courier-imap for the mail storage see http://howtos.eoutfitters.net/email for destructions on how to config that setup. I would share the code we used for the IMAP client, but my company does sell that as a service so I think they might get mad if I gave away our product. I hope this helps. Joe > -Original Message- > From: Richard Clarke [mailto:[EMAIL PROTECTED]] > Sent: Friday, June 07, 2002 9:28 AM > To: [EMAIL PROTECTED] > Subject: persistent Mail::ImapClient and webmail > > > List, > I have the task in my hands of creating a web mail > application. Initial > thoughts lead me to think I would use an external popper to > pop mail and > parse it into a database for retrieval by the modperl > application. The only > problem here is that I must provide the implementation of the > mail storage > and folder management etc. Something I would rather not spend > my time on. So > my thoughts turned to IMAP. Retrieve the mail from an IMAP > server. IMAP > itself supports most mail management methods such as move > message, delete > message, save draft, mark seen etc. So a few lines of perl > later I had a > PerlChildInitHandler which connected to the IMAP server and saved the > connection object. I wanted to know if people saw any > immediate problems > with this solution and also if anyone could explain the following > percularities. > > If I store a single imap object in $imap, e.g. > my $imap; > sub connect { > my ($self,$centro_id) = @_; > print STDERR $imap,"\n"; > unless (defined $imap) { > print STDERR "Connecting to IMAP for $centro_id\n"; > $imap = Mail::IMAPClient->new( Server => > 'cyrus.andrew.cmu.edu', > User => 'anonymous', > Password => '[EMAIL PROTECTED]', > ); > } > return $imap; > } > > This seems to successfully save the connection object. > However if I attempt > to store the object in a hash, e.g. > my %imap_cache; > sub connect { > my ($self,$centro_id) = @_; > print STDERR $imap,"\n"; > unless (exists $imap_cache{$centro_id}) { > print STDERR "Connecting to IMAP for $centro_id\n"; > $imap_cache{$centro_id} = Mail::IMAPClient->new( Server => > 'cyrus.andrew.cmu.edu', > User => 'anonymous', > Password => '[EMAIL PROTECTED]', > ); > } > return $imap_cache{$centro_id}; > } > > I seem to have intermitent success in retrieving an already connected > object. Using the first example, as far as I can tell the > object remains > available flawlessley. But storing the object in the hash > doesn't. Am I > making a mistake here? > > Another question sprung to mind, should I think about using > Persistant::Base > or some similar approach to store the IMAP objects?, or should I lean > towards Randal's and others suggestions of having a seperate > (possibles SOAP > or LWP::Daemon or even apache server in single user mode) server > specifically designed for performing IMAP requests? > > Finally, does anyone with experience in having to write > webmail interfaces > see any problems with using the functionality provided by IMAP. > > Richard > > p.s. Yes quite obviously if I have 100 children then I'll be > connected to > the IMAP server 100 times per user, hence possibly the need > to have a either > a dedicated daemon connected to the IMAP server once or some > successfuly way > of sharing IMAP objects between children. > > -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: Persistent Net::Telnet Objects
Perhaps you can put a System V message Queue in front of both Telnet connections, this way producers can place their messages in the queue asynchronously , and the backend (consumer) can pick them up in a FIFO. Also, try using Net::SSH::Perl. The Net::Telnet does not give your things like STDOUT, vs STDERR, vs Exit code. Net::Telnet puts everything in one channel. The Security is yet another issue, specially when the session could be open and idle for exessive amount of time. Your session can be hijacked easily. "French, Shawn" wrote: Vitals: Apache/1.3.20 (Win32) mod_perl/1.25_01-dev mod_ssl/2.8.4 OpenSSL/0.9.6a on Windows 2000 with PHP 4.21 I am working on a project that requires me to have two telnet objects per user session opened, and accessible throughout the user's session. I have looked at Apache::Session and many other solutions but my problem is that to keep a Net::Telnet object, I need to keep open sockets and filehandles, so I cannot serialize the object and store it in a database or file. Currently I have similar code working flawlessly: ### # "startup.pl" - called when apache starts (ie. PerlRequire "d:/Apache/conf/startup.pl") ## use MySite::Session; ### # "Session.pm" ## @EXPORT = qw( %sessionHash ); our %sessionHash; ### # "init_session.pl" - called IN MOD_PERL when a new session is requested ## use MySite::Session; $sessionHash{$session_id . "_telnetObj"} = Net::Telnet->new(); ### # "dostuff.pl" - called IN MOD_PERL many time throughout the session ## use MySite::Session; my telnetObj = $sessionHash{$session_id . "_telnetObj"}; bless (\$telnetObj, "Net::Telnet"); Although this is working right now, I don't know enough [ anything? :) ] about Apache or mod_perl to be sure that this will work in the future. What I am really concerned about is that the telnetObj will only be accessible from scripts run by the same child process as that which created and saved it. Is there a better way to do this? Thanks, Shawn French -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: Sharing Variable Across Apache Children
Abstracting access to data is only half of the storythe more challenging part is race conditions and lock management... Perrin Harkins wrote: Stas Bekman wrote: You cannot do that unless you use IPC, which is usually only useful if he variable is small. DBM file is another solution if you need share a hash variable. Yes, and if you use the tied interface of MLDM::Sync, it can look just like a normal hash, but be shared across all apache children. some info is here:http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/porting.html#Sharing_variables_between_processes This section needs work. Can anybody help me improve this section? I'm writing a whole article on this subject for my presentation at TPC. When it's done, I'll contribute it. - Perrin -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Sharing Variable Across Apache Children
Unfortunately everyone wants to use email for everything.the proper way would be to use some facilities that have proven track record, like syslogd(1d) on each box. As you know syslogd() allows you to route a message to a remote box. So, you assign one of your boxes as the final or central point. All messages would be routed to this box automatically for you. Here you can have a process, person or a file to receive such cumalated messages. Here you have the opportunity to visit last 100 message and look for corrolations. The point is, process these reports first, prioritize and then inform. By the way, your exact problem has been solved by syslogd() Try the following on your unix box. Find an entry in your /etc/syslog.conf that writes to /var/log/message or somel file. I will use cron.none , then do logger -p cron.none -t Test "this is a test" logger -p cron.none -t Test "this is a test" logger -p cron.none -t Test "this is a test" etc, etc You'll see that syslog will say last message repeated 4 times Cheers Benjamin Elbirt wrote: Wow, I never expected the response I got! Well, lets assume that I were to go with the shared memory option anyway... what would the pitfalls be / concerns? The truth is, I don't want a separate system (as per the e-mail about having an error handling server), and I don't want to have to manage the e-mail on the receiving end because I'm not the only person who receives it (didn't mention it, but I guess that's important). Further, I have no control over the mail server that handles the incoming mail so I'd have to handle it on the mail client (Outlook / Netscape Mail) resulting in the same problem I have now. Thanks, Ben Perrin Harkins wrote: > Andrew Ho wrote: > > Your error handlers on your five load-balanced boxes send an HTTP request > > to this error handling box. > > That sounds kind of slow, since it requires a network connection to be > created every time and some synchronous processing on the other end. It > also depends on that box always staying up. I think e-mail is actually > a good approach, since it's a robust message queuing system and if you > use something like qmail-inject to send the e-mail it takes almost no > time at all for mod_perl to finish with it and move on. You just need > to process those messages on the other end instead of looking at the raw > output, i.e. use Mail::Audit to keep track of the current state and > remove duplicate messages. > > Matt posted something about PPerl yesterday, which could make a > Mail::Audit script more efficient by keeping it persistent. > > - Perrin -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Software Integration Testing
I was wondering if anyone has any experiences in Software Integration Testing using home made or known methodologies that are being used. I came across one called Cyclomatic Complexity (for example) The context being The software system has three subsystems; Two subsystems in the kernel and one subsystem (a multi-threading C++ application) in user land. Components are identified as kernel modules. (think installable kernel modules). I am looking for the following - Books on software integration testing - URLs on software integration testing - Methodologies that you have worked with or read up on that might work - Home made solutions that you designed Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Host name lookups are Off but...
You can also configure your HTTP server to be a DNS cache server and have it resolve against itself. See if this will change your performance. Per Einar Ellefsen wrote: At 19:46 03.04.2002, kyle dawkins wrote: Hi all We have a mod_perl server that's under constant heavy load. In our Apache config we have switched HostnameLookups off using HostnameLookups off and for the most part, it seems to work. However, any check of the logs or /server-status shows that the server is *still* doing reverse-lookup of some addresses. Often, a number of apache processes show up as D in /server-status, and it's pretty clear that it's slowing things down. Does anyone have any idea what might be causing this? Could it be something in the mod_perl config? Nowhere in any of our code do we do hostname resolution and for the most part couldn't care less what host/ip people come from. Sorry if this is the wrong list but I have a sneaking suspicion there's something about our mod_perl config that's affecting it. RTFM's are welcome... I already tried but maybe I missed something. This has nothing to do with mod_perl and can't even be affected by HostnameLookups. I guess you're protecting your /server-status URI by an `Allow' or `Deny' directive. mod_access performs reverse lookups to check these values, for security. From the HostnameLookups docs http://httpd.apache.org/docs-2.0/mod/core.html#hostnamelookups Regardless of the setting, when mod_access is used for controlling access by hostname, a double reverse lookup will be performed. This is necessary for security. Note that the result of this double-reverse isn't generally available unless you set HostnameLookups double. For example, if only HostnameLookups on and a request is made to an object that is protected by hostname restrictions, regardless of whether the double-reverse fails or not, CGIs will still be passed the single-reverse result in REMOTE_HOST. There you go, RTFM :) I wouldn't be too worried about any performance hits from /server-status: this shouldn't be used too often, only by you or the other developers, so do you really think it's a problem? -- Per Einar Ellefsen [EMAIL PROTECTED] -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Astronomical Information
Around 1996, I ported./worked on an AIPS( Astronomical Image Processing Sysetm) software to Linux. See http://www.aoc.nrao.edu/aips parhaps they have some Perl API by now.. simran wrote: Hi All, I have (for weeks) been trying to find a Perl Module (preferablly one that works under mod_perl) that does various astronomical calculations - in particular i want to be able to work out the distance of a planet (in our solar system) on a given date. Maybe i have been searching for the wrong keywords or been looking in the wrong places but i have tried AltaVista, Google, Some NewsGroups etc. There are references to C libraries that can do it (but aren't free) but no references to perl modules that can do the above. If anyone has any information on any such modules, i would apprecaite very much if you could share the modules with me (and possibly others by putting them on CPAN). simran. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Looking for RPC::ONC.pm
Does anyone know where I can find an ONC RPC perl package? The only one I found is perlrpcgen-0.71a from Jake Donham who used be reachable at [EMAIL PROTECTED] However Jake's implementation requires an include file (rpc/svc_soc.h) that seems to be only available on Solaris. I need a linux version of it. I also see lots of XML-RPC and home made client-server RPC look-alikes. I need this to work with ONC RPC Server written in C. Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: here is a good modperl question on perlmonk
Caller wirtes > we've just migrated our 80K line pure perl web application to mod_perl...ah... > so much aster... can anyone advise on their experiences for setting up > apache/mod_perl for team development? up till now, we've all been running > our own copy of sources out of our home directories, and running a separate > apache instance for each developer seems like overkill Source Control or Revision Control will always be there, no matter if you work out of one box or many boxes. Further I don't see anything different about mod_perl vs C++. There are all source codes. My suggestion would be to install a Linux on your developer's PC and keep with the distributed model. Now everyone can use a common web tree and at integeration, bring all of them to a staging box, QC it and ship it to production. Caller can also buy some content management software like Interwoven's TeamSite product that provides a virtual workarea, for about $300,000. Its always Make or Buy. Isn't it. clayton cottingham wrote: thought someone might like to have a gander at this: http://perlmonks.org/?node_id=146303 look forward to seeing your replies!! -- ----- Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: here is a good modperl question on perlmonk
True...but I'm thinking full control to the developer. Developer can now mis-configure httpd.conf as much as he/she wants and all the paths; virtual or not are consistant, instead of a dev path vs production path I had a chance to work with Interwoven TeamSite and this very issue or virtual path was a pain, I had to add aditional checks in teh code to deal with that Dave Rolsky wrote: On Tue, 5 Mar 2002, Medi Montaseri wrote: My suggestion would be to install a Linux on your developer's PC and keep with the distributed model. Now everyone can use a common web tree and at integeration, bring all of them to a staging box, QC it and ship it to production. Giving everyone their own Apache daemon, which uses their checked out tree of code, on a central dev server is really not a problem either. -dave /*== www.urth.org we await the New Sun ==*/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: here is a good modperl question on perlmonk
I don't agree with virtual hosts setup for mod_perl folks. What if someone mess up the configuration file. If you want a central person to change them, then you are limitting the developer. The Linux-on-developers-box proposition also goes to include a database instance for the developer to crash 50 times a day It is the ultimate object oriented programmer methodology... Stuart Frew wrote: Greetings, Depending on the number of developers and how often they change, virtual hosts are good. Set up a sub-domain for each developer, ie jim.my-company.co.nz. Then they can configure there local setup to there hearts content, seperate CVS/document tree, also get separate logs. Cheers On Wed, 2002-03-06 at 12:02, Gunther Birznieks wrote: Philippe Chiasson had a really nice talk on setting up developer teams on mod_perl at ApacheCon 2001. Covers everything from CVS to deployment. You may want to see if you can get the slides from him ([EMAIL PROTECTED]) if you are interested in the details. Later, Gunther At 07:43 AM 3/6/2002, Medi Montaseri wrote: >Caller wirtes > > > we've just migrated our 80K line pure perl web application to > mod_perl...ah... > > so much aster... can anyone advise on their experiences for setting up > > apache/mod_perl for team development? up till now, we've all been running > > our own copy of sources out of our home directories, and running a > separate > > apache instance for each developer seems like overkill > >Source Control or Revision Control will always be there, no matter if you >work >out of one box or many boxes. Further I don't see anything different about >mod_perl >vs C++. There are all source codes. > >My suggestion would be to install a Linux on your developer's PC and keep >with the distributed model. Now everyone can use a common web tree and >at integeration, bring all of them to a staging box, QC it and ship it to >production. > >Caller can also buy some content management software like Interwoven's >TeamSite >product that provides a virtual workarea, for about $300,000. Its always >Make or Buy. >Isn't it. > >clayton cottingham wrote: >>thought someone might like to have a gander at this: >>http://perlmonks.org/?node_id=146303>http://perlmonks.org/?node_id=146303 >>look forward to seeing your replies!! > >-- >- >Medi Montaseri [EMAIL PROTECTED] >Unix Distributed Systems >Engineer HTTP://www.CyberShell.com>HTTP://www.CyberShell.com >CyberShell Engineering >- __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Open Web Technology Company http://www.eXtropia.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: here is a good modperl question on perlmonk
Stuart Frew wrote: Greeting, Ideally you would have linux( or what ever) on every developers machine but sometimes you don't get the choice. Oh "the choice" is easyjust come in on a weekend and install linux on your box. Don't tell IT. That's all. Cheers On Wed, 2002-03-06 at 13:40, Medi Montaseri wrote: I don't agree with virtual hosts setup for mod_perl folks. What if someone mess up the configuration file. If you want a central person to change them, then you are limitting the developer. The Linux-on-developers-box proposition also goes to include a database instance for the developer to crash 50 times a day It is the ultimate object oriented programmer methodology... Stuart Frew wrote: Greetings, Depending on the number of developers and how often they change, virtual hosts are good. Set up a sub-domain for each developer, ie jim.my-company.co.nz. Then they can configure there local setup to there hearts content, seperate CVS/document tree, also get separate logs. Cheers On Wed, 2002-03-06 at 12:02, Gunther Birznieks wrote: Philippe Chiasson had a really nice talk on setting up developer teams on mod_perl at ApacheCon 2001. Covers everything from CVS to deployment. You may want to see if you can get the slides from him ([EMAIL PROTECTED]) if you are interested in the details. Later, Gunther At 07:43 AM 3/6/2002, Medi Montaseri wrote: >Caller wirtes > > > we've just migrated our 80K line pure perl web application to > mod_perl...ah... > > so much aster... can anyone advise on their experiences for setting up > > apache/mod_perl for team development? up till now, we've all been running > > our own copy of sources out of our home directories, and running a > separate > > apache instance for each developer seems like overkill > >Source Control or Revision Control will always be there, no matter if you >work >out of one box or many boxes. Further I don't see anything different about >mod_perl >vs C++. There are all source codes. > >My suggestion would be to install a Linux on your developer's PC and keep >with the distributed model. Now everyone can use a common web tree and >at integeration, bring all of them to a staging box, QC it and ship it to >production. > >Caller can also buy some content management software like Interwoven's >TeamSite >product that provides a virtual workarea, for about $300,000. Its always >Make or Buy. >Isn't it. > >clayton cottingham wrote: >>thought someone might like to have a gander at this: >>http://perlmonks.org/?node_id=146303>http://perlmonks.org/?node_id=146303 >>look forward to seeing your replies!! > >-- >- >Medi Montaseri [EMAIL PROTECTED] >Unix Distributed Systems >Engineer HTTP://www.CyberShell.com>HTTP://www.CyberShell.com >CyberShell Engineering >- __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Open Web Technology Company http://www.eXtropia.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering - Cheers Stuart Frew IT Manager The New Zealand Revolution [EMAIL PROTECTED] DDI +64-9-918 7664 FAX+64-9-307 7032 http://www.nzr.co.nz -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: System crash related to mod_perl
Try GET-ing the pate by telnet-ing to your HTTP prot (perhaps 80) or use GET(1) or any of the command line HTTP clients. And wite the result to a file then go over it for HTTP compliancy. Possible cases: - Restart your HTTP server , ie always start on a clean sheet of paper - Do this test on a quiet system (ie client)(ie do nothing for 2 minutes, then do it) - Do this test back-to-back (load the server), if mod_perl is screwing things up this might reveal it Good luck... Jim Hull wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 actually i do send jpeg header with jpeg, in my haste to type out my mail last night so i can go to bed, i typed gif on accident. Jim - - To play a game is to attempt to achieve a specific state of affairs, using only means permitted by rules, where rules prohibit use of more efficient in favour of less efficient means, and where the rules are accepted just because they make possible such activity. On Sat, 23 Feb 2002, masta wrote: On Sat, 23 Feb 2002, Jim Hull wrote: - -- Begin -- print $q-header( -type= 'image/gif', -expires= 'now' ); print $im-jpeg(100); - -- End you send a jpeg, with a gif-header send image/jpeg instead of image/gif ciao -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8d9tpdygyS8O4zQ0RAjHoAKC/N2TR8ST4meJowDykZUkpwE8EoQCgv60Z ztBrlJ7xslDXDcHNDcw1ynI= =+4Vi -END PGP SIGNATURE- -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Anyone for JavaScript question
I know this is off topic, but I thought someone could use a break... Given a page called xyz.html, I want to measure the amount of time a user spent on this screen (or page) along with other usability metrics. So I figured I'll use JavaScript since its running the entire time the page is up. Then I decided to use onload() and onunload() events to determine start and end of the session. The onload() part is easy. However when onunload() event happens, I need to execute a server side program and feed it the data that was collected. So I figured I setup a dumy form and invoke form.submit() onUnload. Would this work or is there a better method. I also thought about a redirect followed by another rediect to where the user wanted to go, but that gets too browser dependent and I don't like it when others hijak my browser. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: [WOT] Google Programming Contest.
This reaminds me of a Brain Bowl competition at USC a few years ago, where the winner (a one man Perl speaking team) solved 4 out of 6 problems in the given time (compared to other multiple member teams) and the school of engineering decided to remove Perl as one of the possible languages The story ends with the winner is currently working and uses his prize, a copy of MS Visual C++, as a door stopper Having said that I don't think Google has anything against Perl. They use lots of it. Bill Moseley wrote: Sorry for the Way Off Topic, and sorry if I missed this on the list already: http://www.google.com/programming-contest/ They say C++ or Java. What, no Perl? -- Bill Moseley mailto:[EMAIL PROTECTED] -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: perl cgi's and apache
Perhaps you could give us some idea of your input set and how you interact with the database. Have you determined the break-point? At what array size? 10, 100, 1000, 10k, etc Also how do you interact with the DB? Do connect-disconnect? Do you 'prepare' your statement and use binding parameters? What Database engine are you using? Is it local or accross the LAN? And who is your web server running as? Perhaps you are hitting a quota for that user. Ken Y. Clark wrote: On Tue, 5 Feb 2002, Jeff wrote: Date: Tue, 5 Feb 2002 19:21:39 -0500 From: Jeff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: perl cgi's and apache I am having a problem getting my cgi script to complete processing when it is launched via apache server. The script itself runs fine from the command line. It is a script that processes a long array of values and interacts with a database per value. When the array is relatively short, the program will complete and everything is fine (even when launched through the browser). When the array is larger, and only when launched through the browser, the perl.exe on the Windows 2000 machine just seems to hang after about 30 seconds or so and if I stop apache server, it will start processing again and finish its job. I think I have all the apache timeout parameters set long enough. Can anyone help me out on this? Thanks Jeff, The browser may be what's timing out the process. There are many things you can do to work around such problem. Did you look in the guide (http://perl.apache.org/guide)? I searched for timeout, and the first suggestion is this: http://thingy.kcilink.com/modperlguide/debug/Handling_Server_Timeout_Cases_an.html However, you never mentioned that you're using mod_perl -- just Perl -- so the guide may not help all that much. (This is a *mod_perl* list you wrote to, you know. :) Regardless, one thing you can always do is to throw more hardware at the problem (bigger, faster machine; more memory; split up the load to a dedicated database server/light-weight frontend mod_perl-less Apache/big, fat mod_perl server backend). Or try to streamline your code -- maybe make one big SQL query for all your values rather than individual calls for each one. If none of that works for you, you may need to pass off the long-running process to a queue for a cronjob to pick up (well, maybe not cron if you're on Windows) or you spin it off to an external script to do the work. Search the guide. HTH, ky -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: CGI Upload/download question
Thank you very much...worked like a charm Pierre Phaneuf wrote: Medi Montaseri wrote: Can I somehow influence this behavior such that the user will indeed see something like MyFile.txt.returned or MyFile.txt.processed in the dialog box. Add a Content-Disposition header like this: Content-Disposition: attachment; filename=MyFile.txt.returned I don't remember for sure, but I think a Content-Length header might help browsers evaluate the time remaining for the download. By the way, the reason for the crazy MIME type, is to prevent the browser to render it. I'm trying to achive a complete upload-process-download. Perhaps there is an standard MIME type that I should use. There is a standard type for that function, application/octet-stream. Of course, whatever you set the Content-Type header to, Internet Explorer could cheerfully ignore it if the extension is associated on the client machine, but that's not your problem anymore I guess... ;-) -- Pierre Phaneuf -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
CGI Upload/download question
Hi, I have a question regarding File Upload. My program Upload.cgi, prompt the user to upload a file, it then processes it and turns around and download it by setting the mime to a non-existing MIME type, say, SomeCrazyType via header() method. $q-header ( -type = application/x-SomeCrazyType ); The problem is that if the user supplied a filename MyFile.txt, in the course of returning it back to the user, and since the borwser will most likely does not how to deal with that crazy mime type, will prompt the user for Save and if that is chosen, then the name Upload.cgi is suggested. Can I somehow influence this behavior such that the user will indeed see something like MyFile.txt.returned or MyFile.txt.processed in the dialog box. By the way, the reason for the crazy MIME type, is to prevent the browser to render it. I'm trying to achive a complete upload-process-download. Perhaps there is an standard MIME type that I should use. Thank you -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Single login/sign-on for different web apps?
I think Netegrity single sing-on system modifies the HTTP server (possible with mod_perl) to overload or override its native authoentication and instead contact a Host, Database or LDAP to get the yes or no along with expiration data it then sends its finding to the CGI by sending additonal HTTP Header info. A CGI program can then go from there... I might not have this 100%, but perhaps we can learn from those commercial products. Someone suggested using LDAP and RDBMS, my question is why both, why not just RDBMS. Aaron Johnson wrote: We are working on/with a similar system right now. We have an application that is written in Perl, but the people visiting will most likely be signing on at a different point then our applications sign in page. Our system was built to use its own internal database for authentication and their app/login uses a different method. The design requirements were that each side would have to do as little possible to modify there application to work in our single sign on solution. We have the luxury of not being overly concerned with the security aspect so please keep that in mind. We setup a nightly sync program that verifies the data in the current database vs. their login user information database. Here is a less then detailed summary of how the system operates. 1) The user logs into the application through their application and they are sent a cookie that contains the user name. 2) All links to our application are sent to a single page on their end with the full url of the page they want as part of the query string. 3) They verify that the user is valid using whatever method they want. 4) The user is then redirected to a special page in our application that expects the query string to contain two items, the user name and the final URL to go to. 5) Our application verifies the HTTP_REFFERER and the query string contains valid values. 6) Our application checks the database for a user matching the name sent in. Then if the user already has a session if they do then they are redirected to the correct page, otherwise it does a lookup in our system to create a session for the user based on the incoming user name and then redirects to the final URL. Now a user can go between the two applications without concern since they have a cookie for each domain. If the user comes to our site the reverse of the above occurs. This allowed us to plug into existing applications without a lot of rework. It is also fairly language/platform independent. As stated above I know there are some large security issues with this approach. Aaron Johnson Vsevolod Ilyushchenko wrote: > > Hi, > > Have you ever ran into the problem of putting up many separate web apps on > several machines in your company/university/whatever that are written from > scratch or downloaded frow the Web and each of which has its own user > database? What would you think is a good way to make the system seem more > cohesive for the users? > > It occurs to me that 1) for the single login they all should use the same > user database (obviously :), and 2) for the single sign-on there must be a > way of storing the session information. That is, once I login in the > morning to the first app, I get a cookie, a ticket or something similar, > and then, as I go from app to app, I will not have to re-enter my > credentials because they are supplied by a cookie. Apache::Session sounds > like the right tool for the job. (Did I hear "Kerberos"? :) > > Has anyone had experince with this kind of app integration? The downside I > see is that once I settle on a particular scheme to do it, I will have to > build this scheme into every app that was not written internally. But > that's the life in the before-standards age, I guess... > > Thanks, > Simon > -- > Simon (Vsevolod ILyushchenko) [EMAIL PROTECTED] > http://www.simonf.com [EMAIL PROTECTED] > > "A man who feels himself a citizen of the world whose > loyalty is to the human race and to life, rather than > to any exclusive part of it; a man who loves his country > because he loves mankind, and whose judgement is not > warped by tribal loyalties." Erich Fromm -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems Engineer HTTP://www.CyberShell.com CyberShell Engineering -
Re: Single login/sign-on for different web apps?
I wonder if one could change the HTTP Server's behavior to process a distributed version of "AuthUserFile" and "AuthGroupFile". That instead of AuthUserFile "/some/secure/directory/.htpasswd One would say AuthUserFile "http://xyz.com/some/directory/htpasswd" Then write a GUI (web) inteface to this password and group file and you have distributed authentication system. Ed Grimm wrote: On Wed, 16 Jan 2002, Medi Montaseri wrote: > I think Netegrity single sing-on system modifies the HTTP server > (possible with mod_perl) to overload or override its native > authoentication and instead contact a Host, Database or LDAP to get > the yes or no along with expiration data it then sends its finding > to the CGI by sending additonal HTTP Header info. A CGI program can > then go from there... Something like this. Basically, it has modules, plugins, or access instructions, as appropriate, for various web servers, to configure them to use it. I know it gives an LDAP interface, and I'm assuming it gives an LDAPS interface; I'm not sure what others it may present. > I might not have this 100%, but perhaps we can learn from those > commercial products. > > Someone suggested using LDAP and RDBMS, my question is why both, why > not just RDBMS. Why not just LDAP? As someone working on rolling out a single sign-on solution with LDAPS, I really want to know... (We're planning on getting Netegrity for its distributed administration stuff; at that time, we'll start using its web server configuration stuff for any new web servers. Until that time, we're rolling out LDAPS, and we're not currently planning on converting systems we roll out in the interm to Netegrity.) Incidentally, we're being a bunch of lazy bums, compared to the rest of y'all. We're considering single sign-on to mean they only need to keep track of one userid and password (unless they need to access classified or otherwise restricted stuff.) If they go to different sites and have to log on again, we don't currently care. (Basically, we have too many sites created by too many groups. We'll share the same login between servers run by the same group, but beyond that, security concerns outweigh user convinience.) Ed > Aaron Johnson wrote: > >> We are working on/with a similar system right now. >> >> We have an application that is written in Perl, but the people >> visiting will most likely be signing on at a different point then our >> applications sign in page. Our system was built to use its own >> internal database for authentication and their app/login uses a >> different method. The design requirements were that each side would >> have to do as little possible to modify there application to work in >> our single sign on solution. >> >> We have the luxury of not being overly concerned with the security >> aspect so please keep that in mind. >> >> We setup a nightly sync program that verifies the data in the current >> database vs. their login user information database. >> >> Here is a less then detailed summary of how the system operates. >> >> 1) The user logs into the application through their application and >> they are sent a cookie that contains the user name. >> >> 2) All links to our application are sent to a single page on their >> end with the full url of the page they want as part of the query >> string. >> >> 3) They verify that the user is valid using whatever method they >> want. >> >> 4) The user is then redirected to a special page in our application >> that expects the query string to contain two items, the user name and >> the final URL to go to. >> >> 5) Our application verifies the HTTP_REFFERER and the query string >> contains valid values. >> >> 6) Our application checks the database for a user matching the name >> sent in. Then if the user already has a session if they do then they >> are redirected to the correct page, otherwise it does a lookup in our >> system to create a session for the user based on the incoming user >> name and then redirects to the final URL. >> >> Now a user can go between the two applications without concern since >> they have a cookie for each domain. >> >> If the user comes to our site the reverse of the above occurs. >> >> This allowed us to plug into existing applications without a lot of >> rework. It is also fairly language/platform independent. >> >> As stated above I know there are some large security issues with this >> approach. >> >> Aaron Johnson >> >> Vsevolod Ilyushchenko wrote: >> >>> Hi, >>> >>> Have you ever ran into the problem of putting up many separate we
Employment Inquiry
Reluctantly posting this inquiry. Pardon in advance. I'm a GNU software and infrastructure engineer looking for work in Northern California (Bay area). Please let me know if I can help out in a full time or per project basis. See http://.CyberShell.com/resume Thank you -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: load balancing on apache by IP CHAINING
I'm confused'IP chainging' as the name says is at the IP (or Network) layer, what does that have to do with Apache or any HTTP server at the application level. I think any such IP based load balancing technologies are inherently unaware of the total system issues and are simply making a jugdment based on the IP level or perhaps a specific protocol on top of IP to route the next packet (or next session). Having said that a Perl HTTP would/could benefit from it just as well... On Sat, 15 Dec 2001, Anand R wrote: IP chaining can be done in Java Webserver, How to do it in Apache Webserver. Please let the Ring know this, Thanks in advance, Regards, Anand - Original Message - From: Derek Jones To: Hemant Singh ; [EMAIL PROTECTED] Cc: Derek G Jones Sent: Friday, December 14, 2001 7:29 PM Subject: RE: load balancing on apache Hi all, You can do load balancing using ipchains as well. Can't remember the program name offhand, but if I have time I'll look it up and let the list know. Only works if your servers are Linux of course. Kind regards Derek. -- Derek Jones 1051, Bollinger Road, Tel:717 359 8817 Littlestown, Mobile: 717 977 4556PA, 17340, USA Email: [EMAIL PROTECTED] AIM: scunacc -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: load balancing on apache
I think you also have to specify weather your web applications are state-less or not. If stateless, then you can just use DNS Round Robin technique or lbnamed (Load Balancing Name Server) to achieve this load balancing or high availability. If your apps are statefull as in ASP, Cold Fusion, JSP, etc, then you'll need to retain the sessions and that becomes more complicated but possible. On Fri, 14 Dec 2001, Hemant Singh wrote: Hi All I am planning to host an application and its size is going to be big one , so expect the concurrent number of connection s to be around 2200.To combat the same , want to perform load sharing on 3-4 servers.So the ide is to put one machine on external IP and this machine , after receiving the requests would forward them to any of the other three machines having the application deployed and running on the same environment.Pls suggest how can i achieve this on apache. Thanks in advance Hemant -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Any good WebMail programs?
I can use a primer on researching WebMail programs with the following criterian: - Linux based - Free - Preferably in Perl - Modularized Authentication subsystem (ie could hook up adapters to check with LDAP or RDBMS, though Linux can do that also) - Apache support - IMAP support - Multi-lingual (can be a phase II) - As feature-rich as possible (can be a phase II) Please note that I'm not looking for a service, I'm looking for the software itself. Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Multiple Sites
If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have www.customer1.xyz.com www.customer2.xyz.com or www.customer1.com www.customer2.com solve the problem at the root, not at the leaf... Looks like you are trying to do what Apache already does... Unless I missed your point On Tue, 4 Dec 2001, Mithun Bhattacharya wrote: But but it does not work. But if I put in URL/directory and a forward slash/ eg. http://URL/directory/ then it shows the default.htm page. But I know my customers, and they will not put in the directory forward slash. How do I get around this issue? http://httpd.apache.org/docs-2.0/mod/mod_dir.html quote This module provides for trailing slash redirects and serving directory index files. /quote quote A trailing slash redirect is issued when the server receives a request for a URL http://servername/foo/dirname where dirname is a directory. Directories require a trailing slash, so mod_dir issues a redirect to http://servername/foo/dirname/. /quote -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Multiple Sites
DNS hosting is about $3/monthif your DNS admin does not allow that, simply move on to the next one... On Tue, 4 Dec 2001, Mithun Bhattacharya wrote: Medi Montaseri wrote: If you only have one IP and want to have many web sites (ie URLs) for your customers, then why don't you use VirtualHost. Then your customers can either have www.customer1.xyz.com www.customer2.xyz.com or www.customer1.com www.customer2.com The originator of this thread didnt exactly say he had control over his DNS. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Running a shell command inside a cgi/perl script
Use the CHILD_ERROR $? to see what happend, for example system( some command ); if ( $? ) { then figure out what happend.. } Note that you'll have to see what your command returns and parse that. See perlvar(1), there is some shifting around to be done as well. But I am not sure how this is related to ModPerl? On Fri, 30 Nov 2001, Kairam, Raj wrote: In my perl script I have a line like this. system( '/usr/bin/lp -dhp4si /tmp/plotreq.txt' /tmp/plotid.txt); hp4si is the destination printer. /tmp/plotreq.txt is small text file to be sent to the printer. /tmp/plotid.txt is the output of lp command ( just one line to indicate job id )to be saved. If I run the command /usr/bin/lp -dhp4si /tmp/plotreq.txt /tmp/plotid.txt it is fine as a command line. The same in the perl script as above, doesn't send the file to printer nor does it create the /tmp/plotid.txt file. I have tried this also and did not work. @lplist = (/usr/bin/lp, -dhp4si /tmp/plotreq.txt); system(@lplist); This is the context. sub search { some code open(REQFILE, /tmp/plotreq.txt) || die sorry, could not open /tmp/plotreq.txt; some more code to generate content for plotreq.txt .. close(REQFILE); This is where I tried the above to send the file to the printer. } This sub is part of a cgi script that creates output for the browser. The browser output is OK. The /tmp/plotreq.txt is generated but not being sent to the printer. Can somebody guide me to do it right ?. Thanks Raj kairam -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Perl and Microsoft Excel?
Two suggestions: One: drop the excel idea right now or you'll find out its not the right solution at a later time. Use LDAP instead. Then right a CGI (as you really don't need Mod-Perl) for all kinds of queries and an admin view for a maintainer to maintain it. Two: ask your spreadsheet maintainer to save the sheet in CSV (Comma Seperated Value) format someplace where a CGI can access it. Say www:/home/directory/list.csv Then use Samba and on the maintainer's windows machine have a network mapped drive, where this file will be saved as, say z:\list.csv, where z: is mapped to \\www\directory Then use Text::CSV.pm perl package to access this list.csv You are donego home now.. PS: you might have to convert the '\r\n' to '\n' as samba does not change the line break symbols as it moves it from Windows to Unix. Cheers... On Thu, 29 Nov 2001, Ian wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In the wide and wonderful world of Microsoft and Linux, I'm in the need of an interesting soloution. I'm presenting this to the list because I've ran out of good ideas. The campus phone system has a 911 database that is in Microsoft Excel format, and they want to be able to take that information, and show it on a webpage, either via a search form, or in one big table. The problem is, they want to do it dynamically...the web server needs to yank it down from a samba share (or ftp), parse it, show it, and terminate. I'm really **really** new at anything perl wise...so I haven't the foggiest clue as to where I should start. I've finally gotten Apache/Mod Perl/Mod SSL installed, and working properly. Are there any modules for pulling information from an excel sheet? How about modules that keep the overworked admin from insanity? Ian - - From RFC 1925: (3) With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -BEGIN PGP SIGNATURE- Version: PGPfreeware 7.0.3 for non-commercial use http://www.pgp.com iQA/AwUBPAa3NHRiiq+WL4fKEQKsRACgutpROPjPllax3Nvfat2R7YERlSQAn35Q 0vwYEFLgdzsz4Dfu98dUJzBy =Qs9B -END PGP SIGNATURE- -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Seeking Legal help
I'd like to thank everyone for commenting on this issue. FYI... 100% are in favor of starting the invoicing right away...done. 75% in favor of calling lawyers in... 25% in favor of working it out, specially with chap 11 on the horizon Now on the accounting side, If I invoice them and they fail to pay, and if my accounting is on a 'Occuring Basis' (I am not sure if this is the right term, but its the non-cash way) and I show this amount as a revenue but not collected, then what.. Is the entire amount deducted from my revenue before tax? Which means I really recover 30% of the total bill...right? Oh...and since the community has been so nice to allow this thread to continue...perhaps just send your reply to me directly so this thread sort of dies out Thanks On Wed, 21 Nov 2001, Medi Montaseri wrote: HiI know this is not the lawyers hang-out, but it is seasoned contractor's hangout and as such I need some legal advice...May I? I did some work (about $25000 worth) for a customer and I'm having problem collecting. One big problem is that I don't have a formal signed hardcopy contract binding my customer to the work and cost. I however do have verbal, email communications, FTP logs, Web Access logs, hardcopy business projections, Witnesses and such showing that I'm not making this up. After months of promissing sweet equity, partnership, this and that, finally customer has asked me to invoice them and charge interest for the unpaid balance. At the same time customer is using the application I wrote for them. I however have a feeling that they are simply buying time and differing the problem. And they might even file chapter 11 as their marketing projection was not so correct. But I did my part. What can I do? Should I see a lawyer, and put out yet some more money towards something that could never materialize? Is there some kind of Small Business Arbitration Committee? I'm in Northern California, Bay area Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Seeking Legal help
HiI know this is not the lawyers hang-out, but it is seasoned contractor's hangout and as such I need some legal advice...May I? I did some work (about $25000 worth) for a customer and I'm having problem collecting. One big problem is that I don't have a formal signed hardcopy contract binding my customer to the work and cost. I however do have verbal, email communications, FTP logs, Web Access logs, hardcopy business projections, Witnesses and such showing that I'm not making this up. After months of promissing sweet equity, partnership, this and that, finally customer has asked me to invoice them and charge interest for the unpaid balance. At the same time customer is using the application I wrote for them. I however have a feeling that they are simply buying time and differing the problem. And they might even file chapter 11 as their marketing projection was not so correct. But I did my part. What can I do? Should I see a lawyer, and put out yet some more money towards something that could never materialize? Is there some kind of Small Business Arbitration Committee? I'm in Northern California, Bay area Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
mod_perl alias directories
I have successfully installed mod_perl and am using it. I have two question. 1- Currently I have designated a /pm directory to contain my mod_perl codes, a collection of classes. I then have instances of these launched from non /pm directory. I did this so that I don't have to be back at cgi-bin perdicament where all my CGIs are in one directory. I never liked that style. But I'm still forced to put my base classes in /pm. Is there a way to instruct HTTP that perl code in any directory should be used as mod_perl similar to ExecCGI. Or perhaps for a better/cleaner approach, any perl code with some extension such as foo.cgi-mp or foo.cmp (Cgi-Mod-Perl). 2- I currently have to restart my HTTP for changes to my mod_perl code take affect. Is there any way so I don't have to do this. I can see that this is not going to work in a large organization where IT handles the production web servers. Thanks -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: [OT] P2EE Redux was: Excellent article on Apache/mod_perl ateToys
Similarly, this concept of Enterprise is a bugus idea ... from a pure computer science point of view, there is no such thing as an Enterprise. This is all Microsoft's branding trying to associate themselves with something big, and Sun is stupidly following it My vote is to come up with something more pure than trendy like Enterprise. On Thu, 25 Oct 2001, Joe Brenner wrote: At 02:28 PM 10/23/2001 -0400, Perrin Harkins wrote: Stephen Adkins wrote: If no one suggests an appropriate list, I propose starting a p2ee group Can I just say that P2EE is a horrible, horrible name? It includes the Java version number (when is J3EE coming out?), as well as Sun's desperate attempt to make it sound like something you buy (Edition) rather than simply a collection of APIs. Something simple, like Perl Enterprise Project or Perl Enterprise APIs makes more sense to me. Several of you have made the same good point. And now the naming flame war has already begun... ;-) Unless there is violent opposition, the name will be Perl Enterprise Framework I would rather name it after the outcome (Framework) than the process (Project). PEP is a much better acronym though. No more Java beans: use PEP pills! -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: predefined arrays @- and @+ with mod_perl?
The identifier production in Perl is [a-zA-Z_]\w+ So '-' and '+' are not valid symbols... On Wed, 10 Oct 2001, Christoph Bergmann wrote: Hi... I wonder if there exists the predefined arrays @- and @+ in mod_perl. The following lines: print $_ foreach (@-); print br; print $_ foreach (@+); print out: 10 10 11 11 11 11 This works _only_ when called via browser under mod_perl. Started from the shell it prints out nothing (except br) - as expected. I use apache 1.3.20, perl 5.6.1 and mod_perl 1.26. I've never read about such predefined Arrays - what do they contain and why are they global? Thanks in advance! Best regards, Christoph Bergmann -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: What hourly rate to charge for programming?
Well put...and one more itemwhen you invoice your customer, say net 30, they intentially sit on it for 60 days, then cut and date the check on the 61st day, then keep it in their desk for another two weeks, so what out for cash flow and future value of money On Wed, 3 Oct 2001, Michael Bacarella wrote: I've had about two years of experience with perl, and one year of experience with mod_perl and MySQL. I've been doing contract programming jobs for people and charged by the hour. The rate I currently charge them ($40) was kind of chosen randomly. I'd like to find out if this figure is too high/too low. Does anyone here have any experiences to share? Contract programming is entirely different from salaried work. Assuming you live in the United States and are charging US dollars, Consider: Taxes (including an additional self-employment tax). Insurance (health, general liability, and possibly others) (Home) Office Expenses -- stuff you use to generate invoices, stuff you use to do your actual work if done in your home, rent, etc. Continued education -- consultants are expected to be experts. Greater risk. You generally will also never work as much as you'd like to. Your clients also get to wash their hands of you completely. Your expenses are a direct tax writeoff, rather than an additional accounting headache. After deducting all of the above, a $40/hr rate starts looking more like an $18/hr rate, and maybe even less. Consultants don't _just_ bill $100/hr because they're scam artists. :) You're charging effectively half of what a salaried perl/mysql hacker costs. Humility is a valuable business trait, but I'm positive you're worth more than you're charging. --- Michael Bacarella | 545 Eighth Ave #401 | New York, NY 10018 Systems Analysis Support | [EMAIL PROTECTED] Managed Services | 212 946-1038 -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: ANNOUNCE: Apache::OpenIndex
What is an application of such technologyI think Apache provides such directory listing itself...but what can you do with this I don't know what features your module has but if it can be trained to read a configuration file (a manifest) per directory, then I can see this technology being use for colaborative web sites, such as an internal documentation area where people could drop things...and the manifest is to insert access control and as well brief description of docs (sort of a meta-directory)otherwise just getting a listing from the file system and showing it is well...nice I don't mean to depreciate your worksometimes I don't know how to write.. On Thu, 27 Sep 2001, George Sanderson wrote: Apache::OpenIndex (OpenIndex-1.00.tar.gz) was uploaded to CPAN on 14Sep2001 and is currently released. This was my first module. I enjoyed journey. OpenIndex provides a file manager for an Apache modperl web site using a web browser. It is a extensive rewrite of the Apache::AutoIndex module (written by Philippe M. Chiasson), which in turn was a remake of the autoindex Apache module. OpenIndex also provides the same functionality as autoindex, therefore it can be used to both manage and navigate a web site. A demo is available at: http://www.xorgate.com/Apache/OpenIndex/demo ++ | George Sanderson [EMAIL PROTECTED] | http://www.xorgate.com ++ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Environment variable $ENV{MOD_PERL}
Thank you for everyone's support My problem was that I was reading suggestions like don't change your CGI script as Apache::DBI persistance connection is fully transparent... too literally The pre-requsite to this mod_perl is to have your CGI scripts run under a special mod_perl directoryyes, I read that in the Eagle book, but in Chapter 2, and by the time I got to the meating things, had forgotton this prereq Note to Author of Apache::DBI, could you please add a brief comment in this regard to your Configuration section. Also, in your document, you keep referring to eg/startup.pl. I don't think we get that with just a binary (or RPM install)... Anyways...overall I was at fault for not re-re-read documents On Sat, 15 Sep 2001, Stas Bekman wrote: On Fri, 14 Sep 2001, Medi Montaseri wrote: These documents are very confusingon one hand the document the other caller mentioned does explicitly talk about two conditions should exists. Note A AND B. And then we hear that that is not really true...And even Apache::DBI.pm itslef does not talk about it and there is no way that I know of that one can tell, if we do indeed have a persistant connection or have simply required some dumb packages... We appreciate the technology such package authors bring to us...but please regard the documentation part as important as other parts... We are doing out best to keep the Perl and open source flag up, but we can not read source code all day long, our Microsoftish developers are way ahead of us with their fancy IDEs As Andrew said, you just need to learn how to find your way around. I believe it's still easier than trying to get somebody on the support call to explain it to you. The cool thing is that once you know your way around, you don't need anybody else to help yourself. I admit that the initial overhead may be longer but it's only in the beginning. Back to your problem. What I've suggested is that may be you aren not running mod_perl at all [read: you run mod_cgi]! Try to put into your startup.pl: die not running under mod_perl unless $ENV{MOD_PERL}; On Sat, 15 Sep 2001, Stas Bekman wrote: On Fri, 14 Sep 2001, Flavio D' Amore wrote: Hi, im reading on mod_perl and Relational Databases (http://apache.org/guide/databases.html), Introduction, that persistent database connections needs to have set $ENV{MOD_PERL} in order to execute CGI perl script via mod_perl and not via normal CGI. What's the right value for that variable and where i've to set it (httpd.conf or Unix environment?)? mod_perl does this for you. You shouldn't mess with it yourself. Hmm, may be you don't run under mod_perl even if you think you are? _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering - _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Environment variable $ENV{MOD_PERL}
These documents are very confusingon one hand the document the other caller mentioned does explicitly talk about two conditions should exists. Note A AND B. And then we hear that that is not really true...And even Apache::DBI.pm itslef does not talk about it and there is no way that I know of that one can tell, if we do indeed have a persistant connection or have simply required some dumb packages... We appreciate the technology such package authors bring to us...but please regard the documentation part as important as other parts... We are doing out best to keep the Perl and open source flag up, but we can not read source code all day long, our Microsoftish developers are way ahead of us with their fancy IDEs On Sat, 15 Sep 2001, Stas Bekman wrote: On Fri, 14 Sep 2001, Flavio D' Amore wrote: Hi, im reading on mod_perl and Relational Databases (http://apache.org/guide/databases.html), Introduction, that persistent database connections needs to have set $ENV{MOD_PERL} in order to execute CGI perl script via mod_perl and not via normal CGI. What's the right value for that variable and where i've to set it (httpd.conf or Unix environment?)? mod_perl does this for you. You shouldn't mess with it yourself. Hmm, may be you don't run under mod_perl even if you think you are? _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Persistent Database connections to Oracle
I have a related question How do I confirm that I indeed have a persistent database connection... I have modified my httpd.conf via PerlRequire /path/startup.pl with debuging at level 2...I see the following in my httpd error_log [Thu Sep 13 22:11:34 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations 5653 Apache::DBI PerlChildInitHandler 5654 Apache::DBI PerlChildInitHandler 5655 Apache::DBI PerlChildInitHandler 5656 Apache::DBI PerlChildInitHandler 5660 Apache::DBI PerlChildInitHandler 5658 Apache::DBI PerlChildInitHandler 5657 Apache::DBI PerlChildInitHandler 5659 Apache::DBI PerlChildInitHandler But when I check my sessions on my Informix, I don't see any sessions owned by the owner of the httpd process... By the way, my method of checking my Informix sessions is onstat -g ses Just in case I'm doing this part wrong Stas Bekman wrote: On Thu, 13 Sep 2001, Flavio D' Amore wrote: Hi! How can i configure the startup.pl in order to use a global symbol such as $lda = Apache::DBI-connect_on_init(... including a persistent database connection to Oracle that's could be shared by other perl scripts? http://perl.apache.org/guide/databases.html _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/ -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Virtual Host?
I think people are responding with how to fix this on a Unix. He is on a NT. Assuming the disk is on the Unix and the Unix is running Samba, then just define a network drive on your NT, say V: which mapps to \\yourunixbox\disk7 Then in your http.conf on your NT, define an alias like Alias /wav/ v:what\ever\folder And from there, URLs pointing to http://xyz/wav will be looked up from v: On Mon, 10 Sep 2001, Purcell, Scott wrote: Hello, I have Apache w/modperl running on my NT box. The box has Samba on it, and I can see my Unix volumes from my SGI box. There is a volume there /DISK7 and I would like to be able to use that as a kind of Virtual host through the Apache Web server. /DISK7 has a bunch of .mov files that instead of copying to the htdocs directory, I would like to be able to href link to them and have them displayed. So my question is, where in the config (or how do I) configure the httpd.conf to allow me to use /DISK7 as part of the doc root? Thanks, Scott Purcell -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
RE: Virtual Host?
How about a symbolic link... On Mon, 10 Sep 2001, Rob Bloodgood wrote: i think you may have to mount it mount -t smb -o username=user,password=pass //ntserver//disk7 /mnt/smbshare then just add /mnt/smbshare to doc root! Except that, to the best of my knowledge, Samba can only mount to regular mount points on Linux. Rob #!/usr/bin/perl -w use Disclaimer qw/:standard/; -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: embperl
Another advantage of Perl is that you can use this language in other situations as well. Unlike PHP, or ColdFusion or other languages who need something to tow them...you know like an RV without a head, Perl has actaully an engine and gearbox as well. On Fri, 7 Sep 2001, Diego V wrote: Hi there, Just wanted to ask to any embperl user, is there any real advantage about using embperl instead of PHP ? Thank you Diego Ventrice _ Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: Info required
Maybe this abstraction do the job mod_perl packages (or classes) binds with HTTP server process. Basically there is a perl interpreter loaded along with HTTP code and running in memorythe customer of mod_perl then loads additional perl code to alter the behavior of the HTTP server. The word 'alter' can be replaced with 'overload' or 'override' as well. As such, this customer would need to be aware of how the HTTP server is written. Sort of like writing an installable device driver. So now that your class (or package) is loaded and running along with the HTTP server, you can do many things, including crashing the HTTP server, just like a bad device driver. But on a good day, your package should have a handler (simply a function) that will be called (invoked) when certain events happen (an event is also a state, in which the HTTP server is). So now the thread of control is given to your package. Now you can do whatever. But whatever you do, you need to be in harmony with the rest of the HTTP cycle. And your day will end nicely, else you'll be drinking lots coffee...just like hacking with any kernel... Having said thatI recommend Writing Apache Modules with Perl and C known as the 'eagle book'. See Chapter 3, 'The Apache Module Architecture and API' and for a quick feeling, see Figure 3-3, page 60, The Request Loop. Of course I'm new to mod_perl, so if Pokymon Masters find me in fault, please train me as I want to be the best pokymon trainer...yes I got a four-year old... Good luck... On Thu, 6 Sep 2001, Ken Williams wrote: Hi, It sounds like you want to read the source code. =) Download mod_perl (or perhaps you already have) and read the source to Apache.pm, mod_perl.pm, and so on, until you understand everything you want to. Be warned, it's not easy reading. There aren't many documents describing the internals of mod_perl, because the internals are subject to change, and the user generally shouldn't be concerned with what's going on there (unless they want to read the source). Murugan K [EMAIL PROTECTED] wrote: Hi In the CGI environment , After getting the request from the client , based on the request the web server will load the cgi2perl module ( may be someother name) to act as interface between perl and Webserver. The cgi2perl will get the data from perl interpreter and give back to web server. This is the way it will work in cgi environment . The cgi2perl module will use the webserver API functions to interact with webserver. Like that , i want to understand how internally mod_perl is working apart from generic explanations. Where to get all those informations. Thanks in advance. Regards K.Murugan -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Re: FW: AuthCookie Woes!
Further...no one needs to know or care about PerlMod around hereI posted a question two weeks ago about Apache::AuthDBI...and no one responded. So looks like you are on your own.. On Mon, 3 Sep 2001, Chris Lavin wrote: I have used a sniffer and no cookie is being sent! Man this is frustrating! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Dzuy Nguyen Sent: Monday, September 03, 2001 9:00 PM To: [EMAIL PROTECTED] Subject: Re: AuthCookie Woes! Chris Lavin wrote: It does NOT seem to be being presented to my browser. I am utterly confused by this. I have really debugged the code and it thinks that it is instructing apache to send the cookie, but my browser never receives it. Thanx -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Dzuy Nguyen Sent: Monday, September 03, 2001 11:56 AM To: [EMAIL PROTECTED] Subject: Re: AuthCookie Woes! Chris Lavin wrote: I need help with Apache::Authcookie It does not seem to be sending the cookie to the Browser. For those of you familiar with AuthCookie PLEASE Help. I have heard of oddities with IE so I tried Netscape and no differnce. AuthXCookie uses error_header_out to send cookie..ThanxChris I'm pretty sure AuhthCookie sends the cookie to the browser. Whether the browser accepts it or presents it to the server is another matter. You can check the browser's cookie file to see if your cookie is in there (if your cookie has an expiration date). Make sure you set the cookie domain correctly. Normally the cookie is instructed to present the cookie to the server whose domain is as specified in the cookie. You can look into the HTTP header and see if there is a Set-Cookie: line there. To see whether the browser is sent a cookie, I'd suggest you tell the browser to warn you before accepting the cookie or better yet, get a http sniffer or write an http client and see it for yourself. -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
is anyone getting my messages
Just wonderingI have posted a couple of questionswith no avail Am I posting? -- === Medi Montaseri, [EMAIL PROTECTED], 408-450-7114 Prepass Inc, IT/Operations, Software Eng. ===
Need help with Apache::AuthDBI
Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. VirtualHost xx.xx.xx.xx ServerName www.joe.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /web/joe ErrorLog /etc/httpd/logs/joe/error_log TransferLog /etc/httpd/logs/joe/access_log Directory /web/joe PerlRequire /web/joe/mod_perl/startup.pl Options Indexes Includes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AllowOverride All /Directory ScriptAlias /cgi-bin/ /web/joe/cgi-bin/ /VirtualHost I also have a statup.pl file that reads #!/usr/bin/perl use Apache::DBI; use Apache::AuthDBI; use Carp; warn(in startup); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; And finally I have a .htaccess that reads Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. VirtualHost xx.xx.xx.xx ServerName www.joe.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /web/joe ErrorLog /etc/httpd/logs/joe/error_log TransferLog /etc/httpd/logs/joe/access_log Directory /web/joe PerlRequire /web/joe/mod_perl/startup.pl Options Indexes Includes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AllowOverride All /Directory ScriptAlias /cgi-bin/ /web/joe/cgi-bin/ /VirtualHost I also have a statup.pl file that reads #!/usr/bin/perl use Apache::DBI; use Apache::AuthDBI; use Carp; warn(in startup); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; And finally I have a .htaccess that reads AuthName DBI AuthType Basic PerlAuthenHandler Apache::AuthDBI::authen PerlAuthzHandler Apache::AuthDBI::authz PerlSetVar Auth_DBI_data_source dbi:informix:joe@docware PerlSetVar Auth_DBI_username PerlSetVar Auth_DBI_password PerlSetVar Auth_DBI_pwd_table users PerlSetVar Auth_DBI_uid_field user_name PerlSetVar Auth_DBI_grp_whereclause and user_passwd = $ENV{REMOTE_PASSWD} PerlSetVar Auth_DBI_pwd_field user_passwd PerlSetVar Auth_DBI_grp_field user_name PerlSetVar Auth_DBI_encrypted off PerlSetVar Auth_DBI_uidcasesensitive off PerlSetVar Auth_DBI_authoritative on require valid-user And the error log shows 31496 Apache::AuthDBI::authen passwd not found in cache == 31496 Apache::AuthDBI::authz request type = initial main 31496 Apache::AuthDBI::authz user sent = medi 31496 Apache::AuthDBI::authz requirements: valid-user=1 user= group= 31496 Apache::AuthDBI::authz user_result = OK: valid-user 31496 Apache::AuthDBI::authz return OK I have followed step by step instructions of Apache::AuthDBI and I can not get this thing to workperhaps I'm overlooking something From my understanding of Authentication and Authorization, it looks like in spite of Auth_DBI_authoritative being set, the authorization (or authentication) is not doing its job of rejectting and returning an OK Can someone help please... -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
Multiple AuthName via .htaccess
Hi, I need to solve the following problem Given a web site, I need to authenticate in two leveles; a global and user level. ie accessing the web site (say www.abc.com) itself requires one authentication and then descending down to special areas I need to authenticate again. for example (www.abc.com/reports) For the first level, I'm using .htaccess with a Basic AuthType like AuthName global AuthType Basic Limit require valid-user /Limit This allows a user to access a global area where no-good stuff is presented (ie less secure, think lobby of a company) I then would like to impose restrictions on various functionalities below that, but to avoid someone bypassing me, at any point in the tree, I'd like to check for two pieces of information; 1- Did you come in thru the front door? (ie show me the password for 'global' realm) 2- What is your username and password for this special area? I understand with mod_perl I can have multiple access control handlersbut before I get there, can I just use .htaccess to achieve this. For example, can I put two AuthName in my .htaccess such as AuthName global AuthName username AuthType Basic limit requrie valid-user /limit In fact the ultimate for me would be to inherit from parent node and simply add more AuthName down a tree...this way I can achieve N level. So I can manage 1- Did you come in thru the front door 2- Did you get to the engineering thru the offical door 3- Did you get to the testing area thru the official door 4- what is your username/password to access this equipment Sorry if the analogy is lame...but you get the idea... -- === Medi Montaseri, [EMAIL PROTECTED], 408-450-7114 Prepass Inc, IT/Operations, Software Eng. ===