FAQ
I've written my first Catalyst app. Up until this point, I've been
using the Catalyst development server, but now I'm working on deploying
the application on my webserver using apache and FastCGI.

The problem is, now that I have the app deployed, Catalyst can't seem to
find my template files. These templates were found with no problem in
the development environment. Here's the error I'm getting:
[error] Couldn't render template "file error - comments/report.tt: not
found"

And here's my apache configuration:
LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiExternalServer /opt/myapp/myapp_fastcgi.pl -host 127.0.0.1:3001
<VirtualHost 64.22.79.211:80>
ServerName blog-admin.myserver.com
Alias /static /opt/myapp/root/static
Alias / /opt/myapp/myapp_fastcgi.pl/
</VirtualHost>

(I have the template files in the /opt/myapp/root/static/templates
directory.)

And the command I used to start the FastCGI server:
./myapp_fastcgi.pl -e -l 127.0.0.1:3001 -p /tmp/myapp.pid

I'm stumped. Does anyone see a problem with my configuration or
otherwise that might be keeping Catalyst from seeing my template files?

Thanks,
Greg Coates

Search Discussions

  • Coates, Greg at Sep 23, 2008 at 11:24 pm
    Okay. I've done this.

    I did some more checking, and I realize that I'm not sure where the static files and templates should be installed on a production server. It doesn't look like they get picked up in the make process.

    I currently have them in the /opt/myserver directory. My application perl module files are in the standard site_perl location.

    Where should the templates, etc go?

    Thanks,
    Greg


    -----Original Message-----
    From: Gerda Shank
    Sent: Tue 9/23/2008 11:38 AM
    To: Coates, Greg
    Subject: Re: [Catalyst] FastCGI Deployment problem - can't find templates

    Greg:

    Your template files are not static files. They shouldn't be in the
    static directory. A fairly standard configuration is to have a templates
    directory right underneath root, at the same level as the static directory.

    You should probably move the templates directory one level up and adjust
    the config for your TT view.

    Gerda


    Greg Coates wrote:
    I've written my first Catalyst app. Up until this point, I've been
    using the Catalyst development server, but now I'm working on
    deploying the application on my webserver using apache and FastCGI.

    The problem is, now that I have the app deployed, Catalyst can't seem
    to find my template files. These templates were found with no problem
    in the development environment. Here's the error I'm getting:
    [error] Couldn't render template "file error - comments/report.tt: not
    found"

    And here's my apache configuration:
    LoadModule fastcgi_module modules/mod_fastcgi.so
    FastCgiExternalServer /opt/myapp/myapp_fastcgi.pl -host 127.0.0.1:3001
    <VirtualHost 64.22.79.211:80>
    ServerName blog-admin.myserver.com
    Alias /static /opt/myapp/root/static
    Alias / /opt/myapp/myapp_fastcgi.pl/
    </VirtualHost>

    (I have the template files in the /opt/myapp/root/static/templates
    directory.)

    And the command I used to start the FastCGI server:
    ./myapp_fastcgi.pl -e -l 127.0.0.1:3001 -p /tmp/myapp.pid

    I'm stumped. Does anyone see a problem with my configuration or
    otherwise that might be keeping Catalyst from seeing my template files?

    Thanks,
    Greg Coates

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080923/6990cfff/attachment.htm
  • Tomas Doran at Sep 23, 2008 at 11:46 pm

    On 23 Sep 2008, at 23:24, Coates, Greg wrote:

    Okay. I've done this.

    I did some more checking, and I realize that I'm not sure where the
    static files and templates should be installed on a production
    server. It doesn't look like they get picked up in the make process.
    They should. If they aren't for any reason then you're doing
    something which breaks things ;(
    I currently have them in the /opt/myserver directory. My
    application perl module files are in the standard site_perl location.

    Where should the templates, etc go?
    The template 'root' directory generally goes under the main directory
    of your application, so if you're MyApp, then it'll be MyApp/root

    Exactly where this is depends on your perl, but if you're installing
    locally, I'd expect the templates to end up somewhere similar to /usr/
    local/share/perl/5.8.8/MyApp/root/

    Cheers
    t0m
  • Coates, Greg at Sep 24, 2008 at 2:55 am
    Ah. That's it.

    I found a problem in the Makefile. Once that was fixed, the root directory started being installed in the right place. Shockingly, with the files in the right place, the templates were found. :-)

    Greg


    -----Original Message-----
    From: Tomas Doran
    Sent: Tue 9/23/2008 3:46 PM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] FastCGI Deployment problem - can't find templates

    On 23 Sep 2008, at 23:24, Coates, Greg wrote:

    Okay. I've done this.

    I did some more checking, and I realize that I'm not sure where the
    static files and templates should be installed on a production
    server. It doesn't look like they get picked up in the make process.
    They should. If they aren't for any reason then you're doing
    something which breaks things ;(
    I currently have them in the /opt/myserver directory. My
    application perl module files are in the standard site_perl location.

    Where should the templates, etc go?
    The template 'root' directory generally goes under the main directory
    of your application, so if you're MyApp, then it'll be MyApp/root

    Exactly where this is depends on your perl, but if you're installing
    locally, I'd expect the templates to end up somewhere similar to /usr/
    local/share/perl/5.8.8/MyApp/root/

    Cheers
    t0m


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080923/7d973e0b/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedSep 23, '08 at 12:27a
activeSep 24, '08 at 2:55a
posts4
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Coates, Greg: 3 posts Tomas Doran: 1 post

People

Translate

site design / logo © 2021 Grokbase