将Nginx更换为H2O

安装必须的软件 Link to heading

预备工具软件

#apt-get install autoconf automake m4 build-essential

libssl-dev 必选

#apt-get install openssl libssl-dev

以下为可选包,可自行搜索安装

  • libuv
  • libyaml
  • wslay

安装H2O Link to heading

下载安装最新版h2o https://github.com/h2o/h2o/releases

#wget https://github.com/h2o/h2o/archive/v1.4.1.tar.gz
#tar zxf v1.4.1.tar.gz
#cd h2o-1.4.1
#cmake -DWITH_BUNDLED_SSL=on .
#make
#sudo make install

编辑H2O站点配置文件 Link to heading

以下是一个简单的http与https配置文件,可自行参考修改

hosts:
"www.example.com":
	listen:
	port: 80
	listen:
	port: 443
	ssl:
		certificate-file: /path/to/server-certificate.crt
		key-file:         /path/to/private-key.crt
	paths:
	"/":
		file.dir: /path/to/doc-root

access-log: /path/to/the/access-log
error-log: /path/to/the/error-log
pid-file: /path/to/the/pid-file
http2-reprioritize-blocking-assets: ON   # performance tuning option

启动H2O

#h2o h2o.conf

以daemon模式启动

#h2o -m daemon -c h2o.conf