「Adminer」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎Nginx: 飜訳)
 
(同じ利用者による、間の1版が非表示)
26行目: 26行目:
 
=== Nginx ===
 
=== Nginx ===
   
[[nginx#PHP を動かす|php の FastCGI インターフェイス]]を正しく設定してください。
+
{{Note|[[nginx#PHP を動かす|php の FastCGI インターフェイス]]を正しく設定してください。}}
   
  +
{{ic|root}} で {{ic|/usr/share/webapps/adminer}} への[[Nginx#Managing_server_entries|サーバーエントリ]]を作成します。
そして以下の {{ic|server}} ブロックを {{ic|/etc/nginx/nginx.conf}} に追加するか {{ic|/etc/nginx/servers-available/}} 内のファイルに記述して[[nginx#サーバーブロック|有効化]]してください。
 
   
  +
{{hc|/etc/nginx/sites-available/adminer.conf|<nowiki>
その後 {{ic|systemctl restart nginx.service}} でサーバーを再起動してください。
 
 
{{hc|/etc/nginx/nginx.conf|<nowiki>
 
 
server {
 
server {
listen 80;
+
listen 443 ssl http2;
  +
listen [::]:443 ssl http2;
server_name db.domainname.dom;
 
root /usr/share/webapps/adminer;
 
   
  +
server_name adminer.domain;
# If you want to use a .htpass file, uncomment the three following lines.
 
  +
root /usr/share/webapps/adminer;
#auth_basic "Admin-Area! Password needed!";
 
#auth_basic_user_file /usr/share/webapps/adminer/.htpass;
 
#access_log /var/log/nginx/adminer-access.log;
 
   
  +
# Only allow certain IPs
error_log /var/log/nginx/adminer-error.log;
 
location / {
+
#allow 192.168.1.0/24;
  +
#deny all;
index index.php;
 
try_files $uri $uri/ /index.php?$args;
 
}
 
   
location ~ .php$ {
+
index index.php;
  +
include fastcgi.conf;
 
  +
location / {
#fastcgi_pass localhost:9000;
 
  +
try_files $uri $uri/ =404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
 
  +
}
fastcgi_index index.php;
 
  +
fastcgi_param SCRIPT_FILENAME /usr/share/webapps/adminer$fastcgi_script_name;
 
  +
error_page 404 /index.php;
}
 
  +
  +
# PHP configuration
  +
location ~ \.php$ {
  +
...
  +
}
 
}
 
}
 
</nowiki>}}
 
</nowiki>}}
  +
  +
{{ic|adminer.conf}} を {{ic|sites-enabled}} にシンボリックリンクを作成して、[[nginx]] を[[再起動]]してください。
   
 
=== Hiawatha ===
 
=== Hiawatha ===

2021年10月28日 (木) 15:56時点における最新版

Adminer はデータベースを管理するためのシンプルなツールです。MySQL, PostgreSQL, Sqlite3, MS SQL, Oracle, Elasticsearch を管理することが可能です。PhpMyAdmin よりもシンプルなツールとなっています。プロジェクトの詳細は 公式ページWikipedia を見て下さい。

インストール

AUR から adminerAURインストールしてください。あるいは Adminer のホームページから手動でダウンロードして適当な場所に配置してください。

adminerAUR パッケージを使用する場合、Adminer は /usr/share/webapps/adminer/index.php にインストールされます。

/etc/php/php.iniMySQL データベースを管理するのに必要な拡張をアンコメントしてください。例: extension=pdo_mysql.so

設定

Apache

以下の行を /etc/httpd/conf/httpd.conf に追加してください:

Include conf/extra/httpd-adminer.conf

そして Apache HTTP Server デーモンを再起動してください。

Adminer はブラウザで http://localhost/adminer からアクセスできます。

Nginx

ノート: php の FastCGI インターフェイスを正しく設定してください。

root/usr/share/webapps/adminer へのサーバーエントリを作成します。

/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.confsites-enabled にシンボリックリンクを作成して、nginx再起動してください。

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再起動します。

参照