git地址

git://github.com/kolanos/kohana-captcha.git

在 bootstrap.php 中开启

view中的写法

controller中的写法

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Kohana v3 captcha module 简单用法

是在qeephp论坛看到的一条规则,排除所有带 “.”的请求,其余的全部重写向index.php

[ISAPI_Rewrite]
RewriteCond Host: www.xxx.com
RewriteRule ^([^.]+)$ /index.php/$1 [L]

由于sitemap模块动态生成 sitemap.xml,所以也需要重写向index.php

RewriteCond Host: www.xxx.com
RewriteRule /sitemap.xml /index.php/sitemap [L]

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Kohana v3 IIS rewrite 规则

测试环境

YardVPS $3.5套餐 (之前的介绍)

Debian 5 + Nginx0.7.67 + php5.3.3 + php5-fpm + mysql5.0.51

测试站:购乐宝

缓存方式:apc

测试方式 webbench 10并发 30秒

 

$webbench -t 30 -c 10 http://www.golebo.com/

不使用用户缓存 最好结果

Benchmarking: GET http://www.golebo.com/
10 clients, running 30 sec.
Speed=866 pages/min, 408085 bytes/sec.
Requests: 433 susceed, 0 failed.

 

使用用户缓存,最好结果

Benchmarking: GET http://www.golebo.com/
10 clients, running 30 sec.
Speed=8260 pages/min, 3907868 bytes/sec.
Requests: 4130 susceed, 0 failed.

 

10倍的速度提升,相信启用缓存非常有效!

 

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: kohana 启用cache模块,采用apc缓存用户数据,令并发连接性能提高10倍

kohana官方手册中的规则有点小问题,这是我测试通过的规则

红色的地方是特别注意的地方,要求nginx版本> 0.7.31

debian 5 现在的Nginx才在0.6.x  之前试了很久都出错

现在使用

Dotdeb的 php5.3 php5-fpm php5-cgi

debian 6 中的 nginx 0.7.67

server {
    server_name  golebo.com;
    root   /home/xxxx/www/golebo.com;

    location / {
        index  index.html index.htm index.php default.php;
        try_files $uri $uri/ /index.php$uri?$args;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    location ~ ^(.+.php)(.*)$ {
        fastcgi_split_path_info ^(.+.php)(.*)$;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param  PATH_INFO          $fastcgi_path_info;
        include        fastcgi_params;
    }
}

原创文章,转载请注明: 转载自贝壳博客

本文链接地址: Kohana v3 Nginx rewrite 规则