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
deb12:lamp [2024/04/22 15:27] – [phpMyAdmin] Bernard Condraudeb12:lamp [2024/04/25 15:31] (current) – [Links] Bernard Condrau
Line 88: Line 88:
  
 ===== MariaDB 10.11.6 Installation ===== ===== MariaDB 10.11.6 Installation =====
-  Install<code>$ sudo apt install mariadb-server</code>+  Install<file>$ sudo apt install mariadb-server</file> 
 +  - Start MariaDB<file>$ sudo service mariadb start</file> 
 +  - Secure the installation following [[https://linuxgenie.net/how-to-install-mariadb-on-debian-12-bookworm-distribution/|How to Install MariaDB on Debian 12 Bookworm Distribution]]<file>$ sudo mariadb-secure-installation</file> 
 +  - Assign a password to root 
 +  - Dump all databases on the old server<file>$ sudo mysqldump --all-databases > sql_file.sql</file> 
 +  - Copy ''sql_file.sql'' to the new server and remove databases ''mysql'' and ''phpmyadmin'' from the dump file, then import with<file>$ sudo mysql < sql_file.sql</file>
  
 ===== phpMyAdmin ===== ===== phpMyAdmin =====
   * [[deb11:phpmyadmin|phpMyAdmin]]   * [[deb11:phpmyadmin|phpMyAdmin]]
  
-==== Configuration ==== + 
-  * To begin, make a new directory where phpMyAdmin will store its temporary files and set ownership:<code>sudo mkdir -p /var/lib/phpmyadmin/tmp +
-sudo chown -R www-data:www-data /var/lib/phpmyadmin</code> +
-  * In the same folder, create a file with the blowfish secret passphrase and set permissions:<code>sudo vim /var/lib/phpmyadmin/blowfish_secret.inc.php +
-<?php +
-$cfg['blowfish_secret'] = '32-CHAR-LONG-SECRET-KEY'; +
-<ESC>:wq +
-sudo chown root:www-data /var/lib/phpmyadmin/blowfish_secret.inc.php +
-sudo chmod 640 /var/lib/phpmyadmin/blowfish_secret.inc.php</code> +
-  * Copy folder {{:deb9:phpmyadmin.zip|phpmyadmin}} from a Debian 9 installation to /etc. Check the **apache.conf** file and remove path elements in //php_admin_value open_basedir// which do not exist in your system. +
-  * Symlink the configuration files for apache:<code>cd /etc/apache2/conf-available +
-ln -s ../../phpmyadmin/apache.conf phpmyadmin.conf +
-cd ../conf-enabled +
-ln -s ../conf-available/phpmyadmin.conf phpmyadmin.conf</code> +
-  * Symlink the configuration files for phpmyadmin in it's root folder:<code>cd /usr/share/phpmyadmin +
-ln -s /etc/phpmyadmin/config.inc.php config.inc.php +
-ln -s /etc/phpmyadmin/config.header.inc.php config.header.inc.php +
-ln -s /etc/phpmyadmin/config.footer.inc.php config.footer.inc.php</code> +
-  * Create a additional config file with the path to the **tmp** directory:<code>vim /etc/phpmyadmin/conf.d/tempdir.php +
-<?php +
-$cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';</code> +
-  * Make sure the //phpmyadmin// user has been created in mysql:<code>mysql -u <my-admin-user> -p +
-SELECT user,host FROM mysql.user; +
-CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; +
-GRANT USAGE ON phpmyadmin.* TO phpmyadmin</code> +
-  * The password is in file /etc/phpmyadmin/config-db.php. Restrict permissions of that file as it contains a password:<code>sudo chown root:www-data /etc/phpmyadmin/config-db.php +
-sudo chmod 640 /etc/phpmyadmin/config-db.php</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 +
-GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; +
-exit</code> +
-  * [[https://docs.phpmyadmin.net/en/latest/config.html|phpMyAdmin Configuration]] +
-==== Security ==== +
-  * You should secure access to phpmyadmin, for example by limiting access to verified ip addresses+
 ===== Windows Subsystem for Linux ===== ===== Windows Subsystem for Linux =====
   * For Windows Subsystem for Linux, create a **Virtual Host** file with document root in ///mnt/<drive>/htdocs// or similar, if you need to access it through the Windows file system.   * For Windows Subsystem for Linux, create a **Virtual Host** file with document root in ///mnt/<drive>/htdocs// or similar, if you need to access it through the Windows file system.
Line 156: Line 130:
   * [[https://webmasters.stackexchange.com/questions/126557/what-is-the-difference-of-certbot-and-certbot-auto|What is the difference of certbot and certbot-auto?]]   * [[https://webmasters.stackexchange.com/questions/126557/what-is-the-difference-of-certbot-and-certbot-auto|What is the difference of certbot and certbot-auto?]]
   * [[https://www.jesusamieiro.com/remove-revoke-a-domain-in-lets-encrypt/|Remove a domain in Let’s Encrypt]]   * [[https://www.jesusamieiro.com/remove-revoke-a-domain-in-lets-encrypt/|Remove a domain in Let’s Encrypt]]
 +  * [[https://linuxgenie.net/how-to-install-mariadb-on-debian-12-bookworm-distribution/|How to Install MariaDB on Debian 12 Bookworm Distribution]]
 ===== SSL for localhost ===== ===== SSL for localhost =====
 ==== Ignore invalid certificates ==== ==== Ignore invalid certificates ====