Django flup lighttpd环境下使用FastCGI和WSGI

基本的架构如下:

  • Django 使用 flup 提供一个 WSGI 接口的服务
  • lighttpd 使用 FastCGI 来访问 flup 提供的 WSGI 接口,然后在 http 层面为访问者服务
  • http-lighttpd-FastCGI-WSGI-flup-Django …

小内存环境下配置 php mysql lighttpd

lighttpd 修改 /etc/lighttpd/conf-enabled/15-fastcgi-php.conf

fastcgi.server += ( ".php" =>
        ((
                "bin-path" => "/usr/bin/php-cgi",
                "socket" => "/tmp/php.socket",
                "max-procs" => 1,
                "bin-environment" => (
                        "PHP_FCGI_CHILDREN" => "2",
                        "PHP_FCGI_MAX_REQUESTS" => "1000"
                ),
                "bin-copy-environment" => (
                        "PATH", "SHELL", "USER"
                ),
                "broken-scriptfilename" => "enable"
        ))
)

这里有一个 lighttpd 进程数量的计算公式。很适合 …

让 lighttpd 支持 wordpress clean url

首先,修改 /etc/lighttpd/lighttpd.conf 激活 mod_rewrite 模块。格式如下:

server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
)

然后在 /etc/lighttpd/conf-enabled/10-simple-vhost.conf 内添修改如下:

$HTTP["host"] == "rex.zhang.name" {
    server.document-root = "/www/"
    accesslog.filename = "/var/log …
“Stay hungry, Stay foolish.”