Apache DBD 与 sqlite3

Apache DBD 与 sqlite3

我正在尝试让 apache 从 sqlite3 数据库加载基本身份验证凭据。

我尝试过的配置(以及许多其他变体)是:

<VirtualHost *>
    ServerAdmin [email protected]
    ServerName git.example.com
    ErrorLog "/var/log/httpd/git-error_log"
    CustomLog "/var/log/httpd/git-access_log" common
    DocumentRoot "/usr/share/cgit/"
    DBDriver sqlite3
    DBDParams "/home/git/db.sqlite"
    DBDMin 1
    DBDKeep 2
    DBDMax 10
    DBDExptime 60

    <Directory "/usr/share/cgit/">
        AuthType Basic 
        AuthName Test 
        AuthBasicProvider dbd 
        Require valid-user 
        AuthDBDUserPWQuery "SELECT pw AS password FROM cgit_passwords WHERE uid=%s" 
        AllowOverride None
        Options ExecCGI FollowSymlinks
        Order deny,allow
        Allow from all
    </Directory>

    Alias /cgit.css "/usr/share/cgit/cgit.css"
    Alias /cgit.png "/usr/share/cgit/cgit.png"
    Alias /favicon.ico "/usr/share/cgit/favicon.ico"
    #ScriptAlias / "/var/www/cgi-bin/cgit/"
    #Alias /cgit-data "/usr/share/cgit"
</VirtualHost>

然而,阿帕奇抱怨说:

[dbd:error] [pid 16673] (20014)内部错误: AH00629: 无法连接到 sqlite3: 无法打开数据库文件

这没有道理。我已经为 apache 用户启用了 shell,使用 登录su - apache,我可以打开数据库并执行操作"/home/git/db.sqlite"

相关内容