Adminer
Adminer はデータベースを管理するためのシンプルなツールです。MySQL, PostgreSQL, Sqlite3, MS SQL, Oracle, Elasticsearch を管理することが可能です。PhpMyAdmin よりもシンプルなツールとなっています。プロジェクトの詳細は 公式ページ や Wikipedia を見て下さい。
インストール
AUR から adminerAUR をインストールしてください。あるいは Adminer のホームページから手動でダウンロードして適当な場所に配置してください。
adminerAUR パッケージを使用する場合、Adminer は /usr/share/webapps/adminer/index.php にインストールされます。
/etc/php/php.ini で MySQL データベースを管理するのに必要な拡張をアンコメントしてください。例: extension=pdo_mysql.so。
設定
Apache
以下の行を /etc/httpd/conf/httpd.conf に追加してください:
Include conf/extra/httpd-adminer.conf
# systemctl restart httpd
Nginx
php の FastCGI インターフェイスを正しく設定してください。
そして以下の server ブロックを /etc/nginx/nginx.conf に追加するか /etc/nginx/servers-available/ 内のファイルに記述して有効化してください。
その後 systemctl restart nginx.service でサーバーを再起動してください。
/etc/nginx/nginx.conf
server {
listen 80;
server_name db.domainname.dom;
root /usr/share/webapps/adminer;
# If you want to use a .htpass file, uncomment the three following lines.
#auth_basic "Admin-Area! Password needed!";
#auth_basic_user_file /usr/share/webapps/adminer/.htpass;
#access_log /var/log/nginx/adminer-access.log;
error_log /var/log/nginx/adminer-error.log;
location / {
index index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ .php$ {
include fastcgi.conf;
#fastcgi_pass localhost:9000;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/webapps/adminer$fastcgi_script_name;
}
}
Hiawatha
FastCGI インターフェイスを正しく設定してください。
そして以下の VirtualHost ブロックを /etc/hiawatha/hiawatha.conf に追加してください:
/etc/hiawatha/hiawatha.conf
VirtualHost {
# If you set WebsiteRoot to /usr/share/webapps/adminer you don't 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 を再起動します。