如果我尝试添加子域,我无法启动lighttpd。当我尝试加载包含以下行的配置文件时,出现了一些错误,但没有进一步的详细信息:
$HTTP["host"] == "sub.localhost" {
server.document-root = "/var/www
}子域没有自己的文件夹。所以使用mod_simple_vhost是行不通的。
错误消息:
● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since So 2016-11-20 16:59:43 CET; 3s ago
Process: 7568 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Process: 26067 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Main PID: 7568 (code=exited, status=0/SUCCESS)
Nov 20 16:59:43 mantra systemd[1]: Starting Lighttpd Daemon...
Nov 20 16:59:43 mantra lighttpd[26067]: 2016-11-20 16:59:43: (configfile.c.898) source: /etc/lighttpd/lighttpd.conf lin
Nov 20 16:59:43 mantra lighttpd[26067]: 2016-11-20 16:59:43: (configfile.c.954) configfile parser failed at: ] ==
Nov 20 16:59:43 mantra systemd[1]: lighttpd.service: Control process exited, code=exited status=255
Nov 20 16:59:43 mantra systemd[1]: Failed to start Lighttpd Daemon.
Nov 20 16:59:43 mantra systemd[1]: lighttpd.service: Unit entered failed state.
Nov 20 16:59:43 mantra systemd[1]: lighttpd.service: Failed with result 'exit-code'.有什么建议吗?
发布于 2016-11-26 19:39:34
您发布的示例在server.document-root = "/var/www"行的末尾缺少右双引号
这可能是你的文章中的一个打字错误,但无论如何,来自lighttpd的错误消息会向你报告你的lighttpd.conf中出现错误的行号。请查看lighttpd.conf中的这一行,并确保语法正确。
参考:https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_Configuration
https://stackoverflow.com/questions/40706285
复制相似问题