Make myadmin page not to be shown through the internet, but to be shown only in localhost

I installed php, mysql, and apache some years ago using APMSetUp.

I can see not only the index.php but also the mysql page with the directory “myadmin/” through the internet.

I like to make it that mysql page is NOT seen through the internet but is seen by localhost only.

I’m not entirely sure I’ve understood your question, but adding this to your .htaccess file will prevent directory browsing.

Options All -Indexes

There is more information and other options here:

1 Like

Add this to your .htaccess

Allow from 127.0.0.1
Deny from all

That should make it work from your device only (assuming PhpMyAdmin is installed on your device, on not a server somewhere - you’d need a different IP in that case).

1 Like

I opened .htaccess at APM_Setup/Server/phpMyAdmin/libraries.

it says the following.

As I added your suggestion. it is now the following.

I expected it would be not approached to ‘myadmin/’ through internet.
However, I can still approach the page at “http://myDomain.com/myadmin/” by using not only the server itself but also another device in another place

What’s wrong with it?

Digital Ocean has many tried and trusted tutorials…

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