Is it possible to run phpmyadmin on its own port

SYSTEM INFORMATION
OS type and version Alma 9.2
Webmin version 2.101
Virtualmin version 7.7
Related packages phpmyadmin

Is there anyway to make phpmyadmin run on a custom port after installing the phpmyadmin script in Virtualmin? I would like to make it more secure by port forwarding only specific IP’s (source ips in the firewall) so not every tom dick and harry can have access to the login page.

Have you read the docs?
https://docs.phpmyadmin.net/en/latest/config.html

I would fix it with a .htaccess file and allow/deny rules I guess, but it is possible what you ask.

If you are running Apache server, add a new directory block to the config with settings you need and the port you want and reboot apache.

<directory /path/to/phpmyadmin>
    Listen 8080
    
    #Setting IP restriction here is possible too, no need for change of port.
    Order deny,allow
    Deny from all
    Allow from 1.2.3.4

    #...other settings
</directory>

Not tested, but should work.

phpMyAdmin is not a service to run it on a port. You can set up your webserver to listen on a port for phpMyadmin directory only.

If you seach on the Internet you will get a lot of solutions to protect the phpMyAdmin installation: change the directory name, protect with password, allow only some IP’s, …

1 Like

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