10

I'm trying to install Adminer from Ubuntu repository using:

sudo apt install adminer

Installation works fine but can't find the file /etc/adminer/apache.conf to use with Apache server. The folder /etc/adminer/ is empty and can't find it anywhere with find command.

Any help? Thanks in advance.

karim
  • 127
  • 1
  • 1
  • 9

3 Answers3

18

In the next few steps, I'll show you how I installed adminer for Ubuntu 18.04.1 LTS .

  1. After installation with apt package manager change into the adminer directory.

    cd /usr/share/adminer
    

    There you will find a file called compile.php.

  2. Run the following command and the adminer-X.X.X.php (X.X.X for your version) file will be created.

    sudo php compile.php
    
  3. Create the apache adminer configuration file.

    sudo echo "Alias /adminer.php /usr/share/adminer/adminer-X.X.X.php" | sudo tee /etc/apache2/conf-available/adminer.conf
    
  4. Now you'll need to activate the configuration.

    cd /etc/apache2/conf-available/
    sudo a2enconf adminer.conf
    
  5. Reload your apache webserver.

    sudo systemctl reload apache2.
    
  6. Test in your browser of choice (localhost/adminer.php)

This source was really helpful:
https://www.linuxhelp.com/how-to-install-adminer-on-ubuntu-16-04/

Dominik K
  • 399
  • 3
  • 9
  • I would be interested in the reason why the compile part is needed. – Jakuje Oct 26 '19 at 17:05
  • According to their [github repository](https://github.com/vrana/adminer) `compile.php` is to create a single file version of adminer, where everything (php, css, html, ...) is minified. – Dominik K Oct 28 '19 at 13:32
  • And why I should do that when the file in `/usr/share/adminer/adminer.php` (which is shipped by the adminer package) is already minified? – Jakuje Oct 28 '19 at 20:25
  • 1
    The file `/usr/share/adminer/adminer.php` does not exist after installing adminer via apt. Not on Ubuntu 18.04 LTS nor on Debian 10. – Dominik K Oct 29 '19 at 08:30
  • It does for me on Ubuntu 19.10 though. – Jakuje Oct 29 '19 at 10:07
  • 1
    That's right. If you look at the package source of adminer in Ubuntu 19.10, you can see that they are running `php compile.php` automatically during the installation process (see *adminer-4.7.2/debian/rules*). – Dominik K Oct 29 '19 at 11:00
  • I think that is better thing to do, than expecting users to run it on their own. – Jakuje Oct 29 '19 at 11:35
  • I'm with you on that! – Dominik K Oct 29 '19 at 13:05
6

Install Apache:

sudo apt-get install apache2

Install PHP:

sudo apt-get install php libapache2-mod-php php-mysql

Install Adminer:

sudo wget "http://www.adminer.org/latest.php" -O /var/www/html/adminer.php

Once the installation completes, restart Apache.

sudo service apache2 restart 

At this point, the setup is complete. You can access Adminer at the following address.

http://[SERVER_IP]/adminer.php
Valsaraj Viswanathan
  • 1,473
  • 5
  • 28
  • 51
0

For Ubuntu 22.04

Install Apache and adminer 4.8.1 (all required components will be installed):

sudo apt install apache2 adminer

enable adminer config

sudo a2enconf adminer
sudo service apache2 restart 

At this point, the setup is complete. You can access Adminer at the following address.

http://[SERVER_IP]/adminer/conf.php

if newer version is available:

sudo wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/adminer.php
anmg
  • 11
  • 3