Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

How to setup production Lighttpd and Catalyst apps...

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


dsuchter at ucla

Oct 16, 2007, 10:24 PM

Post #1 of 4 (815 views)
Permalink
How to setup production Lighttpd and Catalyst apps...

So I'm having a bit of a problem getting my app to run under
Lighttpd using FastCGI. Essentially my question is, "Can someone
explain how to set lighty, fastcgi, and my app up?" I've scoured
Google/Yahoo for more info but can't find a perl-FCGI specific
tutorial - just a PHP one. PHP fastcgi, for the record, is working
fine via lighty thanks to what I've found online. All the usual
software seems to be installed fine and happy (lighty, perl,
Catalyst, perl-FCGI...).

With the config below (which is my best guess after some
experimentation), I get the following when I try to start lighty:

[root[at]vanilla ~]# lighttpd -D -f /etc/lighttpd/lighttpd.conf
2007-10-16 22:04:38: (mod_fastcgi.c.1303) --- fastcgi spawning local
proc:
/srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
port: 3010
socket
min-procs: 4
max-procs: 4
2007-10-16 22:04:38: (mod_fastcgi.c.1328) --- fastcgi spawning
port: 3010
socket
current: 0 / 4
2007-10-16 22:04:38: (mod_fastcgi.c.999) execve failed for:
/srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
Permission denied
2007-10-16 22:04:38: (mod_fastcgi.c.1025) the fastcgi-backend
/srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
failed to start:
2007-10-16 22:04:38: (mod_fastcgi.c.1029) child exited with status
13 /srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
2007-10-16 22:04:38: (mod_fastcgi.c.1032) If you're trying to run
PHP as a FastCGI backend, make sure you're using the FastCGI-enabled
version.
You can find out if it is the right one by executing 'php -v' and it
should display '(cgi-fcgi)' in the output, NOT '(cgi)' NOR '(cli)'.
For more information, check
http://trac.lighttpd.net/trac/wiki/Docs%3AModFastCGI#preparing-php-as-a-fastcgi-programIf
this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2007-10-16 22:04:38: (mod_fastcgi.c.1336) [ERROR]: spawning fcgi failed.
2007-10-16 22:04:38: (server.c.895) Configuration of plugins failed.
Going down.

Some other version and package info:

[root[at]vanilla ~]# lighttpd -v
lighttpd-1.4.18 (ssl) - a light and fast webserver
Build-Date: Oct 12 2007 13:28:05
[root[at]vanilla ~]# rpm -qa | grep -i perl
openssl-perl-0.9.7a-43.16
perl-Net-SSLeay-1.30-4.el4.centos
perl-DBI-1.40-8
perl-5.8.5-36.RHEL4
perl-Filter-1.30-6
perl-URI-1.30-4
perl-FCGI-0.67-1.c4
perl-DBD-MySQL-2.9004-3.1.centos4
[root[at]vanilla ~]#


Finally my lighty.conf:

167 $HTTP["host"] =~ "www.myapponline.com" {
168 server.dir-listing = "enable"
169 simple-vhost.server-root = "/srv/www/vhosts/"
170 simple-vhost.default-host = "myapponline.com"
171 simple-vhost.document-root = "/htdocs/"
172
173 # Let lighttpd take care of serving that static content
174 alias.url = (
175 "/favicon.ico" =>
"/srv/www/vhosts/myapponline.com/htdocs/root/favicon.ico",
176 "/js/" =>
"/srv/www/vhosts/myapponline.com/htdocs/root/src/js/",
177 "/css/" =>
"/srv/www/vhosts/myapponline.com/htdocs/root/src/css/",
178 )
179
180 # rewrite-once will stop processing after the first match
181 #url.rewrite-once = (
182 # "^/((?:js|css)/.*)" => "/$1",
183 # "^/favicon.ico" => "/favicon.ico",
184 # "^/(.*)" => "/fcgi/$1"
185 #)
186 fastcgi.debug = 1
187 fastcgi.server = (
188 ".pl" => (
189 (
190 "host" => "127.0.0.1",
191 "port" => 3010,
192 "check-local" => "disable",
193 "bin-path" =>
"/srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl"
194 ),
195 ( "host" => "127.0.0.1", "port" => 3011, "check-local"
=> "disable")
196 )
197 )
198 #$HTTP["url"] =~ "^/" {
199 # setenv.add-environment = ( "SCRIPT_NAME" =>
"/script/myapp_fastcgi.pl" )
200 #}
201 }


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


jon at jrock

Oct 16, 2007, 10:59 PM

Post #2 of 4 (770 views)
Permalink
Re: How to setup production Lighttpd and Catalyst apps... [In reply to]

Dustin Suchter wrote:
> 2007-10-16 22:04:38: (mod_fastcgi.c.999) execve failed for:
> /srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
> Permission denied

chmod a+x /srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl ?
Attachments: signature.asc (0.36 KB)


ash_cpan at firemirror

Oct 17, 2007, 2:53 AM

Post #3 of 4 (767 views)
Permalink
Re: How to setup production Lighttpd and Catalyst apps... [In reply to]

Jonathan Rockway wrote:
> Dustin Suchter wrote:
>> 2007-10-16 22:04:38: (mod_fastcgi.c.999) execve failed for:
>> /srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl
>> Permission denied
>
> chmod a+x /srv/www/vhosts/myapponline.com/htdocs/script/myapp_fastcgi.pl ?
>

Also: having your code inside your htdocs is generally considered a bad
idea.

The way I set it up, which admittedly had certain requirements to make
it more complex, is detailed
http://perlitist.com/articles/catalyst-with-lighttpd

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


kakimoto at tpg

Jun 6, 2009, 3:29 AM

Post #4 of 4 (489 views)
Permalink
Re: How to setup production Lighttpd and Catalyst apps... [In reply to]

Dustin, did the replies in the thread solve your problem?


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

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.