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
deb13:phpmyadmin [2026/09/26 10:30] – [Configuration] Bernard Condraudeb13:phpmyadmin [2026/09/26 10:42] (current) – [apache2 Configuration] Bernard Condrau
Line 27: Line 27:
 sudo mv phpMyAdmin-*-english phpmyadmin sudo mv phpMyAdmin-*-english phpmyadmin
 </code> </code>
-  - Create the configuration file from the sample template and generate a secure blowfish secret for cookie encryption:<code>sudo cp /home/user/html/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php</code> 
-  - Generate a 32-character random string using OpenSSL:<code>openssl rand -base64 24 > secret</code> 
-  - Open ''/home/user/html/phpmyadmin/config.inc.php'' and paste the generated string into the $cfg['blowfish_secret'] line:<code>$cfg['blowfish_secret'] = 'YOUR_GENERATED_STRING_HERE';</code> 
   - Create the temporary folder required by phpMyAdmin and assign proper web server ownership:<code>$ sudo mkdir -p /home/user/html/phpMyAdmin/tmp   - Create the temporary folder required by phpMyAdmin and assign proper web server ownership:<code>$ sudo mkdir -p /home/user/html/phpMyAdmin/tmp
 $ sudo chown -R www-data:www-data /home/user/html/phpMyAdmin $ sudo chown -R www-data:www-data /home/user/html/phpMyAdmin
Line 36: Line 33:
   * __Note__: Debian 10 dropped //phpmyadmin// from it's repository. Older and newer Debian versions include it.   * __Note__: Debian 10 dropped //phpmyadmin// from it's repository. Older and newer Debian versions include it.
  
-===== Configuration ===== +===== phpMyAdmin 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''). +  - Create the configuration file from the sample template and generate a secure blowfish secret for cookie encryption:<code>sudo cp /home/user/html/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php</code> 
-  - Make a new directory for phpMyAdmin to store its temporary files:<code>$ sudo mkdir -m770 /home/user/html/phpMyAdmin/tmp</code> +  - Generate a 32-character random string using OpenSSL:<code>openssl rand -base64 24 > secret</code> 
-  - Copy ''config.sample.inc.php'' to ''config.inc.php'' and edit as follows +  - Open ''/home/user/html/phpmyadmin/config.inc.php'' and paste the generated string into the $cfg['blowfish_secret'] line:<code>$cfg['blowfish_secret'] = 'YOUR_GENERATED_STRING_HERE';</code> 
-    - 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 +  - Add custom settings:<code>$cfg['FirstLevelNavigationItems'] = 150; // number of databases in navigation, default: 100
-$cfg['blowfish_secret'] = 'new 32 byte secret key';</code> +
-    - Add the following custom settings to ''config.inc.php'':<code>$cfg['FirstLevelNavigationItems'] = 150; // number of databases in navigation, default: 100+
 $cfg['MaxNavigationItems'] = 150; // number of tables in db navigation, default: 50 $cfg['MaxNavigationItems'] = 150; // number of tables in db navigation, default: 50
 $cfg['NavigationWidth'] = 300; // width of the navigation window, default: 240 $cfg['NavigationWidth'] = 300; // width of the navigation window, default: 240
Line 48: Line 43:
 $cfg['ShowPhpInfo'] = true; // show phpinfo link on home screen, default: false $cfg['ShowPhpInfo'] = true; // show phpinfo link on home screen, default: false
 $cfg['TempDir'] = '/home/user/html/phpMyAdmin/tmp'; // you may omit this line as the default is ./tmp</code> $cfg['TempDir'] = '/home/user/html/phpMyAdmin/tmp'; // you may omit this line as the default is ./tmp</code>
-    - You may check [[https://docs.phpmyadmin.net/en/latest/|phpMyAdmin’s documentation]] for other settings to add +  - You may check [[https://docs.phpmyadmin.net/en/latest/|phpMyAdmin’s documentation]] for other settings to add 
-    - Leave the commented out settings in ''config.inc.php'' unchanged. The ''pma'' settings are better done within phpMyAdmin, where you click "Find out why" in the warning at the bottom of the screen when you first run phpMyAdmin, and then create the database ''phpmyadmin'' which will contain those settings. +  - Leave the commented out settings in ''config.inc.php'' unchanged. The ''pma'' settings are better done within phpMyAdmin, where you click "Find out why" in the warning at the bottom of the screen when you first run phpMyAdmin, and then create the database ''phpmyadmin'' which will contain those settings. 
-  - Create ''/home/user/html/phpMyAdmin/apache.conf'':<code># phpMyAdmin default Apache configuration+ 
 +===== apache2 Configuration ===== 
 +  - Create ''/etc/apache2/conf-available/phpmyadmin.conf'':<code># phpMyAdmin default Apache configuration
  
 Alias /phpmyadmin /home/user/html/phpMyAdmin Alias /phpmyadmin /home/user/html/phpMyAdmin
Line 104: Line 101:
 </Directory> </Directory>
 </code> </code>
-  - You can replace the directives for the setup directory with ''Require all denied'' as we will not use the setup script. However, if you do want to use the setup script prior to creating ''config.inc.php'', first create the password file to access the setup script's directory:<code>$ sudo htpasswd -c /home/user/html/phpMyAdmin/htpasswd.setup user</code> +  - Enable the configuration, check the configuration, and restart apache:<code>$ sudo a2enconf phpmyadmin 
-  - 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 apachectl configtest 
-$ sudo service apache2 restart</code> +$ sudo systemctl restart apache2</code> 
-  - 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+  - Create a regular MariaDB user for the purpose of managing databases through phpMyAdmin, if you haven't done that yet when configuring MariaDB. You would 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
 MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
 MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'user'@'hostname'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'user'@'hostname';