[obsolete] Install H2O on Ubuntu 14.04

Kazuho Oku edited this page Jun 17, 2015 · 1 revision

The information is obsolete; please refer to h2o.github.io/install.html for installing H2O version 1.2.0 or above.

This short step by step tutorial should help a new users to install the H2O server on Ubuntu 14.04 LTS system. A fresh install of the Ubuntu 14.04 is strongly recommended.

1.Update the system

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y

2.Install required components from repository

apt-get install locate git cmake build-essential checkinstall autoconf pkg-config libtool python-sphinx wget libcunit1-dev nettle-dev libyaml-dev libuv-dev -y

3.Download some required components

git clone https://github.com/tatsuhiro-t/wslay.git
git clone https://github.com/h2o/h2o.git

4.Install wslay

cd wslay/
autoreconf -i
automake
autoconf
./configure
make
make install

The available libraries should look like this:

ls /usr/local/lib/
libuv.a   libuv.so.1      libwslay.la    libwslay.so.0.0.1  python3.4
libuv.la  libuv.so.1.0.0  libwslay.so    pkgconfig
libuv.so  libwslay.a      libwslay.so.0  python2.7

5.OpenSSL installation

This step may not require:

cd
apt-get remove --purge openssl libssl-dev

Required steps:

wget https://www.openssl.org/source/openssl-1.0.2.tar.gz --no-check-certificate
tar -xvzf openssl-1.0.2.tar.gz
mv openssl-1.0.2 openssl
cd openssl/

Create a openssl.ld file

vim openssl.ld

OPENSSL_1.0.0 {
    global:
        *;

    local:
        *;
};

OPENSSL_1.0.1 {
} OPENSSL_1.0.0;

OPENSSL_1.0.1d {
} OPENSSL_1.0.1;

OPENSSL_1.0.2 {
} OPENSSL_1.0.1d;

Follow installation steps:

./config -fPIC shared -Wl,--version-script=/root/openssl/openssl.ld -Wl,-Bsymbolic-functions
make
make test
make install
/usr/local/ssl/bin/openssl version
OpenSSL 1.0.2 22 Jan 2015
export OPENSSL_INCLUDE_DIR=/usr/local/ssl/include/
export OPENSSL_LIBRARIES='/usr/local/ssl/lib/libssl.so;/usr/local/ssl/lib/libcrypto.so'
export LD_LIBRARY_PATH=/usr/local/ssl/lib/
cd

6.H2O installation

Create a FindOpenSSL.cmake file:

cd h2o/
vim cmake/FindOpenSSL.cmake
FIND_PATH(OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENSSL DEFAULT_MSG OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)

Follow installation steps:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/h2o -DOPENSSL_LIBRARIES='/usr/local/ssl/lib/libssl.so;/usr/local/ssl/lib/libcrypto.so' -DOPENSSL_INCLUDE_DIR=/usr/local/ssl/include/
make
make install

7.Run H2O

/usr/local/h2o/bin/h2o -c examples/h2o/h2o.conf

Thanks

Many thanks to the users arno481 and johngrafis for helping with compiling and providing the openssl.ld and FindOpenSSL.cmake files.