Skip to content

Instantly share code, notes, and snippets.

@mundry
Last active February 26, 2024 05:43
Show Gist options
  • Save mundry/6ebd43015de7899b2cd1 to your computer and use it in GitHub Desktop.
Save mundry/6ebd43015de7899b2cd1 to your computer and use it in GitHub Desktop.
Fully manual installation of the H2O web server.
#!/usr/bin/env bash
INSTALL_BASEPATH=$HOME/.local/h2o
SOURCE_BASEPATH=$HOME/.local/src
# Set to build the shared library on top of the standalone server.
H2O_SHARED=${H2O_SHARED}
OPENSSL_VERSION=1.1.0h
OPENSSL_INSTALL_PATH=$INSTALL_BASEPATH/openssl-${OPENSSL_VERSION//./}
LIBUV_VERSION=1.20.3
LIBUV_INSTALL_PATH=$INSTALL_BASEPATH/libuv-${LIBUV_VERSION//./}
H2O_VERSION=2.2.5
H2O_INSTALL_PATH=$INSTALL_BASEPATH/h2o-${H2O_VERSION//./}
git clone -o github -b OpenSSL_${OPENSSL_VERSION//./_} https://github.com/openssl/openssl.git $SOURCE_BASEPATH/openssl
cd $SOURCE_BASEPATH/openssl
./Configure --prefix=$OPENSSL_INSTALL_PATH --openssldir=$OPENSSL_INSTALL_PATH/pki/tls enable-ec_nistp_64_gcc_128 zlib sctp enable-camellia enable-seed enable-rfc3779 enable-cms enable-md2 enable-ssl2 no-mdc2 enable-rc5 no-ec2m no-gost shared linux-x86_64
make depend
make all
make install
if [ "$H2O_SHARED" != "" ]; then
git clone -o github -b v$LIBUV_VERSION https://github.com/libuv/libuv.git $SOURCE_BASEPATH/libuv
cd $SOURCE_BASEPATH/libuv
sh autogen.sh
./configure --prefix=$LIBUV_INSTALL_PATH
make -j$(($(nproc)+1))
make install
fi
git clone -o github -b v$H2O_VERSION https://github.com/h2o/h2o.git $SOURCE_BASEPATH/h2o
cd $SOURCE_BASEPATH/h2o
PKG_CONFIG_PATH=$LIBUV_INSTALL_PATH/lib/pkgconfig:$OPENSSL_INSTALL_PATH/lib/pkgconfig \
cmake -DWITH_BUNDLED_SSL=OFF -DBUILD_SHARED_LIBS=$({ [ "$H2O_SHARED" == "" ] && echo -n OFF; } || echo -n ON) -DCMAKE_INSTALL_PREFIX=$H2O_INSTALL_PATH .
make -j$(($(nproc)+1))
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment