Install phpMyAdmin outside /public_html after installing virtualmin?


I would like to install phpmyadmin manually after installing virtualmin because would like to install phpMyAdmin outside sub-directory /home/public_html

I have tried many tutorials that work if I do them before installing Virtualmin, but if I already have Virtualmin installed, no. Does anyone know why it could be?


1 Like

When you create the virtual server in virtualmin, you can point the root (home directory) to any location. Say you wanted to use /var/www/html/phpMyAdmin as the root then you simply indicate that when you create the virtual server.

When you create the virtual server in virtualmin, you can point use public_html (At top level)

or public_html/phpmyadmin (or another directory name), but always under public_html

Can you explain me how I use /var/www/html/phpMyAdmin? Have you ever tried

My advice is don’t. Just let Virtualmin install it into a domain in the usual way. Why make so much extra work for yourself for no benefit?

1 Like

I guess because I have gotten used to never installing phpmyadmin inside public_html for security reasons, and now I find it free of charge dangerous. Above all I would appreciate that later it will be allowed to install it outside where you host the website.

and I’m not the only one who thinks like that

That’s a completely different question. The directory it’s in has nothing to do with who can access it.

My advaice you don’t and if you do, there is even bunch of YouTube I’ll shit advice to do it hit the fan if you want but I would not do it.

Initial Question

Answers: you can do it, just do it. There are tutorials

1 Like

If you’re experienced enough to make that decision, against my advice, it seems like it ought to be obvious why it doesn’t work, and how to make it work. It’s basic Apache configuration.

Or, install it the way I’ve suggested and ask about how to password protect or add IP access controls to a given web path.

1 Like

And, to be clear, running it the way you want to run it is potentially less secure, not more due to lack of suexec.

1 Like

I was unnecessarily grouchy earlier.

The short answer to your question is that because Virtualmin sets up Apache to host many domains instead of just one, every site must have a VirtualHost section. The “default” site doesn’t exist in an Apache configured for virtual hosting.

So, create a VirtualHost that points to wherever. I still think it’s a mistake and you’re making decisions based on superstition (it is not more secure), but that’s how you do it

Thanks, I will try what you say even if it is less safe. At least I want to prove that I was able to do it and then I’ll decide how I leave it at the end.

On the other hand, and as you mentioned before, it would also be appreciated if you explain how to add IP access controls to a given web path.

I imagine it will be configuring one /phpmyadmin/ for each virtualhost

What about just creating a Sub-Server as a subdomain of one of your FQDN’s? That puts it’s root in a whole new directory space than the rest of your operation. Use the script installer to populate the subdomain, or do git install to it. Use the Virtualmin database server to give your user permission to access the databases you want handy with a specific login and all should be well.

Did I say anything there that sounds insecure?

1 Like

Thank you, what you propose really sounds good

That’s not necessary.

And what would be the best way to protect access to phpmyadmin to a specific ip or to the local network? I find it very useful and good for security

I thought it was the best way was phpmyadmin/ (for protect login) and htaccess (for protect access)

Centos-web panel i think installs phpmyadmin outside public html directory.

Ispconfig installs it to /usr/share/phpmyadmin

You can use Protected Directories (in *Services) to password protect any directory, and you can add IP-based restrictions and lots of others in Services->Configure Website and then add or modify Per-directory options. This opens a big form that provides the ability to add IP-based access controls, etc.

Those other panels don’t have their own database administration tools built-in. With Virtualmin phpmyadmin is an optional addition. Some people like phpmyadmin better or are just used to it, so they install it and maybe make it available to all customers. Some people like the built-in MySQL and PostgreSQL UIs and just use those.

I’ve never used phpmyadmin beyond testing to make sure it works when installed by Virtualmin.

But, it has nothing to do with security. If anyone tells you otherwise, they don’t know what they’re talking about.

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