Catalys...:FastCGI(3)

πŸ’– NAME πŸ’–

hiii bestie πŸ’• welcome to the Catalys...:FastCGI(3) page from User Contributed Perl Documentation β€” it’s the Catalyst::Manual::Deployment::lighttpd::FastCGI manual, and it’s all about deploying Catalyst with lighttpd. That’s the vibe: get your Catalyst app living its best life under lighttpd, periodt. ✨

πŸ¦‹ Lighttpd πŸ¦‹

These configurations were tested with Lighttpd 1.4.7 β€” that’s the version they were tested against, no cap. 🫢

✨ Standalone server mode ✨

okay so for standalone server mode, drop this in:

server.document-root = "/var/www/MyApp/root"

fastcgi.server = (
    "" => (
        "MyApp" => (
            "socket"      => "/tmp/myapp.socket",
            "check-local" => "disable"
        )
    )
)

🌸 Static mode 🌸

for static mode, it’s this configuration:

server.document-root = "/var/www/MyApp/root"

fastcgi.server = (
    "" => (
        "MyApp" => (
            "socket"       => "/tmp/myapp.socket",
            "check-local"  => "disable",
            "bin-path"     => "/var/www/MyApp/script/myapp_fastcgi.pl",
            "min-procs"    => 2,
            "max-procs"    => 5,
            "idle-timeout" => 20
        )
    )
)
⚠️ Real talk: note that in newer versions of lighttpd, the min-procs and idle-timeout values are disabled. The above example would start 5 processes. fr fr.

πŸŽ€ Non-root configuration πŸŽ€

You can also run your application at any non-root location with either of the above modes, bestie. Just note the required mod_rewrite rule. πŸ’…

url.rewrite = ( "myapp\$" => "myapp/" )
fastcgi.server = (
    "/myapp" => (
        "MyApp" => (
            # same as above
        )
    )
)

For more information on using FastCGI under Lighttpd, visit https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI β€” go read the docs, iykyk. 🌈

πŸ¦‹ Static file handling πŸ¦‹

Static files can be served directly by lighttpd for a performance boost β€” literally a glow-up for your setup. ⭐

   $HTTP["url"] !~ "^/(?:img/|static/|css/|favicon.ico$)" {
         fastcgi.server = (
             "" => (
                 "MyApp" => (
                     "socket"       => "/tmp/myapp.socket",
                     "check-local"  => "disable",
                 )
             )
         )
    }

This will serve everything in the img, static, and css directories statically, as well as the favicon file. iconic behavior, honestly. πŸ‘‘

πŸ‘‘ AUTHORS πŸ‘‘

Catalyst Contributors, see Catalyst.pm

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.


kisses bestie πŸ’‹ this page came from perl v5.42.0, dated 2024-03-23, and it’s the Catalys...:FastCGI(3) manual β€” bye, slay your deployment πŸŽ€βœ¨

πŸ“¦ where this page comes from