Re: (slightly OT) postgresql? firebird? mysql?
On Mon, 2006-02-20 at 21:23 +0100, Daniel McBrearty wrote: > I'm currently using mysql, but I'm considering changing over to > firebird or postgre. > > Anyone have any reasoned loves/hates/useful experiences to pass on? If you aren't already using InnoDB tables in MySQL, try that first. It may save you the trouble of porting to PostgreSQL. (Nothing against Pg, but why port if you don't have to?) The transaction and replication support for InnoDB tables is good, and the locking system works on the same principles as the PostgreSQL one. With MySQL 5, you can also get rid of some annoying MySQLisms (like inserting default values into NOT NULL columns when passed a NULL) by turning on strict mode. - Perrin
Perl Script using MapToStorageHandler
Ive got a script im wokring on that uses the "PerlMapToStorageHandler" at that point it adds to the Apache Configuration using the Incomming URI, creating Location/Directory Sections, and an Alias or two... However, i need to be able to remove these changes after the request is completed... How would i remove theses changes and what handler would you suggest for me to tie in to? Thank You Glenn R. Martin
Re: 3 questions: start/stop/restart ; db ; startup.pl
On Fri, 2006-02-24 at 21:38 -0500, Jonathan Vanasco wrote: > i seem too often to be unable to do a restart of apache. instead of > a restart, I need to stop, then start, otherwise my startup.pl file > yells at me. What's the error message? > on my production box, during a start, i sometime get this: > >> DBI connect('xxx','xxx',...) failed: Lost connection to > MySQL > server during query > on the first startup. if i start again, it works. Are you opening a database connection during startup and then using it from multiple child processes? That could cause this. > finally, because i use a startup.pl in apache, i've noticed that > even an apache stop will run it. No, stopping apache will not run your startup.pl. What makes you think it is running? - Perrin
Re: Perl Script using MapToStorageHandler
On 1 Mar 2006, at 21:44, Glenn Martin wrote: Ive got a script im wokring on that uses the "PerlMapToStorageHandler" at that point it adds to the Apache Configuration using the Incomming URI, creating Location/Directory Sections, and an Alias or two... However, i need to be able to remove these changes after the request is completed... How would i remove theses changes and what handler would you suggest for me to tie in to? You're doing it wrong I'm afraid. Why do you want to change the server config during a request? -- Andy Armstrong, hexten.net
Re: Perl Script using MapToStorageHandler
Actually if i read the documentation correctly, im doing it just right. Map to Storage is right before it get mapped to a Location/Directory... and thus this is where id want to add Directory/Location and Alias directives based off of the incomming URI... Im trying to control DAV input. Take the URI, translate it to a Folder, Check the folders contents to see if it matches a Subversion repository and if it does map the Location to SVN Dav and that repository otherwise Map the Directory to the URI using an Alias and a Directory and turn on normal WebDAV... Then return Decline to Apache then tries to Match the URI to the Modified Config. Which will active the correct module for the correct folder... However i need this configuration change to be Temporary... Per request only... I need the Alias' or Location/Directory sections to no longer exist.. What handler do i use? and how do i reset the configuration? --- Andy Armstrong <[EMAIL PROTECTED]> wrote: > On 1 Mar 2006, at 21:44, Glenn Martin wrote: > > Ive got a script im wokring on that uses the > > "PerlMapToStorageHandler" at that point it adds to > the > > Apache Configuration using the Incomming URI, > creating > > Location/Directory Sections, and an Alias or > two... > > > > However, i need to be able to remove these changes > > after the request is completed... How would i > remove > > theses changes and what handler would you suggest > for > > me to tie in to? > > You're doing it wrong I'm afraid. Why do you want to > change the > server config during a request? > > -- > Andy Armstrong, hexten.net > >
Re: Perl Script using MapToStorageHandler
If i am doing this wrong, how would you suggest doing it? Glenn R. Martin --- Andy Armstrong <[EMAIL PROTECTED]> wrote: > On 1 Mar 2006, at 21:44, Glenn Martin wrote: > > Ive got a script im wokring on that uses the > > "PerlMapToStorageHandler" at that point it adds to > the > > Apache Configuration using the Incomming URI, > creating > > Location/Directory Sections, and an Alias or > two... > > > > However, i need to be able to remove these changes > > after the request is completed... How would i > remove > > theses changes and what handler would you suggest > for > > me to tie in to? > > You're doing it wrong I'm afraid. Why do you want to > change the > server config during a request? > > -- > Andy Armstrong, hexten.net > >
Re: Perl Script using MapToStorageHandler
Glenn Martin wrote: > Actually if i read the documentation correctly, im > doing it just right. Map to Storage is right before it > get mapped to a Location/Directory... and thus this is > where id want to add Directory/Location and Alias > directives based off of the incomming URI... Im trying > to control DAV input. Take the URI, translate it to a > Folder, Check the folders contents to see if it > matches a Subversion repository and if it does map the > Location to SVN Dav and that repository otherwise Map > the Directory to the URI using an Alias and a > Directory and turn on normal WebDAV... Then return > Decline to Apache then tries to Match the URI to the > Modified Config. Which will active the correct module > for the correct folder... I hope I understood this correctly, so apologies if I didn't. > However i need this configuration change to be > Temporary... Per request only... I need the Alias' or > Location/Directory sections to no longer exist.. You can't 'remove' configuration directives you've injected in httpd. And those are very *global* and would affect much more than the current request. > What handler do i use? and how do i reset the > configuration? You don't reset the configuration, but you simply take a different approach. Instead of trying to inject httpd configuration, your MapToStorage handler needs to emulate Alias/Location directives. For instance, if you needed to Alias /foo to /var/www/foo, instead of doing what I believe you are currently doing: $r->add_config(["Alias /foo /var/www/foo"]); Simply do what mod_alias would have done... $r->filename(File::Spec->catfile("/var/www", $r->uri)); And you get pre-request behaviour just like you wanted. And it's tons faster too ;-) Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5 signature.asc Description: OpenPGP digital signature
Re: Perl Script using MapToStorageHandler
On 1 Mar 2006, at 22:13, Philippe M. Chiasson wrote: And you get pre-request behaviour just like you wanted. And it's tons faster too ;-) Yup, what he said. -- Andy Armstrong, hexten.net
Re: Perl Script using MapToStorageHandler
Sounds great, but how would i do something simular to: $r->add_config([sprintf('', $uripath), 'DirectoryIndex .', 'Options +Indexes', 'Dav svn', sprintf("SVNPath %s", $localpath), '']); and $r->add_config([sprintf('', $localpath), 'DirectoryIndex .', 'Options +Indexes', 'Dav On', '']); --- "Philippe M. Chiasson" <[EMAIL PROTECTED]> wrote: > Glenn Martin wrote: > > Actually if i read the documentation correctly, im > > doing it just right. Map to Storage is right > before it > > get mapped to a Location/Directory... and thus > this is > > where id want to add Directory/Location and Alias > > directives based off of the incomming URI... Im > trying > > to control DAV input. Take the URI, translate it > to a > > Folder, Check the folders contents to see if it > > matches a Subversion repository and if it does map > the > > Location to SVN Dav and that repository otherwise > Map > > the Directory to the URI using an Alias and a > > Directory and turn on normal WebDAV... Then return > > Decline to Apache then tries to Match the URI to > the > > Modified Config. Which will active the correct > module > > for the correct folder... > > I hope I understood this correctly, so apologies if > I didn't. > > > However i need this configuration change to be > > Temporary... Per request only... I need the Alias' > or > > Location/Directory sections to no longer exist.. > > You can't 'remove' configuration directives you've > injected > in httpd. And those are very *global* and would > affect > much more than the current request. > > > What handler do i use? and how do i reset the > > configuration? > > You don't reset the configuration, but you simply > take a different > approach. > > Instead of trying to inject httpd configuration, > your MapToStorage handler > needs to emulate Alias/Location directives. For > instance, if you needed > to Alias /foo to /var/www/foo, instead of doing what > I believe you are currently > doing: > > $r->add_config(["Alias /foo /var/www/foo"]); > > Simply do what mod_alias would have done... > > $r->filename(File::Spec->catfile("/var/www", > $r->uri)); > > And you get pre-request behaviour just like you > wanted. And it's tons faster too ;-) > > > Philippe M. Chiasson > m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : > 88C3A5A5 > http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 > 1AE5 3631 CB32 A107 88C3A5A5 >
Re: Perl Script using MapToStorageHandler
Sounds great, but how would i do something simular to: $r->add_config([sprintf('', $uripath), 'DirectoryIndex .', 'Options +Indexes', 'Dav svn', sprintf("SVNPath %s", $localpath), '']); and $r->add_config([sprintf('', $localpath), 'DirectoryIndex .', 'Options +Indexes', 'Dav On', '']); --- "Philippe M. Chiasson" <[EMAIL PROTECTED]> wrote: > Glenn Martin wrote: > > Actually if i read the documentation correctly, im > > doing it just right. Map to Storage is right > before it > > get mapped to a Location/Directory... and thus > this is > > where id want to add Directory/Location and Alias > > directives based off of the incomming URI... Im > trying > > to control DAV input. Take the URI, translate it > to a > > Folder, Check the folders contents to see if it > > matches a Subversion repository and if it does map > the > > Location to SVN Dav and that repository otherwise > Map > > the Directory to the URI using an Alias and a > > Directory and turn on normal WebDAV... Then return > > Decline to Apache then tries to Match the URI to > the > > Modified Config. Which will active the correct > module > > for the correct folder... > > I hope I understood this correctly, so apologies if > I didn't. > > > However i need this configuration change to be > > Temporary... Per request only... I need the Alias' > or > > Location/Directory sections to no longer exist.. > > You can't 'remove' configuration directives you've > injected > in httpd. And those are very *global* and would > affect > much more than the current request. > > > What handler do i use? and how do i reset the > > configuration? > > You don't reset the configuration, but you simply > take a different > approach. > > Instead of trying to inject httpd configuration, > your MapToStorage handler > needs to emulate Alias/Location directives. For > instance, if you needed > to Alias /foo to /var/www/foo, instead of doing what > I believe you are currently > doing: > > $r->add_config(["Alias /foo /var/www/foo"]); > > Simply do what mod_alias would have done... > > $r->filename(File::Spec->catfile("/var/www", > $r->uri)); > > And you get pre-request behaviour just like you > wanted. And it's tons faster too ;-) > > > Philippe M. Chiasson > m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : > 88C3A5A5 > http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 > 1AE5 3631 CB32 A107 88C3A5A5 >
How is modperl 2 working with apache 2 under worker mpm?
How is modperl 2 working with apache 2 under worker mpm? Has anyone successfully deploy modperl2 using worker mpm? I recently wrote a script in perl using ithread and it kept failing. Is there any guideline for writing modperl 2 handler using worker mpm? Thanks Khai
Re: (slightly OT) postgresql? firebird? mysql?
To add- Make sure you migrate ALL tables AND your default table type (ie db type) from MyISAM to innodb ONLY innodb tables are transaction safe. If you have a multi-table transaction where 1 table is not inno, you'll go crazy trying to figure out why all your rollbacks seem to corrupt your database. On Mar 1, 2006, at 4:38 PM, Perrin Harkins wrote: If you aren't already using InnoDB tables in MySQL, try that first. It may save you the trouble of porting to PostgreSQL. (Nothing against Pg, but why port if you don't have to?) The transaction and replication
Re: How is modperl 2 working with apache 2 under worker mpm?
Khai Doan wrote: How is modperl 2 working with apache 2 under worker mpm? Has anyone successfully deploy modperl2 using worker mpm? I recently wrote a script in perl using ithread and it kept failing. Is there any guideline for writing modperl 2 handler using worker mpm? Use the same threading model as httpd/worker; generally this is pthreads. You will have to look at your apr.h generated file for information about which threading model was chosen. Ensure you build perl and httpd to match one another.
Re: Perl Script using MapToStorageHandler
On Wednesday 01 March 2006 23:20, Glenn Martin wrote: > Sounds great, but how would i do something simular to: > > $r->add_config([sprintf(' "%s/?">', $uripath), > 'DirectoryIndex .', > 'Options +Indexes', > 'Dav svn', > sprintf("SVNPath %s", > $localpath), > '']); > > > and > > $r->add_config([sprintf('', > $localpath), 'DirectoryIndex .', 'Options +Indexes', > 'Dav On', '']); That leads to an error saying that "add_config([EMAIL PROTECTED], $override) is applied in MapToStorage it is very similar to AllowOverride $override @lines Only this location block is applied *before* any Directory block. That means 1) If your mp-handler returns DECLINED, your current configuration can be overridden by the core-handler, because it comes after you. 2) Anything you apply to the config in MapToStorage applies to a copy. Hence, nothing is needed to undo the changes. 3) Your config can be applied by $r->add_config([ 'DirectoryIndex .', 'Options Indexes', 'Dav svn', sprintf("SVNPath %s", $localpath), ], ~0) # ~0 == AllowOverride All But, a few thing cannot be applied by means of $r->add_config. For example "AllowOverride" needs a "Directory" block or "ProxyPassReverse" does different things if it appears outside or inside a "Location" block. Further, mod_perl-2.0.2 cannot apply "Options" if working under Apache 2.2. For these situations I have posted a patch a few days ago (last Friday I think). I hope it will make it into mod_perl 2.0.3 see http://www.gossamer-threads.com/lists/modperl/modperl/87401 In fact, I am currently working on a module that can read the configuration from a database and apply it on the fly. It already works pretty good. If you want I can send you a current copy. I think of releasing it on CPAN later this week or early next week. Torsten pgpgj8cFugBNI.pgp Description: PGP signature