Hi
I want to stop access phpmyadmin via ip address. (maybe better for stopping attackers)
How to fix it ?
Thank you
Can I stop phpmyadmin from being accessed by IP address?
- myVesta
- Site Admin
- Posts: 949
- Joined: Fri Jun 19, 2020 9:59 am
- Has thanked: 9 times
- Been thanked: 6 times
Currently there is no way to do that.
But you can 'assign' phpmyadmin to some subdomain that is known only to you - viewtopic.php?f=8&t=37
The same way (set 'group=youruser' in fpm conf) you can 'unassign' the phpmyadmin from hostname, to stop bots.
But you can 'assign' phpmyadmin to some subdomain that is known only to you - viewtopic.php?f=8&t=37
The same way (set 'group=youruser' in fpm conf) you can 'unassign' the phpmyadmin from hostname, to stop bots.
-
- Posts: 16
- Joined: Tue Jul 20, 2021 4:06 am
I did it this way:
File: /etc/apache2/conf.d/phpmyadmin.conf
Add this code:
sub.domain.com is the only domain where phpmyadmin works and 00.00.00.00 is only ip.
I use vesta for myself, which allows for this. if you have multiple users this does not work.
File: /etc/apache2/conf.d/phpmyadmin.conf
Add this code:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} !sub.domain.com$ [OR]
RewriteCond %{REMOTE_ADDR} !^00.00.00.00
RewriteRule (.*) - [R=404]
I use vesta for myself, which allows for this. if you have multiple users this does not work.