Integrate phpMyAdmin into the virtualmin GUI

I would like it where phpMyAdmin was directly available from within Virtualmin (via the menu) for that particular user without the need to use a password. This would work just like it does in cPanel and would only require 1 installation of the script.

There would possible need to settable controls over the features and options of phpMyAdmin.

This would complement the new additional MySQL Pro feature.

There are several ways to install phpMyAdmin in one place and make it available for all your clients currently.

I like everything for free :smile: , however I could see this being a good Pro feature.

For reference, the cpanel phpMyAdmin URL

https://cpanel.example.com/cpsess9998882489/3rdparty/phpMyAdmin/index.php

Not sure what you mean it is available. Its in the GPL version.

like this but with the authentic theme styling etc…

When you install Pro, every account can have phpMyadmin “installed” or linked back to a single copy of the script all managed by Virtualmin. No manual installation would be required.

Maybe replace or complement

You can have any Install Script installed when you create a domain in Server Templates.

That’s not “one install for everyone”, it’s one install per domain, and it doesn’t automatically log users in.

For “one install for everyone”…I think you can just do that? You could also add a link in the menu, using Custom Links. Though that still doesn’t handle automatic login. I’m not sure how we’d go about that, since phpMyAdmin has its own authentication.

I’m not familiar enough with phpMyAdmin to make recommendations, though, as I only use the Webmin database UI (or the command line client).

I tend to use the maintainers version of phpmyadmin rather than the install script, for example Ubuntu would be

apt install phpmyadmin

if the web server is apache a config file is added to apache to make this accessible to every domain hosted, there is a problem with that because if a domain’s php version is perhaps below the target version of php that phpmyadmin was installed for it fails (incorrect php version). as to getting auto login you have to edit phpmyadmin’s config and add something like this to it

$cfg['LoginCookieValidity'] = 10000; // Keep long validity :)-
$cfg['Servers'][$i]['user']          = 'root'; // Your user name
$cfg['Servers'][$i]['password']      = 'root'; // Your password
$cfg['Servers'][$i]['auth_type']     = 'config';

however you would have to use something like this to get the current user name

$processUser = posix_getpwuid(posix_geteuid()); 
$cfg['Servers'][$i]['user']   = $processUser['name']); 

where you would get the password from I have no idea, this also assumes the the domain owner is also the mysql user for each installed domain
EDIT:
In theory I guess you could send the password as part of the url by adding something like

domain.com/phpmyadmin?password=password

There is an automatic login feature for individual phpMyAdmin installs

if the web server is apache a config file is added to apache to make this accessible to every domain hosted

Do you have an example I could look at?

Thanks

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php

    # limit libapache2-mod-php to files and directories necessary by pma
    <IfModule mod_php7.c>
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/usr/share/doc/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/:/usr/share/javascript/
    </IfModule>

</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/templates>
    Require all denied
</Directory>
<Directory /usr/share/phpmyadmin/libraries>
    Require all denied
</Directory>

thanks @jimr1 I will add this method to my notes, Using Alias via Apache config.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.