joomla 在Niginx下的rewrite规则很简单,主要就是红色部分
如果出现502错误,请参看前一篇介绍
server {
  server_name www.xxx.com;
  root /home/xxx/www/www.xxx.com;
  index index.php index.html;
 
  location / {
    try_files $uri $uri/ /index.php?q=$request_uri;
  }
 
  location ~ .php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

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

本文链接地址: Joomla Nginx rewrite

[ISAPI_Rewrite]
RewriteRule ^/admin(.*) /admin/$1 [L]
RewriteRule ^/(.*)(html|htm)$ /index.php/$1$2 [L]
RewriteRule ^([^.]+)$ /index.php/$1 [L]

说明一下
第一条 重定向后台地址
第二条 将带html htm 后缀的重写
第三条 排除带”.”的 其余的全部重写
缺点:
使用像 google网站管理员 通过html文件来验证的时候麻烦一点
得在前面添加一条
RewriteRule /google26f74facfee37a5d.html $0 [L]

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

本文链接地址: typecho IIS rewrite 规则

phurl是一款非常优秀的PHP开源短网址服务程序,官方提供了基于apache的rewrite规则,这里给出我写的基于IIS的rewrite规则

而现在大部分国内IDC使用的是基于IIS的全能型主机,如果你购买的就是IIS主机,那么这条规则你一定用得上!

[ISAPI_Rewrite]

RewriteRule ^/([a-zA-Z0-9_-]+)$ /redirect.php?alias=$1

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

本文链接地址: phurl IIS Rewrite 规则

是在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倍

今天装完joomla,能进后台,但是前台一直报502 Bad Gateway错误,网上搜索后找到解决办法,是由于Nginx中FastCGI buffer不够,这是张宴前辈的配置
修改nginx.conf,添加如下fastcgi设置
http {

  ********

    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 128k;
  *******
}

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

本文链接地址: 解决由FastCGI Buffer不够引起的Joomla 在Nginx下出现 502 Bad Gateway 错误

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 规则

location / {
        index  index.html index.htm index.php;

        if (-f $request_filename/index.html){
            rewrite (.*) $1/index.html break;
        }
        if (-f $request_filename/index.php){
            rewrite (.*) $1/index.php;
        }
        if (!-f $request_filename){
            rewrite (.*) /index.php;
        }

    }

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

本文链接地址: typecho Nginx rewrite 规则

安装mysql

apt-get install mysql-server

安装php

apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-imagick php5-mcrypt  php5-sqlite php-apc

安装Nginx

apt-get install nginx

安装spawn-fcgi

$wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
$tar -xvf spawn-fcgi-1.6.3.tar.gz
$cd spawn-fcgi-1.6.3
$./configure –prefix=/usr
$make

$sudo make install

启动php5-cgi
$spawn-fcgi -a 127.0.0.1 -p 9000  -u www-data -g www-data -f /usr/bin/php5-cgi

配置Nginx

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

本文链接地址: Debian5 安装Nginx+php(spawn-fcgi) + Mysql