? my $ctx = $main::context; ? $_mt->wrapper_file("wrapper.mt", "Configure", "Quick Start")->(sub {
In order to run the H2O standalone HTTP server, you need to write a configuration file. The minimal configuration file looks like as follows.
= $ctx->{code}->(<< 'EOT') listen: port: 8080 user: nobody hosts: "myhost.example.com": paths: /: file.dir: /path/to/the/public-files access-log: /path/to/the/access-log error-log: /path/to/the/error-log pid-file: /path/to/the/pid-file EOT ?>The configuration instructs the server to:
nobody
/path/to/the/public-files
/path/to/the/access-log
/path/to/the/error-log
/path/to/the/pid-file
Enter the command below to start the server.
= $ctx->{code}->(<< 'EOT') % sudo h2o -m daemon -c /path/to/the/configuration-file EOT ?>
The command instructs the server to read the configuration file, and start in daemon
mode, which dispatches a pair of master and worker processes that serves the HTTP requests.
To stop the server, send SIGTERM
to the server.
Now that you know how to start and stop the server, the next step is to learn the configuration directives and their structure, or see the configuration examples.
? })