3

我在 lighttpd 服务器上安装了 python web2py,但我想为博客添加 wordpress,问题是我希望 wordpress 在 site.com/blog 上而不是子域,我如何管理 lighttpd 配置以运行!

url.rewrite-once = (
           "^/$" => "/ad",
            "^(/.+?/static/.+)$" => "/applications$1",
            "(^|/.*)$" => "/fcgihandler.fcgi$1", <-- tried to exclude 
            "/blog$" => "$0", <-- tried to exclude /blog from rewriting
    )

还添加了对 php-cgi 的 fastcgi 支持

fastcgi.server = (
            ".fcgi" => ("localhost" => (
                    "check-local" => "disable",
                    "min-procs" => "1",
                    "max-procs" => "2",
                    "socket" => "/tmp/web2py.sock"
            )),
            ".php" => ("localhost" => (
                    "socket" => "/tmp/php.socket"
            ))
    )

虽然做不到,请大家多多指教!

4

2 回答 2

1

试试这个重写:

$HTTP["host"] =~ "domain.com" {

server.document-root = "/var/www/app/webroot/"
url.rewrite-once = (
       "^/blog/(.*)$" => "/blog/index.php/$1",
       "^/$" => "/ad",
        "^(/.+?/static/.+)$" => "/applications$1",
        "(^|/.*)$" => "/fcgihandler.fcgi$1",
 )

 }
于 2013-02-25T16:25:20.970 回答
1

谢谢大家,实际上您的评论对我解决问题有很大帮助,它对我有用,如下所示:

$HTTP["url"] =~ "^/blog(.*)$" {
            server.indexfiles = ("/")
            server.document-root = "/var/www"
    }


 url.rewrite-once = (
            "^/blog(.*)$" => "$0", <-- as @dhunter suggested 
            "^(/.+?/static/.+)$" => "/applications$1",
            "(^|/.*)$" => "/fcgihandler.fcgi$1",
    )

fastcgi.server = (
            ".fcgi" => ("localhost" => (
                    "check-local" => "disable",
                    "min-procs" => "1",
                    "max-procs" => "2",
                    "socket" => "/tmp/web2py.sock"
            )),
            ".php" => ((
                    "bin-path" => "/usr/bin/php-cgi",
                    "socket" => "/tmp/php.socket"
            ))

希望以后对某人有所帮助!谢谢

于 2013-02-26T10:40:26.453 回答