Fab
Fab

Reputation: 21

Why is my catalyst application running Apache+FastCGI not serving dynamic content?

I am trying to run my first Perl Catalyst application using Apache and fastcgi.

Starting the server is fine, I can see the application's main page. All images/javascripts are loaded correctly (so, I assume the static content is served correctly).

For reasons I don't understand the dynamic content gives me a 404: e.g. when trying to go to www.webapp.org/search, I get "The requested URL /search was not found on this server."

Ok, here is how I set the aliases for the static content and

Alias /static /webapp/root/static/
Alias / /webapp/script/webapp_fastcgi.pl

I set the documentroot with

DocumentRoot /webapp/

Furthermore, I have a

 <Location />
     Options +ExecCGI 
     Order allow,deny
     Allow from all
     AddHandler fcgid-script .pl
 </Location>

and a directive

<Files /webapp/script/webapp_fastcgi.pl> 
    PassEnv PERL5LIB 
    SetHandler fastcgi-script
</Files>

There is nothing else in the config file.

How can I add a directive to allow serving dynamic content (www.webapp.com/search)?

Thanks a lot in advance!

Upvotes: 2

Views: 883

Answers (1)

user1126070
user1126070

Reputation: 5069

I see a space in AddHandler section. Please check your config file for typo's.

AddHandler fcgid-script .pl

Also please read this if you not did it already:

http://wiki.catalystframework.org/wiki/deployment/apache_fastcgi

For development work you could use catalyst without apache hassle: http://search.cpan.org/~mramberg/Catalyst-Runtime-5.80012/lib/Catalyst/Engine/FastCGI.pm#Standalone_FastCGI_Server

Assuming apxs installed mod_fastcgi.so into /usr/local/apache/libexec, add the following to an Apache .conf file:

LoadModule fastcgi_module libexec/mod_fastcgi.so
<IfModule mod_fastcgi.c>
  FastCgiExternalServer /tmp/myapp.fcgi -host myhost:8081
  Alias /myapp/    /tmp/myapp.fcgi/
</IfModule>

Upvotes: 2

Related Questions