使用 lighttpd 设置管理员时出现问题

使用 lighttpd 设置管理员时出现问题

我该如何设置管理员与 lighttpd ?我使用“sudo apt-get install adminer”从存储库安装了 Adminer。并运行以下命令。

sudo wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/latest.php
sudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php
echo "Alias /adminer.php /usr/share/adminer/adminer.php" > /etc/lighttpd/conf-available/10-adminer.conf
sudo service lighttpd restart

这是conf-enabled 中的符号链接。

$ ls -la conf-enabled
total 8
drwxr-xr-x 2 root root 4096 Apr 14 17:26 .
drwxr-xr-x 4 root root 4096 Apr  4 11:34 ..
lrwxrwxrwx 1 root root   33 Apr 14 17:26 10-adminer.conf -> ../conf-available/10-adminer.conf
lrwxrwxrwx 1 root root   33 Apr  4 11:36 10-fastcgi.conf -> ../conf-available/10-fastcgi.conf
lrwxrwxrwx 1 root root   37 Apr  4 11:36 15-fastcgi-php.conf -> ../conf-available/15-fastcgi-php.conf
lrwxrwxrwx 1 root root   42 Jan  1  1970 90-javascript-alias.conf -> ../conf-available/90-javascript-alias.conf

这是10-adminer.conf的内容

$ cat conf-enabled/10-adminer.conf
Alias /adminer.php /usr/share/adminer/adminer.php

但是当我重新启动lighttpd时,出现以下错误:

Job for lighttpd.service failed. See 'systemctl status lighttpd.service' and 'journalctl -xn' for details.

'systemctrl status lighttpd.service' 产生:

● lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled)
Active: failed (Result: exit-code) since Thu 2016-04-14 17:43:32 CEST; 36s ago
Process: 21057 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Process: 31301 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
Main PID: 21057 (code=exited, status=0/SUCCESS)

答案1

问题是我使用的是 Apache conf 语法而不是 lighttpd conf 语法。我按如下方式更改了 10-adminer.conf。

alias.url = ( "/adminer.php" => "/usr/share/adminer/adminer.php" )

现在它已按预期工作。

相关内容