Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
deb11:phpmyadmin [2022/09/26 11:07] – [Securing Your phpMyAdmin Instance] Bernard Condraudeb11:phpmyadmin [2024/04/25 15:33] (current) – [Configuration] Bernard Condrau
Line 1: Line 1:
 ====== phpMyAdmin ====== ====== phpMyAdmin ======
-Debian 10/11, other than Debian 9, require manual installation of phpmyadmin, phpmyadmin has been removed from Debian's repositories. 
  
 ===== Installation ===== ===== Installation =====
Line 7: Line 6:
 sudo mv phpMyAdmin-5.2.0-english/ /home/user/html/phpMyAdmin sudo mv phpMyAdmin-5.2.0-english/ /home/user/html/phpMyAdmin
 $ sudo chown -R www-data:www-data /home/user/html/phpMyAdmin</code> $ sudo chown -R www-data:www-data /home/user/html/phpMyAdmin</code>
-  * Up to Debian 9, and in other distributions, phpMyAdmin could be installed via the package manager. Debian 10 dropped the support through the package manager.+  - To upgrade to a newer version simply download the new version and extract it to the same folder. Files created by the user will remain the same, e.g. ''apache.conf'', ''config.inc.php'', and ''htpasswd.setup''
 +  __Note__: up to Debian 9, and in other distributions, phpMyAdmin could be installed via the package manager. Debian 10 dropped support to install through the package manager.
  
 ===== Configuration ===== ===== Configuration =====
   - We will not use any of the standard path used in Debian versions up to 9 or in other distributions. All files related to phpMyAdmin will remain in the custom path where we moved the downloaded files which is the easiest way for maintenance and later version upgrades (''/home/user/html/phpMyAdmin'').   - We will not use any of the standard path used in Debian versions up to 9 or in other distributions. All files related to phpMyAdmin will remain in the custom path where we moved the downloaded files which is the easiest way for maintenance and later version upgrades (''/home/user/html/phpMyAdmin'').
-  - Make a new directory for phpMyAdmin to store its temporary files:<code>sudo mkdir -m770 /home/user/html/phpMyAdmin/tmp</code>+  - Make a new directory for phpMyAdmin to store its temporary files:<code>sudo mkdir -m770 /home/user/html/phpMyAdmin/tmp</code>
   - Copy ''config.sample.inc.php'' to ''config.inc.php'' and edit as follows   - Copy ''config.sample.inc.php'' to ''config.inc.php'' and edit as follows
     - Use the [[https://phpsolved.com/phpmyadmin-blowfish-secret-generator/?g=6330fef62b5a1|phpMyAdmin blowfish secret generator]] to create a new secret passphrase for cookie authentication:<code>$ sudo vim /home/user/html/phpMyAdmin/config.inc.php     - Use the [[https://phpsolved.com/phpmyadmin-blowfish-secret-generator/?g=6330fef62b5a1|phpMyAdmin blowfish secret generator]] to create a new secret passphrase for cookie authentication:<code>$ sudo vim /home/user/html/phpMyAdmin/config.inc.php
Line 80: Line 80:
   - Symlink the configuration file for Apache and restart the service:<code>$ sudo ln -s /home/user/html/phpMyAdmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf   - Symlink the configuration file for Apache and restart the service:<code>$ sudo ln -s /home/user/html/phpMyAdmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
 $ sudo service apache2 restart</code> $ sudo service apache2 restart</code>
-  - Create a regular MariaDB user for the purpose of managing databases through phpMyAdmin, as it’s recommended that you log in using another account than the pma user. You could create a user that has privileges to all tables within the database, as well as the power to add, change, and remove user privileges, with this command. Whatever privileges you assign to this user, be sure to give it a strong password as well:<code>sudo mariadb +  - Create a regular MariaDB user for the purpose of managing databases through phpMyAdmin, if you haven't done that yet when configuring MariaDB. You could create a user that has privileges to all tables within the database, as well as the power to add, change, and remove user privileges, with this command. Whatever privileges you assign to this user, be sure to give it a strong password as well:<code>sudo mariadb 
-GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; +MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; 
-exit</code>+MariaDB [(none)]> FLUSH PRIVILEGES; 
 +MariaDB [(none)]> exit</code> 
 +  - Make sure permissions are set to traverse directories, particularly ''/home/user/html/'' and ''/home/user/www/'' 
 +===== Run phpMyAdmin =====
   - Access phpMyAdmin by appending ''/phpmyadmin'' to any website url hosted on the same server.   - Access phpMyAdmin by appending ''/phpmyadmin'' to any website url hosted on the same server.
  
Line 90: Line 93:
   * [[https://www.how2shout.com/linux/how-to-install-phpmyadmin-on-debian-11-bullseye-apache/|How to Install phpMyAdmin on Debian 11 Bullseye (Apache)]]   * [[https://www.how2shout.com/linux/how-to-install-phpmyadmin-on-debian-11-bullseye-apache/|How to Install phpMyAdmin on Debian 11 Bullseye (Apache)]]
   * [[https://www.howtoforge.com/how-to-install-and-secure-phpmyadmin-on-debian-11/#install-and-configure-phpmyadmin|How to Install and Secure phpMyAdmin on Debian 11]]   * [[https://www.howtoforge.com/how-to-install-and-secure-phpmyadmin-on-debian-11/#install-and-configure-phpmyadmin|How to Install and Secure phpMyAdmin on Debian 11]]
 +  * [[https://docs.phpmyadmin.net/en/latest/config.html|phpMyAdmin Configuration]]