Adminer

来自 ArchWiki

Adminer 是一个基于 Web 的数据库管理工具,使用 PHP 编写。它可以管理 MySQLPostgreSQLSqlite3、MS SQL、Oracle 数据库和 Elasticsearch

它是 PhpMyAdmin 的一个更简洁的替代品。您可以在 官方页面Wikipedia 上找到关于此项目的更多信息。

安装

安装 adminerAUR 软件包,或者 下载 Adminer 并手动将其放置在文档根目录中。

当使用 adminerAUR 软件包时,Adminer 将被安装为 /usr/share/webapps/adminer/index.php

确保 /etc/php/php.ini 中正确的扩展被取消注释,例如 extension=pdo_mysql 应该提供 MySQL 数据库管理。

配置

Apache

注意: 确保 Apache 的 PHP 扩展 已正确配置

将以下行添加到 /etc/httpd/conf/httpd.conf

Include conf/extra/httpd-adminer.conf

然后 重启 您的 Apache HTTP Server 守护进程。

现在可以通过浏览 https://127.0.0.1/adminer 访问 Adminer。

Nginx

注意: 确保 PHP FastCGI 接口 已正确配置。

使用 /usr/share/webapps/adminer 作为 root 创建一个 服务器条目

/etc/nginx/sites-available/adminer.conf
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name adminer.domain;
    root /usr/share/webapps/adminer;

    # Only allow certain IPs 
    #allow 192.168.1.0/24;
    #deny all;

    index index.php;

    location / {
        try_files $uri $uri/ =404;
    }

    error_page 404 /index.php;

    # PHP configuration
    location ~ \.php$ {
      ...
    }
}

adminer.conf 符号链接到 sites-enabled重启 nginx

Hiawatha

确保 PHP FastCGI 接口 已正确配置。

然后将以下 VirtualHost 块添加到您的 /etc/hiawatha/hiawatha.conf

/etc/hiawatha/hiawatha.conf
VirtualHost {

    # If you set WebsiteRoot to /usr/share/webapps/adminer you do not need followsymlinks
    # I symlinked the adminer folder to '/srv/http/adminer' so that I can easily remember where it's located but
    # still set 'WebsiteRoot' to the real source directory. You could point WebsiteRoot to the
    # symlinked directory, but you will have to set 'FollowSymlinks = yes' for that to function properly

    Hostname = db.domainname.dom
    #FollowSymlinks = yes
    #WebsiteRoot = /srv/http/adminer
    WebsiteRoot = /usr/share/webapps/adminer
    AccessLogfile = /var/log/hiawatha/adminer/access.log
    ErrorLogfile = /var/log/hiawatha/adminer/error.log
    StartFile = index.php
    UseFastCGI = PHP7

}

然后 重启 hiawatha.service

参见