简体   繁体   English

Moin wiki 上没有 static 内容与 lighttpd/FastCGI

[英]No static content on Moin wiki with lighttpd/FastCGI

I have installed MoinMoin wiki on a Raspberry Pi 4 with lighttpd using FastCGI following mostly this guide: https://kia.jimmynguyen.co.nz/python/moin/wiki/lighttpd/2020/10/31/moin-wiki-installation-with-lighttpd.html我已经使用FastCGI在带有lighttpd的 Raspberry Pi 4 上安装了MoinMoin wiki,主要遵循本指南: https://kia.jimmynguyen.co.nz/python/moin/wiki/lighttpd/2020/10/31/moin-wiki-installation -with-lighthttpd.html

The problem is that it does not display any of moin static files, so it looks like this:问题是它不显示任何 moin static 文件,所以它看起来像这样: 在此处输入图像描述

I am kind of lost and don't know what to look for, so any help will be gold!我有点迷路,不知道要寻找什么,所以任何帮助都是金子!


I also have Pi-hole running on the same RPi.我也在同一个 RPi 上运行 Pi-hole。

I have installed moin with --prefix=/usr/local and my wiki instance is at /opt/wiki .我已经使用--prefix=/usr/local安装了 moin 并且我的 wiki 实例位于/opt/wiki

All static files are at /usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs/所有 static 文件都在/usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs/

My /etc/lighttpd/lighttpd.conf looks like this:我的/etc/lighttpd/lighttpd.conf看起来像这样:

    server.modules = (
    "mod_access",
    "mod_accesslog",
    "mod_auth",
    "mod_expire",
    "mod_redirect",
    "mod_setenv",
    "mod_rewrite",
    "mod_fastcgi"
    )
    
    server.document-root        = "/var/www/html"
    server.error-handler-404    = "/pihole/index.php"
    server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
    server.errorlog             = "/var/log/lighttpd/error-pihole.log"
    server.pid-file             = "/run/lighttpd.pid"
    server.username             = "www-data"
    server.groupname            = "www-data"
    
    ...
    ...
    ...
    
    $HTTP["url"] =~ "^/wiki/" {
        fastcgi.server += ( "/" =>
            ((
                "socket" => "/tmp/moin.socket",
                "min-procs" => 1,
                "max-procs" => 2,
                "check-local" => "disable",
                "bin-path" => "/opt/wiki/moin.fcgi",
                "fix-root-scriptname" => "enable"
            ))
        )
        alias.url += ( "/moin_static1911" => "/usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs/")
    }

After investing more time in this subject I followed the HelpOnConfiguration/IntegratingWithLighttpd advice:在这个主题上投入更多时间后,我遵循了HelpOnConfiguration/IntegratingWithLighttpd的建议:

Lighttpd 1.4 Lighttpd 1.4

MoinMoin is listening in FastCGI mode on port 22000. MoinMoin 正在端口 22000 上以 FastCGI 模式侦听。

 $HTTP["url"] =~ "^/wiki" { fastcgi.server = ("/wiki" => ( "mywiki" => ( "host" => "127.0.0.1", "port" => 22000, "check-local" => "disable", "broken-scriptfilename" => "enable" ) )) }

Also, 'alias.url' should not be inside wiki condition and I moved my code to 'external.conf'.此外,'alias.url' 不应在 wiki 条件内,我将我的代码移至 'external.conf'。

The result:结果:

# Add FastCGI module
server.modules += ( "mod_fastcgi",
                    "mod_alias"
                  )

$HTTP["url"] =~ "^/wiki" {
    fastcgi.server +=  ("/wiki" => ( "mywiki" =>
      ( "socket" => "/tmp/moin.socket",
        "min-procs" => 1,
        "max-procs" => 2,
        "check-local" => "disable",
        "bin-path" => "/opt/wiki/moin.fcgi"
      )
    ))
}
alias.url += ( "/moin_static1911" => "/usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs/")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM