GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TOADFARM (3)

.ds Aq ’

NAME

Toadfarm - One Mojolicious app to rule them all

CONTENTS

VERSION

0.74

DESCRIPTION

Toadfarm is a module for configuring and starting your Mojolicious applications. You can either combine multiple applications in one script, or just use it as a init script.

Core features:
o Wrapper around hypnotoad that makes your application Sys-V <https://www.debian-administration.org/article/28/Making_scripts_run_at_boot_time_with_Debian> compatible.
o Advanced routing and virtual host configuration. Also support routing from behind another web server, such as nginx <http://nginx.com/>. This feature is very much like Mojolicious::Plugin::Mount on steroids.
o Hijacking log messages to a common log file. There’s also plugin, Toadfarm::Plugin::AccessLog, that allows you to log the requests sent to your server.

SYNOPSIS

    Script

Here is an example script that sets up logging and mounts some applications under different domains, as well as loading in some custom plugins.

See Toadfarm::Manual::DSL for more information about the different functions.



  #!/usr/bin/perl
  use Toadfarm -init;

  logging {
    combined => 1,
    file     => "/var/log/toadfarm/app.log",
    level    => "info",
  };

  mount "MyApp"  => {
    Host   => "myapp.example.com",
    config => {
      config_parameter_for_myapp => "foo"
    },
  };

  mount "/path/to/app" => {
    Host        => "example.com",
    mount_point => "/other",
  };

  mount "Catch::All::App";

  plugin "Toadfarm::Plugin::AccessLog";

  start; # needs to be at the last line



    Usage

You don’t have to put Script in init.d, but it will work with standard start/stop actions.



  $ /etc/init.d/your-script reload
  $ /etc/init.d/your-script start
  $ /etc/init.d/your-script stop



See also Init script in Toadfarm::Manual::RunningToadfarm for more details.

You can also start the application with normal Mojolicious commands:



  $ morbo /etc/init.d/your-script
  $ /etc/init.d/your-script daemon



DOCUMENTATION INDEX

o Toadfarm::Manual::Intro - Introduction.
o Toadfarm::Manual::DSL - Domain specific language for Toadfarm.
o Toadfarm::Manual::Config - Config file format.
o Toadfarm::Manual::RunningToadfarm - Command line options.
o Toadfarm::Manual::BehindReverseProxy - Toadfarm behind nginx.
o Toadfarm::Manual::VirtualHost - Virtual host setup.

PLUGINS

o Toadfarm::Plugin::AccessLog

Log each request that hit your application.

o Toadfarm::Plugin::Reload

Reload Hypnotoad with a GitHub push hook <https://help.github.com/articles/about-webhooks/>.

o Mojolicious::Plugin::SizeLimit

Kill Hypnotoad workers if they grow too large.

o Mojolicious::Plugin::SetUserGroup

Start as root, run workers as less user. See also Listen to standard HTTP ports in Toadfarm::Manual::RunningToadfarm.

PREVIOUS VERSIONS

Toadfarm prior to version 0.49 used to be a configuration file loaded in by the toadfarm script. This resulted in all the executables to be named toadfarm instead of something descriptive. It also felt a bit awkward to take over MOJO_CONFIG and use all the crazy hacks to start hypnotoad.

It also didn’t work well as an init script, so there still had to be a seperate solution for that.

The new Toadfarm DSL aim to solve all of these issues. This means that if you decide to still use any MOJO_CONFIG, it should be for the applications loaded from inside Toadfarm and not the startup script.

Note that the old solution still works, but a warning tells you to change to the new DSL based API.

COPYRIGHT AND LICENSE

Copyright (C) 2014, Jan Henning Thorsen

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

AUTHOR

Jan Henning Thorsen - jhthorsen@cpan.org
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TOADFARM (3) 2016-03-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.