1 (edited by phyt 2016-05-11 04:58:06)

Topic: need little help setting up Adminer on Nginx / iRedMail

======== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.5.1 (upgraded from 0.9.4)
- Linux/BSD distribution name and version:  ubuntu 14.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MYSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hi all,
I have iRedmail running for my own mail for little while now.
Its all running good, I am working on my backup/restore setup.
So I wanted to install phpmyadmin, but it seems obsolete and Adminer is the way to go.
I am not experiencied with nginx yet, so I hope you guys can help me in the right directions.

I am confused what files to edit, in /etc/nginx/... to get the Adminer to work.

Steps taken so far:

1) mkdir -p /usr/local/nginx/adminer
2) cd /usr/local/nginx
3) wget [url]http://www.adminer.org/latest.php[/url] -O /usr/local/nginx/adminer/index.php
4) chown -R www-data:www-data /usr/local/nginx/adminer

Here I am stuck cause I don't know what .confs to edit to get https://host.org/adminer to work.

If you need more info please let me know.

kind regards,

Phyt

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: need little help setting up Adminer on Nginx / iRedMail

Try this:

wget http://www.adminer.org/latest.php -O /var/www/adminer.php
chmod +x /var/www/adminer.php

Then access URL: http://<your_server>/adminer.php

3

Re: need little help setting up Adminer on Nginx / iRedMail

A better solution: HTTPS only.

*) Download adminer:

mkdir /opt/www/adminer/
cd /opt/www/adminer/
wget http://www.adminer.org/latest.php

*) Create file /etc/nginx/templates/adminer.tmpl:

# Sample setting for Adminer: http://adminer.org/

# Warning: for security concern, it's recommended to change the URL '/adminer'
#          to another random string to avoid login attempts from bad guys.
#          for example, change the url to '^/HIoWCwogSHukIbGL'.
location ~ ^/adminer {
    include fastcgi_params;
    fastcgi_pass php_workers;
    fastcgi_index latest.php;
    fastcgi_param SCRIPT_FILENAME /opt/www/adminer/latest.php;
}

*) Edit /etc/nginx/conf.d/default.conf, include this new template in https block:

server {
    listen 443;
    ...

    # Web applications.
    include /etc/nginx/templates/adminer.tmpl;
    include /etc/nginx/templates/roundcube.tmpl;
    ...
}

*) Restart Nginx.

Note: this will be part of next iRedMail release, but this Nginx template is disabled by default, and no adminer downloaded on your server.

4 (edited by phyt 2016-05-11 23:35:40)

Re: need little help setting up Adminer on Nginx / iRedMail

Thanks, for your reply, I will try the https only tonight.
Running iredmail with letsencrypt ssl, need to keep that A+ on sslabs wink.

Will let you know if it worked.

Yes! it's working.

I added these two lines for a little extra security so they cant bruteforce this page.
Maybe you can set it as default 172.0.0.1 for the next iRedMail release.

    allow <myipaddress>;
    deny all;

# Sample setting for Adminer: http://adminer.org/

# Warning: for security concern, it's recommended to change the URL '/adminer'
#          to another random string to avoid login attempts from bad guys.
#          for example, change the url to '^/HIoWCwogSHukIbGL'.
location ~ ^/adminer {
    include fastcgi_params;
    fastcgi_pass php_workers;
    fastcgi_index latest.php;
    fastcgi_param SCRIPT_FILENAME /opt/www/adminer/latest.php;

    allow <myipaddress>;
    deny all;
}

5

Re: need little help setting up Adminer on Nginx / iRedMail

phyt wrote:

Maybe you can set it as default 172.0.0.1 for the next iRedMail release.

Will add them by keeping commented out by default.

6

Re: need little help setting up Adminer on Nginx / iRedMail

Yea I think thats good to include.
thanks for your help smile.