joon1
January 31, 2019, 11:14pm
1
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:
An extensive htaccess reference including many htaccess tips, tricks, and examples. Enhance the functionality of your site with htaccess rewrite and redirect rules. Prevent hotlinking, secure files, and much more.
1 Like
rpkamp
February 1, 2019, 6:10pm
3
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
joon1
February 3, 2019, 10:52pm
4
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…
Step Two — Secure your phpMyAdmin Instance
We were able to get our phpMyAdmin interface up and running fairly easily. However, we are not done yet. Because of its ubiquity, phpMyAdmin is a popular target for attackers. We should take extra steps to prevent unauthorized access.
One of the easiest way of doing this is to place a gateway in front of the entire application. We can do this using Apache’s built-in .htaccess authentication and authorization functionalities.
Configure Apache to Allow .htaccess Overrides
First, we need to enable the use of .htaccess file overrides by editing our Apache configuration file.
We will edit the linked file that has been placed in our Apache configuration directory:
sudo nano /etc/apache2/conf-available/phpmyadmin.conf
We need to add an AllowOverride All directive within the <Directory /usr/share/phpmyadmin> section of the configuration file, like this:
/etc/apache2/conf-available/phpmyadmin.conf
<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
. . .
system
Closed
May 6, 2019, 6:51am
6
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.