编译安装 Hiawatha v7.3 通过 

很早就听说了hiawatha,就是一直没有时间去尝试.最近我的vps内存是越来越吃紧,于是更换掉之前的巨无霸软件就成了当务之急,从而去追求一些轻量级的serverd.

我用varnish 替换了 squid,待会还要用vsftpd 替换 proftpd.

最近越来越不能忍受cherokee的巨大,tar 包居然达到了 6M之多.cherokee 固然是好东西,但是内存状况不允许我这样做.故而相中了号称轻量至极的hiawatha web server.源码包才100多Kb……

下载最新版本7.3的源码包,解压,进入目录
我的configure:
[root@PowerPC hiawatha-7.3]# ./configure \
> --prefix=/usr/local/hiawatha \
> --exec-prefix=/usr/local \
> --sysconfdir=/etc/sysconfig/hiawatha \
> --localstatedir=/var \
> --disable-largefile \
> --disable-ipv6 \
> --disable-ssl \
> --disable-xslt

检查依赖,没有问题.紧接着 make && make install 编译和安装.hiawatha 果然够轻量级,几乎不到十秒就完成了.棒阿

进入配置文件目录 /etc/sysconfig/hiawatha/下,编辑 hiawatha.conf.
可以说hiawatha的配置格式非常简单,而且还有其中例子可以参考.

我的部分配置:

ServerId = http

Binding {
Port = 81
}

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:9000
Extension = php, php5
SessionTimeout = 30
}

#适用于wordpress的地址重写
UrlToolkit {
ToolkitID = wp
Match ^/index\.php/.*$ Rewrite /index.php?$1
}

VirtualHost {
Hostname = xiazhengxin.cn
WebsiteRoot = /home/http/xiazhengxin_cn
StartFile = index.php
# ExecuteCGI = yes
UseFastCGI = PHP5
UseToolkit = wp
}


主文件配置完成后,如果用到了fastcgi的话,还要编辑下同目录下php-fcgi.conf 文件.

Server = <php-cgi executable>;<binding>;<UID>[:<GIDs>][;<PHP configuration file>]
这样的格式定义好fastcgi 位置.

如我的:
Server = /usr/local/sbin/php-fpm ; 127.0.0.1:9000 ; http:web


更多配置参见:http://www.hiawatha-webserver.org/howto/cgi_and_fastcgi

一切完成后,hiawatha -k 测试配置文件.
没有问题后,hiawatha 启动服务器.
[ ] ( 1771 次浏览 ) 永久链接 ( 3 / 2711 )

<< <上一页 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 下一页> >>