Re: [cgiapp] Re: CGI::Application::Dispatch help
fREW Schmidt wrote: Ok, I have changed some things around in the hopes that it will fix my issues, but I am still not having much luck... If you're still having problems, post the debugging output from Dispatch. -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] CGI::Application::Dispatch [post] runmode not working
P Kishor wrote: CGI::Application::Dispatch-dispatch( prefix = '', default = '', debug = 1, table = [ '' = { app = $App, rm = 'view' }, 'find' = { app = $App, rm = 'find', }, 'view/:p?/:o?/:s?' = { app = $App, rm = 'view', }, 'edit/:p/:o?'= { app = $App, rm = 'edit', }, 'other_pages/:p/:o?' = { app = $App, rm = 'other_pages', }, 'create/:p/:o?' = { app = $App, rm = 'create', }, 'save[post]' = { app = $App, rm = 'save', }, '/:p?/:o?/:s?' = { app = $App, rm = 'view' }, ], args_to_new = { .. }, }, ); The 'create' runmode presents a form with 'method=post' and 'action=index.cgi' and a [submit] button named 'rm' with 'value=save' but the debug switch in the C:A:D table sends messages to the log that show that the 'save' rule is never matched. Dispatch dispatches based on the URL. In your case that URL is going to be index.cgi. Change the action to be /save, keep your method as post and remove the name rm from that button (nameless buttons are pretty common in web forms). -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
If you're still having problems, post the debugging output from Dispatch. Ok, so I changed the match from '/' to '' and it didn't change anything. I am pretty sure the issue is with apache as the ENV{PATH_INFO} does not include the junk directory I typed in. This is the output I get (I added PATH_INFO) for the url: http://locahost:8080/frew/controller_station/awesome Path Info: /controller_station/awesome at C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting/ACD/Dispatch.pm line 6. [Dispatch] Trying to match '/controller_station/awesome/' against rule '' using regex '/' [Dispatch] Trying to match '/controller_station/awesome/' against rule ':app/:rm?/:id?' using regex '/([^/]*)/?([^/]*)?/?([^/]*)?/' [Dispatch] Matched! [Dispatch] Named args from match: $VAR1 = { 'rm' = 'awesome', 'app' = 'controller_station', 'id' = '' }; [Dispatch] loading module ACD::Controller::Station [Dispatch] Final args to pass to new(): $VAR1 = { 'PARAMS' = { 'r' = bless( do{\(my $o = 12185816)}, 'Apache2::RequestRec' ), 'id' = '', 'cfg_file' = 'C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting/config.pl' } }; [Dispatch] creating instance of ACD::Controller::Station -- -fREW # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
fREW Schmidt wrote: If you're still having problems, post the debugging output from Dispatch. Ok, so I changed the match from '/' to '' and it didn't change anything. I am pretty sure the issue is with apache as the ENV{PATH_INFO} does not include the junk directory I typed in. This is the output I get (I added PATH_INFO) for the url: http://locahost:8080/frew/controller_station/awesome What is your document root? And what is your actual directory structure like under that root? -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
What is your document root? And what is your actual directory structure like under that root? DocumentRoot C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting Code/aircraft_ducting/ -config.pl -ACD --Controller.pm # Note: this is my base controller and I don't plan on having any real pages in it --Dispatch.pm --Model.pm --Controller ---Station.pm --Model ---Shop.pm --View I don't think that the DocumentRoot matters though. This is the actual config for this VirtualServer: #{{{ Aircraft Ducting VirtualHost *:8080 ErrorLog C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting/logs/error.log Perl use lib 'C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting'; $ENV{MODE} = 'development'; /Perl ScriptAlias / C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting DocumentRoot C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting Location / SetHandler perl-script PerlHandler ACD::Dispatch Order allow,deny Allow from all /Location /VirtualHost #}}} I think the Location probably tramples the DocumentRoot and ScriptAlias directives. But obviously I am wrong about something :-) -fREW # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
fREW Schmidt wrote: #{{{ Aircraft Ducting VirtualHost *:8080 ErrorLog C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting/logs/error.log Perl use lib 'C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting'; $ENV{MODE} = 'development'; /Perl ScriptAlias / C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting DocumentRoot C:/Documents and Settings/frew/My Documents/Code/aircraft_ducting Location / SetHandler perl-script PerlHandler ACD::Dispatch Order allow,deny Allow from all /Location /VirtualHost #}}} I think the Location probably tramples the DocumentRoot and ScriptAlias directives. Maybe not. What happens if you change them. Also, why are you using a DocumentRoot or ScriptAlias directive when you're handling everything under '/' with that Location? -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] mod_perl vs. FastCGI
However, if that still seems like too long, and your code is too tricky for Apache2::Reload, there are two simple solutions. One is to develop under CGI, which should be easy for most CGI::App users. Then you just switch over to mod_perl when you're ready for testing. I think I'll do this one. That's definitely reasonable. What about the dispatch stuff? Will my URL just look like this: foo/Dispatch.pm/controller_foo/action ? Another is to set MaxRequestsPerChild to 1, so that your code is compiled fresh every time. If you do this, make sure you don't load the code you're editing in your startup.pl (before the fork). I'd prefer to do the previous idea as I've had lots of success with apache and vanilla cgi before, but I may look into this when I'm not so busy. I also like the idea that with FastCGI we can switch back to IIS. Can't say I agree with you there, but to each their own. However, I would caution you that when I tried to find an IIS FastCGI solution a few years ago, there was really nothing available. That may have changed since Ruby increased the popularity of FastCGI. Well, technically I agree with you and I think we should abandon IIS and SQL Server and Windows even, but you have to start small :-) I think I'll just do the CGI stuff for now as that should be just fine really. mod_perl may be overkill anyway as we will probably never have more than 5 users at the same time as this app is for one single small organization. -fREW # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
Maybe not. What happens if you change them. Also, why are you using a DocumentRoot or ScriptAlias directive when you're handling everything under '/' with that Location? If I remove ScriptAlias OR DocumentRoot nothing happens. If I remove both it stops ignoring the junk directory that I put in the url, but it adds it's own static directory to the beginning (so instead of localhost/frew/bar/baz yielding /bar/baz I get /htdocs/frew/bar/baz). As to why: I don't know. I just changed it so that only /ACD would go to the perl module. It didn't change any of our results though. Same thing, except with ACD in the front. -- -fREW # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] Re: CGI::Application::Dispatch help
fREW Schmidt wrote: Maybe not. What happens if you change them. Also, why are you using a DocumentRoot or ScriptAlias directive when you're handling everything under '/' with that Location? If I remove ScriptAlias OR DocumentRoot nothing happens. If I remove both it stops ignoring the junk directory that I put in the url, but it adds it's own static directory to the beginning (so instead of localhost/frew/bar/baz yielding /bar/baz I get /htdocs/frew/bar/baz). Well, I'm not sure why, but Apache is doing something weird here. Is this a Windows problem (did someone else in this thread point out that it works right on Ubuntu)? You could try just putting in your own dispatch_path() method in your Dispatch class to strip out the first directory part of the PATH_INFO. -- Michael Peters Plus Three, LP # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####
Re: [cgiapp] mod_perl vs. FastCGI
Perrin Harkins wrote: On Mon, Jan 19, 2009 at 11:57 AM, fREW Schmidt fri...@gmail.com wrote: The main issues I have with mod_perl is that even with Apache2::Reload I still get errors and have to restart the server while I am developing. Pity the Java guys. It can take 5 minutes or more to restart IBM's EJB dev environment. Most mod_perl servers restart in less than 5 seconds. However, if that still seems like too long, and your code is too tricky for Apache2::Reload, there are two simple solutions. One is to develop under CGI, which should be easy for most CGI::App users. Then you just switch over to mod_perl when you're ready for testing. Another is to set MaxRequestsPerChild to 1, so that your code is compiled fresh every time. If you do this, make sure you don't load the code you're editing in your startup.pl (before the fork). I also like the idea that with FastCGI we can switch back to IIS. Can't say I agree with you there, but to each their own. However, I would caution you that when I tried to find an IIS FastCGI solution a few years ago, there was really nothing available. That may have changed since Ruby increased the popularity of FastCGI. Microsoft have themselves made a FastCGI library. It was done in partnership with Zend to improve PHP's performance on IIS. All details can be found at www.iis.net You don't have to like Microsoft or IIS, but it makes business sense to have it as an option. Lyle # CGI::Application community mailing list #### ## To unsubscribe, or change your message delivery options, ## ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp## #### ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ## ## Wiki: http://cgiapp.erlbaum.net/ ## ####