"application/x-web-app-manifest+json") 添加到我的 lighty conf 文件中,但在-6ren">
gpt4 book ai didi

lighttpd - 将 mimetype.assign 添加到 lighttpd.conf 的问题

转载 作者:行者123 更新时间:2023-12-03 22:42:06 26 4
gpt4 key购买 nike

我试图将 mimetype.assign = ( ".webapp"=> "application/x-web-app-manifest+json") 添加到我的 lighty conf 文件中,但在重新启动时出错。

首先是conf文件:

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

server.document-root = "/var/www/servers/www.nope.dyndns.org/pages/"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80

mimetype.assign = ( ".webapp" => "application/x-web-app-manifest+json" )

index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

...和错误:
sudo /etc/init.d/lighttpd restart
Duplicate config variable in conditional 0 global: mimetype.assign
2014-01-03 21:12:55: (configfile.c.943) source: /usr/share/lighttpd/create-mime.assign.pl line: 500 pos: 1 parser failed somehow near here: (EOL)
2014-01-03 21:12:55: (configfile.c.943) source: /etc/lighttpd/lighttpd.conf line: 29 pos: 14 parser failed somehow near here: (EOL)

我猜测并将缺少的“application/x-web-app-manifest+json webapp”添加到/etc/mime.types 中的长长的 mime-types 列表中,但这并没有解决问题。

有任何想法吗?谢谢。

最佳答案

我希望你现在发现了,但是,为了那些在谷歌上搜索的人......

向数组添加值的正确语法是:

mimetype.assign   += ( ".webapp" => "application/x-web-app-manifest+json" )

注意“+=”;将新值合并到现有数组中。

关于lighttpd - 将 mimetype.assign 添加到 lighttpd.conf 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20911244/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com