Change phpmyadmin port + url
As the title said, I changed phpmyadmin port to 99 through adding a virtual host file at /etc/apache2/sites-available, the file looks like :
Listen 99
<VirtualHost *:99>
ServerName localhost
Alias /secreturl /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
AllowOverride None
Require all granted
</Directory>
DocumentRoot /usr/share/phpmyadmin
Include /etc/phpmyadmin/apache.conf
ErrorLog ${APACHE_LOG_DIR}/phpmyadmin.error.log
CustomLog ${APACHE_LOG_DIR}/phpmyadmin.access.log combined
</VirtualHost>
The issue is when I access the url IP:99 I get access to phpmyadmin without adding the secret url to the url, how do I prevent this ?
How is read the config, it's because the Alias /secreturl /usr/share/phpmyadmin and the DocumentRoot /usr/share/phpmyadmin are the same.
Therefore, the alias isn't needed. So change your DocumentRoot to something else.
PS: "security by obscurity" can not be recommended. Add and Auth-basic or something instead or on top.
Please or to participate in this conversation.