我一直在尝试设置一个 lighttpd 来托管网站,但是当我运行像
systemctl start lighttpd
或 systemctl status lighttpd.service
这样的命令时,我不断地出错。
运行
systemctl start lighttpd
后,我得到以下信息:
Job for lighttpd.service failed because the control process exited with error code.
在我运行
systemctl status lighttpd.service
之后我得到以下信息:
lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/lighttpd.service.d
└─dietpi.conf
Active: failed (Result: exit-code) since Sun 2023-04-23 22:27:55 BST; 9s ago
Process: 209906 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)
CPU: 10ms
Apr 23 22:27:55 iphone systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Apr 23 22:27:55 iphone systemd[1]: Stopped Lighttpd Daemon.
Apr 23 22:27:55 iphone systemd[1]: lighttpd.service: Start request repeated too quickly.
Apr 23 22:27:55 iphone systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Apr 23 22:27:55 iphone systemd[1]: Failed to start Lighttpd Daemon.
我也跑了这个,
lighttpd -t -f /etc/lighttpd/lighttpd.conf
我明白了:
2023-04-23 21:47:27: configfile.c.1909) source: /etc/lighttpd/lighttpd.conf line: 2 pos: 1 invalid character in variable name
2023-04-23 21:47:27: configfile.c.1967) configfile parser failed at: (
我试过重新安装它,清除所有剩余的 apache 文件,甚至 Pihole 都无法正常工作,因为网页被搞砸了,它甚至不再加载了。我试过像很多人说的那样更新所有内容并安装 Gamin,但我在任何地方都看不到这个问题的任何解决方案。
2023-04-23 21:47:27: configfile.c.1909) source: /etc/lighttpd/lighttpd.conf line: 2 pos: 1 invalid character in variable name
lighttpd 已经告诉你配置文件中问题的确切位置,/etc/lighttpd/lighttpd.conf 第 2 行的第一个字符。 lighttpd 甚至告诉你错位的字符:
(
。去修理它。