[Catalyst] problem deploying with apache: templates not found
Hi all, I tried to deploy my little test application with apache, basically just like indicated here: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg01410.html Apache starts without errors but when a request is send for http://localhost/pdfjoin, I get the catalyst error dump saying it can not find the template. Running the very same application using the test server all works fine. The paths for TTSite are configured as shown in the examples: __PACKAGE__->config({# CATALYST_VAR => 'Catalyst', INCLUDE_PATH => [ posedb->path_to( 'root', 'src' ), posedb->path_to( 'root', 'lib' ) ], PRE_CHOMP => 1, Any clues ? Thanks and regards, Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
Marc Logghe wrote: > Hi all, > I tried to deploy my little test application with apache, basically just > like indicated here: > http://www.mail-archive.com/catalyst@lists.rawmode.org/msg01410.html > > Apache starts without errors but when a request is send for > http://localhost/pdfjoin, I get the catalyst error dump saying it can > not find the template. > Running the very same application using the test server all works fine. > > The paths for TTSite are configured as shown in the examples: > __PACKAGE__->config({ > #CATALYST_VAR => 'Catalyst', > INCLUDE_PATH => [ > posedb->path_to( 'root', 'src' ), > posedb->path_to( 'root', 'lib' ) > ], > PRE_CHOMP => 1, > > > Any clues ? Can it see the Makefile.PL ? Have you tried doing "warn posedb->path_to( 'root' )" ? -- Matt S Trout Offering custom development, consultancy and support Technical Directorcontracts for Catalyst, DBIx::Class and BAST. Contact Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ + ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
Does the folder below your root/ have the Makefile.PL?Its used to determine the home-folder of the application, so if thats missing, you probably get the wrong home folder, and thus the wrong paths to the templates.andreasOn 11. okt. 2006, at 11.48, Marc Logghe wrote: Hi all, I tried to deploy my little test application with apache, basically just like indicated here: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg01410.html Apache starts without errors but when a request is send for http://localhost/pdfjoin, I get the catalyst error dump saying it can not find the template. Running the very same application using the test server all works fine. The paths for TTSite are configured as shown in the examples: __PACKAGE__->config({# CATALYST_VAR => 'Catalyst', INCLUDE_PATH => [ posedb->path_to( 'root', 'src' ), posedb->path_to( 'root', 'lib' ) ], PRE_CHOMP => 1, Any clues ? Thanks and regards, Marc ___List: Catalyst@lists.rawmode.orgListinfo: http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas MarienborgSent: Wednesday, October 11, 2006 12:05 PMTo: The elegant MVC web frameworkSubject: Re: [Catalyst] problem deploying with apache: templates not found Does the folder below your root/ have the Makefile.PL? Its used to determine the home-folder of the application, so if thats missing, you probably get the wrong home folder, and thus the wrong paths to the templates. andreas Ah, did not know that file was important. Anyways, it is still there and apparently the home is set correctly: home => "/home/marcl/catalyst/myapp", name => "myapp", root => bless({ dirs => ["", "home", "marcl", "catalyst", "myapp", "root"], file_spec_class => undef, volume => "", }, "Path::Class::Dir"),Thanks for the reply !Regards,Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
> Can it see the Makefile.PL ? > > Have you tried doing "warn posedb->path_to( 'root' )" ? It gives: /home/marcl/catalyst/posedb/root So that seems fine, no ? Still 'Coldn't render template "file error - search.tt2: not found' though, while it resides in /home/marcl/catalyst/posedb/root/src/search.tt2 thanks, Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
>> Have you tried doing "warn posedb->path_to( 'root' )" ? >/home/marcl/catalyst/posedb/root >Still 'Coldn't render template "file error - search.tt2: not found' >though, while it resides in >/home/marcl/catalyst/posedb/root/src/search.tt2 Shouldn't that be /home/marcl/catalyst/posedb/root/search.tt2 Also the dump before referred to a different path with myapp not posedb dirs => ["", "home", "marcl", "catalyst", "myapp", "root"], Regards, Peter ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
> Shouldn't that be /home/marcl/catalyst/posedb/root/search.tt2 > > Also the dump before referred to a different path with myapp > not posedb >dirs => ["", "home", "marcl", "catalyst", "myapp", "root"], > Yeah, sure, thanks for keeping heads up. I just wanted to make the example more 'generic' ... Confusing, I know, apologies for that. But it really is saying: dirs => ["", "home", "marcl", "catalyst", "posedb", "root"], Thanks, Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
I think I am getting crazy here. I traced it down to Template::Provider::_fetch_path. Some extra debug statements give this in the logs: In apache (user apache): [Template::Provider] fetching search.tt2[Template::Provider] _fetch_path(search.tt2)[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] path not found: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/lib/search.tt2[Template::Provider] path not found: /home/marcl/catalyst/posedb/root/lib/search.tt2 ... (skipped) In catalyst test server (user marcl, working in home directory): [Template::Provider] fetching search.tt2[Template::Provider] _fetch_path(search.tt2)[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] slot = ARRAY(0xa101c88)[Template::Provider] _refresh([ ARRAY(0xa103d8c), /home/marcl/catalyst/posedb/root/src/search.tt2, Template::Document=HASH(0xa0f0eb0), 1160464516, , 1160641995])[Template::Provider] fetching config/main... (skipped) The relevant code in Template::Provider::_fetch_path is: if ($caching && ($slot = $self->{ LOOKUP }->{ $path })) { # cached entry exists, so refresh slot and extract data$self->debug("slot = $slot"); ($data, $error) = $self->_refresh($slot); $data = "" DATA ] unless $error; last INCLUDE; } elsif (-f $path) { $compiled = $self->_compiled_filename($path) if $compext || $compdir;$self->debug("compiled_filename = $compiled"); So, it seems that in case of the catalyst server, the cache is found. In case of apache, the cache slot is not found and the file path '/home/marcl/catalyst/posedb/root/src/search.tt2' is not found neither. How the heck is that possible, the file is really there (it is paranoia, but I actually did a test -f on the command line and it returned true) !! Can the _expression_ "-f $path" fail or succeed depending on the user (apache user versus marcl) ? regards, Marc From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc LoggheSent: Wednesday, October 11, 2006 11:48 AMTo: catalyst@lists.rawmode.orgSubject: [Catalyst] problem deploying with apache: templates not found Hi all, I tried to deploy my little test application with apache, basically just like indicated here: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg01410.html Apache starts without errors but when a request is send for http://localhost/pdfjoin, I get the catalyst error dump saying it can not find the template. Running the very same application using the test server all works fine. The paths for TTSite are configured as shown in the examples: __PACKAGE__->config({# CATALYST_VAR => 'Catalyst', INCLUDE_PATH => [ posedb->path_to( 'root', 'src' ), posedb->path_to( 'root', 'lib' ) ], PRE_CHOMP => 1, Any clues ? Thanks and regards, Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
Could it be a permission issue? does apache run as the same user as the test-server?Could perhaps make a seperate directory for development and deployment, and run one with apache and one with test-server.andreasOn 12. okt. 2006, at 10.56, Marc Logghe wrote: I think I am getting crazy here. I traced it down to Template::Provider::_fetch_path. Some extra debug statements give this in the logs: In apache (user apache): [Template::Provider] fetching search.tt2[Template::Provider] _fetch_path(search.tt2)[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] path not found: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/lib/search.tt2[Template::Provider] path not found: /home/marcl/catalyst/posedb/root/lib/search.tt2 ... (skipped) In catalyst test server (user marcl, working in home directory): [Template::Provider] fetching search.tt2[Template::Provider] _fetch_path(search.tt2)[Template::Provider] searching path: /home/marcl/catalyst/posedb/root/src/search.tt2[Template::Provider] slot = ARRAY(0xa101c88)[Template::Provider] _refresh([ ARRAY(0xa103d8c), /home/marcl/catalyst/posedb/root/src/search.tt2, Template::Document=HASH(0xa0f0eb0), 1160464516, , 1160641995])[Template::Provider] fetching config/main... (skipped) The relevant code in Template::Provider::_fetch_path is: if ($caching && ($slot = $self->{ LOOKUP }->{ $path })) { # cached entry exists, so refresh slot and extract data$self->debug("slot = $slot"); ($data, $error) = $self->_refresh($slot); $data = "" DATA ] unless $error; last INCLUDE; } elsif (-f $path) { $compiled = $self->_compiled_filename($path) if $compext || $compdir;$self->debug("compiled_filename = $compiled"); So, it seems that in case of the catalyst server, the cache is found. In case of apache, the cache slot is not found and the file path '/home/marcl/catalyst/posedb/root/src/search.tt2' is not found neither. How the heck is that possible, the file is really there (it is paranoia, but I actually did a test -f on the command line and it returned true) !! Can the _expression_ "-f $path" fail or succeed depending on the user (apache user versus marcl) ? regards, Marc From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Marc LoggheSent: Wednesday, October 11, 2006 11:48 AMTo: catalyst@lists.rawmode.orgSubject: [Catalyst] problem deploying with apache: templates not foundHi all, I tried to deploy my little test application with apache, basically just like indicated here: http://www.mail-archive.com/catalyst@lists.rawmode.org/msg01410.html Apache starts without errors but when a request is send for http://localhost/pdfjoin, I get the catalyst error dump saying it can not find the template. Running the very same application using the test server all works fine. The paths for TTSite are configured as shown in the examples: __PACKAGE__->config({# CATALYST_VAR => 'Catalyst', INCLUDE_PATH => [ posedb->path_to( 'root', 'src' ), posedb->path_to( 'root', 'lib' ) ], PRE_CHOMP => 1, Any clues ? Thanks and regards, Marc ___List: Catalyst@lists.rawmode.orgListinfo: http://lists.rawmode.org/mailman/listinfo/catalystSearchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] problem deploying with apache: templates not found
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas MarienborgSent: Thursday, October 12, 2006 11:15 AMTo: The elegant MVC web frameworkSubject: Re: [Catalyst] problem deploying with apache: templates not found Could it be a permission issue? does apache run as the same user as the test-server? It definately must be something like that. Could perhaps make a seperate directory for development and deployment, and run one with apache and one with test-server. I did exactly as you suggested. Checked out the application in /var/www and made apache the owner of all files. Changed the use lib statement in perl.conf, restarted apache and bingo ! All worked fine. Lesson I learned: don't let apache work in a directory that it does not own. Thanks ! Marc ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/