For all those who are just as paranoid as I am
This modification prevents direct access to PMA and Filemanager, you have to login into the control panel first.
IMPORTANT: this is working only with version starting @ Latest Stable-Release: 1.1.2
because of different V-Host entrys in earlier version
replace with your details:
- YourSecret123456
- YourCookieName
- https://admin.YourPanelURL.tld
Code
- nano /etc/apache2/sites-available/00_master.confbelow: <LocationMatch ^/.*/themes/.*/assets/.*$> Allow from all </LocationMatch>add: <LocationMatch /client> Header set Set-Cookie: "YourCookieName=YourSecret123456; path=/;" </LocationMatch> <LocationMatch /admin> Header set Set-Cookie: "YourCookieName=YourSecret123456; path=/;" </LocationMatch> <Location /pma> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /filemanager> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /tools/pma> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /tools/filemanager> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location>
Code
- nano /etc/apache2/sites-available/00_master_ssl.confbelow <LocationMatch ^/.*/themes/.*/assets/.*$> Allow from all </LocationMatch>add: <LocationMatch /client> Header set Set-Cookie: "YourCookieName=YourSecret123456; path=/;" </LocationMatch> <LocationMatch /admin> Header set Set-Cookie: "YourCookieName=YourSecret123456; path=/;" </LocationMatch> <Location /pma> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /filemanager> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /tools/pma> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location> <Location /tools/filemanager> RewriteEngine On RewriteCond %{HTTP_COOKIE} !YourCookieName=YourSecret123456 [NC] RewriteRule .* https://admin.YourPanelURL.tld [L] </Location>
service apache2 restart
also as administrator you have to log into the panel before you can use PMA, therefore we will create a custom menu entry in the Admin Panel: