Adminer 是一個用 PHP 編寫的基於網絡的資料庫管理工具。它可以管理 MySQL、PostgreSQL、Sqlite3、MS SQL、Oracle 資料庫和 Elasticsearch。
它是 PhpMyAdmin 的一個更簡單的替代方案。你可以在官方網站頁或 Wikipedia 找到更多關於這個項目的信息。
安裝
安裝 adminerAUR 軟體包或下載 Adminer,然後將其手動放置在 document-root 中。
使用 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 伺服器守護進程。
現在可以通過瀏覽 http://localhost/adminer 訪問 Adminer。
Nginx
注意:確保已正確配置PHP FastCGI 接口。
以 root 權限使用/usr/share/webapps/adminer 創建 server entry:
/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 接口。
然後在 /etc/hiawatha/hiawatha.conf 中添加以下 VirtualHost 塊。
/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。