Difference between revisions of "Adminer"

From ArchWiki
Jump to navigation Jump to search
(improve install link as recommended in Help:Style#Package management instructions)
(added Nginx section)
Line 2: Line 2:
 
[[cs:Adminer]]
 
[[cs:Adminer]]
 
[[ja:Adminer]]
 
[[ja: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]]. You can find more pieces of information about this project at [http://www.adminer.org/en/ official page] or [[Wikipedia:Adminer|Wikipedia]].
+
[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]]. You can find more pieces of information about this project at the [http://www.adminer.org/en/ official page] or at [[Wikipedia:Adminer|Wikipedia]].
  
 
== Installation ==
 
== Installation ==
  
Ensure you do not have an older copy of Adminer:
+
Ensure you do not have a manually downloaded copy of Adminer!
$ rm -r /srv/http/adminer
+
 
 +
[[Install]] {{AUR|adminer}} from the [[AUR]].
 +
 
 +
[[Install]] {{Pkg|php-sqlite}}.
 +
 
 +
Adminer will be installed as {{ic|/usr/share/webapps/adminer/index.php}}.
 +
 
 +
Don't forget to enable {{Pkg|php-sqlite}} in your {{ic|/etc/php/php.ini}} by uncommenting following line:
 +
  extension=sqlite3.so
  
[[Install]] {{AUR|adminer}} from the [[AUR]] and add the following line to {{ic| /etc/httpd/conf/httpd.conf}}:
+
{{Warning|As of PHP 5.5, {{ic|mysql.so}} is [http://www.php.net/manual/de/migration55.deprecated.php deprecated] and will fill up your log files with error messages. It is no longer available in PHP 7.0.}}
  
 
== Configuration under Apache ==
 
== Configuration under Apache ==
 +
 +
Add the following line to {{ic| /etc/httpd/conf/httpd.conf}}:
  
 
  Include conf/extra/httpd-adminer.conf
 
  Include conf/extra/httpd-adminer.conf
Line 30: Line 42:
 
Restart the [[restart]] [[apache]] daemon again.  
 
Restart the [[restart]] [[apache]] daemon again.  
 
  # systemctl restart httpd
 
  # systemctl restart httpd
 +
 +
== Configuration under Nginx ==
 +
 +
Ensure that the [[nginx#PHP configuration|php FastCGI interface]] is configured correct.
 +
 +
Then ad the folwing {{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.
 +
 +
Afterwards restart the server with {{ic|systemctl restart nginx.service}}.
 +
 +
{{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>}}
  
 
== See also ==
 
== See also ==

Revision as of 11:35, 14 December 2015

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. You can find more pieces of information about this project at the official page or at Wikipedia.

Installation

Ensure you do not have a manually downloaded copy of Adminer!

Install adminerAUR from the AUR.

Install php-sqlite.

Adminer will be installed as /usr/share/webapps/adminer/index.php.

Don't forget to enable php-sqlite in your /etc/php/php.ini by uncommenting following line:

 extension=sqlite3.so
Warning: As of PHP 5.5, mysql.so is deprecated and will fill up your log files with error messages. It is no longer available in PHP 7.0.

Configuration under Apache

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

Include conf/extra/httpd-adminer.conf

Then restart your apache daemon.

# systemctl restart httpd
Note: The Adminer can be accessed by your browser on http://localhost/adminer.

In case there is an (403) error, change the following lines inside the /etc/httpd/conf/extra/httpd-adminer.conf file:

Alias /adminer "/usr/share/webapps/adminer"
<Directory "/usr/share/webapps/adminer">
     AllowOverride All
     Require all granted
     #php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:/usr/share/pear/"
</Directory>

Restart the restart apache daemon again.

# systemctl restart httpd

Configuration under Nginx

Ensure that the php FastCGI interface is configured correct.

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

Afterwards restart the server with 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;
        }
}

See also