3

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

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 !

Omiga
  • 572
  • 3
  • 11
  • 1
    Have you tried putting "/blog$" => "$0" as the first line in the rewrite rule? – MGP Feb 25 '13 at 16:05
  • 1
    Check this, could help. http://stackoverflow.com/questions/8295096/lighttpd-rewrite-for-wordpress-inside-cakephp?rq=1 – MGP Feb 25 '13 at 16:15

2 Answers2

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

 }
MGP
  • 2,981
  • 35
  • 34
1

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

Omiga
  • 572
  • 3
  • 11
  • Glad it works, I use lighty a lot but with mod simple-vhost, adding sites is a no brainer. – MGP Feb 27 '13 at 18:05