世界上最伟大的投资就是投资自己的教育

全场限时 5 折

首页Linux
随风 · 练气

h2o 介绍

随风发布于3927 次阅读

H2O is a new generation HTTP server that provides quicker response to users with less CPU utilization when compared to older generation of web servers. Designed from ground-up, the server takes full advantage of HTTP/2 features including prioritized content serving and server push, promising outstanding experience to the visitors of your web site.

h2o是相当于 nginx 的一个静态 web 服务器,它有以下几个特征:

  • 支持 http 2
  • 支持反向代理
  • 支持 https
  • 支持 fastcgi
  • 支持 mruby

现在来安装一下。

如果是在 mac 系统上,可以使用brew install h2o一键安装。

如果是在 linux 下,可以下载源码后使用下面三条指令安装。

$ cmake -DWITH_BUNDLED_SSL=on .
$ make
$ sudo make install

要启动 h2o 进程,可以使用下面的指令。

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

它的配置语法也很简单,如果你熟悉 nginx,对于你来说,是太简单不过的事情。

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

它的很多概念可能跟所有的 web 服务器都差不多,使用起来很简单。

本篇完结。

本站文章均为原创内容,如需转载请注明出处,谢谢。

0 条回复
暂无回复~~
喜欢
统计信息
    学员: 29207
    视频数量: 1985
    文章数量: 489

© 汕尾市求知科技有限公司 | Rails365 Gitlab | Qiuzhi99 Gitlab | 知乎 | b 站 | 搜索

粤公网安备 44152102000088号粤公网安备 44152102000088号 | 粤ICP备19038915号

Top