i have xampp configured and running on a pc as server. I can access through internet by public ip, everithing its ok, and restricted the phpmyadmin access in httpd-xampp.conf
to only local network like this
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Require local
Require ip 192.168.1.0/255.255.255.0
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
and in adition the auth_type
setted to cookie
to force a login and all users accounts, including roots and pma, have password.
Its possible to add a mac address to the list? somthing like Require mac aa:bb:cc:dd:ee:ff
(ik this not work). The idea is to access to phpmyadmin on my phone from the outside if necessary. Or there is another way to do it?
Apache does not allow filtering by MAC address. You could probably put some sort of firewall in place that would give that functionality, but that will only work if you're on the same network segment, which won't fit your requirement of being able to access using your phone from outside.
A solution that I like better would be to have a VPN (such as OpenVPN, Wireguard, ZeroTier, etc) somewhere on your local network segment (or even on the webserver itself) which you connect to from your phone, so you're not exposing the webserver to the internet at all. If that isn't a good option for you, you can still use the various means that Apache or phpMyAdmin allows to restrict access, including two-factor authentication through phpMyAdmin.