As of April 2023, we have ceased to release versions. Rather, the each commit to master branch is considered stable and ready for general use except for the features marked as experimental.
H2O requires the following softwares to be installed:
- C/C++ compiler (GCC or Clang)
- OpenSSL 1.0.2 or later, or a TLS stack compatible with OpenSSL1
Additional softwares may be required for using certain features. As an example, to build the mruby handler, bison and ruby have to be installed.
Installing from Source
First, clone the master branch from the source repository as well as the submodules.
% git clone --recurse-submodules https://github.com/h2o/h2o.git
% cd h2o
% mkdir -p build
% cd build
% cmake ..
% sudo make install
When complete, H2O will be installed under
Start the installed server using the example configuration to confirm that it actually works (note: without the use of
-m option the server runs as a foreground process; press
Ctrl-C to stop).
% /usr/local/bin/h2o -c examples/h2o/h2o.conf
Or if you'd like to start H2O without installing it, you can use the
H2O_ROOT environment variable.
% H2O_ROOT=$PWD build/h2o -c examples/h2o/h2o.conf
The example configuration starts a server that listens to port 8080 (HTTP) and port 8081 (HTTPS). Try to access the ports using the protocols respectively (note: when accessing via HTTPS it is likely that you would see hostname mismatch errors reported by the web browsers).
When complete, proceed to Configure section for how to setup the server.
Following list shows the interesting arguments recognized by CMake.
This option specifies the directory to which H2O will be installed (default:
- This option instructs whether or not to build the standalone server with support for scripting using mruby. It is turned on by default if the prerequisites (bison, ruby and the development files3) are found.
It is turned on by default if the prerequisites are found.
See also h2olog for details.
-DCMAKE_C_FLAGS="-fsanitize=address -fno-stack-protector -fno-omit-frame-pointer".
The default is
Installing a Binary Package
Thanks to others, H2O is provided as a binary package on some environments. Up-to-date versions of H2O might be found at the following locations.
- At the time of writing, H2O can be built with libressl and boringssl.
- CMake is a popular build tool that can be found as a binary package on most operating systems.
mkmf- a program for building ruby extensions is required. In many distributions, the program is packaged as part of