web2py and wordpress on lighttpd

I have python web2py installed on lighttpd server,
but i want to add wordpress for blogging,
the problem is i want wordpress to be on site.com/blog not as subdomain,
How can i manage lighttpd configuration to run!

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

also added fastcgi support for php-cgi

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

Couldn’t do it though,
any advices please !

Related posts

Leave a Reply

2 comments

  1. Try this rewrite:

    $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",
     )
    
     }
    
  2. Thanks guys in fact your comments helped me a lot to figure out the issue,
    it worked for me as follow:

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

    hope it helps someone later !
    Thanks