Difference between revisions of "Adminer"

From ArchWiki
Jump to: navigation, search
m (Corrected "simplier alternative" to "simpler alternative")
(Added Elasticsearch, removed note since this has been fixed in the package)
 
(33 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Category:Web Server]]
+
[[Category:Web server]]
 
[[cs:Adminer]]
 
[[cs:Adminer]]
[http://www.adminer.org/ Adminer] is a simple tool for database management. It's possible to manage [[MySQL]], [[PostgreSQL]], [[Sqlite3]], MS SQL and [[Oracle]]. It's a simpler alternative to [[PhpMyAdmin]]. More pieces of information about this project you can find at [http://www.adminer.org/en/ official page] or [[Wikipedia:Adminer | wikipedia]].
+
[[ja:Adminer]]
 +
[http://www.adminer.org/ Adminer] is a web-based tool for database management. It's possible to manage [[MySQL]], [[PostgreSQL]], [[Sqlite3]], MS SQL, [[Oracle]] and [[Elasticsearch]].
  
== Installation under Apache ==
+
It's a simpler alternative to [[PhpMyAdmin]]. You can find more pieces of information about this project at the [http://www.adminer.org/en/ official page] or at [[Wikipedia:Adminer|Wikipedia]].
* Ensure you do not have an older copy of adminer.
+
$ rm -r /srv/http/adminer
+
  
* To install {{AUR|adminer}} just simply run [[Yaourt|yaourt]]:
+
== Installation ==
$ yaourt -S adminer
+
[[Install]] the {{AUR|adminer}} package or [https://www.adminer.org/#download download Adminer] and place it manually in the document-root instead.
 +
 
 +
When using the {{AUR|adminer}} package, Adminer will be installed as {{ic|/usr/share/webapps/adminer/index.php}}.
 +
 
 +
Ensure the correct extensions in {{ic|/etc/php/php.ini}} are uncommented, e.g. {{ic|<nowiki>extension=pdo_mysql.so</nowiki>}} should provide [[MySQL]] database management.
 +
 
 +
== Configuration ==
 +
 
 +
=== Apache ===
 +
 
 +
Add the following line to {{ic| /etc/httpd/conf/httpd.conf}}:
  
* After installation it's neccessary to add following line to {{ic| /etc/httpd/conf/httpd.conf}}:
 
 
  Include conf/extra/httpd-adminer.conf
 
  Include conf/extra/httpd-adminer.conf
  
It can be done by running:
+
Then [[restart]] your [[apache]] daemon.
# echo "Include conf/extra/httpd-adminer.conf" >> /etc/httpd/conf/httpd.conf
+
 
 +
Adminer can now be accessed by browsing to [http://localhost/adminer http://localhost/adminer].
 +
 
 +
=== Nginx ===
 +
 
 +
Ensure that the [[nginx#PHP configuration|php FastCGI interface]] is configured correct.
 +
 
 +
Then add the following {{ic|server}} block to your {{ic|/etc/nginx/nginx.conf}} or place it in a file under {{ic|/etc/nginx/servers-available/}} and [[nginx#Managing server entries|enable]] it:
 +
{{hc|/etc/nginx/nginx.conf|<nowiki>
 +
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;
 +
        }
 +
}
 +
</nowiki>}}
 +
 
 +
Afterwards [[restart]] [[nginx]].
 +
 
 +
=== Hiawatha ===
 +
 
 +
Ensure that the [[Hiawatha#PHP|php FastCGI interface]] is configured correct.
 +
 
 +
Then add the following {{ic|VirtualHost}} block to your {{ic|/etc/hiawatha/hiawatha.conf}}.
 +
{{hc|head=/etc/hiawatha/hiawatha.conf|output=
 +
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
  
* After it restart your [[LAMP|apache]] daemon. If you are using systeminit run :
+
}
# rc.d restart httpd
+
}}
  
* And if you are using systemd run :
+
Then [[restart]] the {{ic|hiawatha.service}}.
# systemctl restart httpd
+
  
{{Note | The Adminer can be accessed by your browser on [http://localhost/adminer http://localhost/adminer] }}
+
== See also ==
  
== External links ==
 
 
* [http://www.adminer.org/en/ Official Adminer webpage]
 
* [http://www.adminer.org/en/ Official Adminer webpage]
* [https://aur.archlinux.org/packages.php?ID=41492 Adminer on AUR]
 
 
* [http://php.vrana.cz/ Author's weblog]
 
* [http://php.vrana.cz/ Author's weblog]
* [http://en.wikipedia.org/wiki/Adminer Adminer on Wikipedia]
 

Latest revision as of 10:27, 18 October 2016

Adminer is a web-based tool for database management. It's possible to manage MySQL, PostgreSQL, Sqlite3, MS SQL, Oracle and Elasticsearch.

It's a simpler alternative to PhpMyAdmin. You can find more pieces of information about this project at the official page or at Wikipedia.

Installation

Install the adminerAUR package or download Adminer and place it manually in the document-root instead.

When using the adminerAUR package, Adminer will be installed as /usr/share/webapps/adminer/index.php.

Ensure the correct extensions in /etc/php/php.ini are uncommented, e.g. extension=pdo_mysql.so should provide MySQL database management.

Configuration

Apache

Add the following line to /etc/httpd/conf/httpd.conf:

Include conf/extra/httpd-adminer.conf

Then restart your apache daemon.

Adminer can now be accessed by browsing to http://localhost/adminer.

Nginx

Ensure that the php FastCGI interface is configured correct.

Then add the following server block to your /etc/nginx/nginx.conf or place it in a file under /etc/nginx/servers-available/ and enable it:

/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;
        }
}

Afterwards restart nginx.

Hiawatha

Ensure that the php FastCGI interface is configured correct.

Then add the following VirtualHost block to your /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

}

Then restart the hiawatha.service.

See also