2013-02-25 66 views
3

我已經安裝了lighttpd的服務器, 上蟒的web2py但我想補充的WordPress博客爲, 問題是我想WordPress的是對site.com/blog不是子域, 哪有我管理lighttpd配置運行!的web2py和WordPress上的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" 
      )) 
    ) 

無法做到這一點,雖然, 任何建議,請!

+1

您是否曾嘗試將「/ blog $」=>「$ 0」作爲重寫規則的第一行? – 2013-02-25 16:05:50

+1

檢查這個,可以幫助。 http://stackoverflow.com/questions/8295096/lighttpd-rewrite-for-wordpress-inside-cakephp?rq=1 – 2013-02-25 16:15:17

回答

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" 
      )) 

希望它可以幫助別人以後! 謝謝

+0

很高興它的工作原理,我使用lighty很多,但與MOD簡單的虛擬主機,添加站點是一個無腦。 – 2013-02-27 18:05:51

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", 
) 

}