lnmp是现在相对比较容易和被大家所接受的一个套装。由于我用的是Sablog所以我在设定vhost的时候就选了sablog,但是告诉我第二行出错了。

仔细检查了一下,好象确实是有这个问题,一来好象是编码也有问题,二来它copy的规则有点象是discuz的规则,和sablog系统后台中的规则不一样。所以,我根据 sablog后台中的规则进行了修正,立刻正常了。
sablog的默认规则是支持apache的rewrite的。如下:

# BEGIN Sablog-X
RewriteEngine On
RewriteBase /
# 文章
RewriteRule ^show-([0-9]+)-([0-9]+)\.shtml$ index.php?action=show&id=$1&page=$2
# 分类
RewriteRule ^category-([0-9]+)-([0-9]+)\.shtml$ index.php?action=index&cid=$1&page=$2
# 只带月份的归档
RewriteRule ^archives-([0-9]+)-([0-9]+)\.shtml$ index.php?action=index&setdate=$1&page=$2
# 用户列表、高级搜索、注册、登陆
RewriteRule ^(archives|search|reg|login|index|links)\.shtml$ index.php?action=$1
# 全部评论、标签列表、引用列表 带分页
RewriteRule ^(comments|tagslist|trackbacks|index)-([0-9]+)\.shtml$ index.php?action=$1&page=$2
# END Sablog-X

注意那个.shtml,那是我自定义的URL后缀,所以你看我的博客的时候,都有这玩意。。。将就点了。说实话,我怀疑这个shtml对SEO有友好度,所以我才这么配置(纯属猜测)
改完后配置是这样的:

location / {

rewrite ^/show-([0-9]+)-([0-9]+)\.shtml$ /index.php?action=show&id=$1&page=$2 last;
rewrite ^/category-([0-9]+)-([0-9]+)\.shtml$ /index.php?action=index&cid=$1&page=$2 last;
rewrite ^/archives-([0-9]+)-([0-9]+)\.shtml$ /index.php?action=index&setdate=$1&page=$2 last;
rewrite ^/(archives|search|reg|login|index|links)\.shtml$ /index.php?action=$1 last;
rewrite ^/(comments|tagslist|trackbacks|index)-([0-9]+)\.shtml$ /index.php?action=$1&page=$2 last;
}

其实看到没,与apache下的配置很相像,只是在最前面加了 ^/ ,然后在指向的文件前加 /
同时在最后加 last;
嗯,就这样。。。灰常方便,你换了没?