跳转至内容

Adminer

来自 ArchWiki

Adminer 是一个用PHP编写的基于Web的数据库管理工具。它可以管理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:///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

参见

© . This site is unofficial and not affiliated with Arch Linux.

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.