This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| deb11:phpmyadmin [2022/09/26 10:30] – Bernard Condrau | deb11:phpmyadmin [2025/11/22 00:11] (current) – [Installation] 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' | ||
| ===== Installation ===== | ===== Installation ===== | ||
| - | - Download the latest [[https:// | + | - Download the latest [[https:// |
| - | - Unzip the tarball, then move the folder to a local folder outside of apache' | + | - Unzip the tarball, then move the folder to a local folder outside of apache' |
| - | sudo mv phpMyAdmin-5.2.0-english/ / | + | sudo mv phpMyAdmin-5.2.3-english/ / |
| $ sudo chown -R www-data: | $ sudo chown -R www-data: | ||
| - | * Up to Debian 9, and in other distributions, | + | |
| + | | ||
| ===== 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 to later maintain | + | - 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 |
| - | - Make a new directory for phpMyAdmin to store its temporary files:< | + | - Make a new directory for phpMyAdmin to store its temporary files:< |
| - Copy '' | - Copy '' | ||
| - Use the [[https:// | - Use the [[https:// | ||
| $cfg[' | $cfg[' | ||
| - | - Add the following custom settings to '' | + | - Add the following custom settings to '' |
| - | $cfg[' | + | $cfg[' |
| - | $cfg[' | + | $cfg[' |
| - | $cfg[' | + | $cfg[' |
| - | $cfg[' | + | $cfg[' |
| - | - You may check [[https:// | + | $cfg[' |
| - | - Leave the commented out settings in '' | + | - You may check [[https:// |
| - | | + | - Leave the commented out settings in '' |
| - | * Symlink the configuration files for apache:< | + | - Create ''/ |
| - | ln -s ../ | + | |
| - | cd ../ | + | |
| - | ln -s ../ | + | |
| - | * Symlink the configuration files for phpmyadmin in it's root folder:< | + | |
| - | ln -s / | + | |
| - | ln -s / | + | |
| - | ln -s / | + | |
| - | * Create | + | |
| - | <?php | + | |
| - | $cfg['TempDir' | + | |
| - | * Make sure the // | + | |
| - | SELECT user,host FROM mysql.user; | + | |
| - | CREATE USER 'user'@' | + | |
| - | GRANT USAGE ON phpmyadmin.* TO phpmyadmin</ | + | |
| - | * The password is in file / | + | |
| - | sudo chmod 640 / | + | |
| - | * Create a regular MariaDB user for the purpose of managing databases through | + | |
| - | GRANT ALL PRIVILEGES ON *.* TO ' | + | |
| - | exit</ | + | |
| - | * [[https:// | + | |
| - | ==== Manual Upgrade on Debian 9 ==== | + | Alias /phpmyadmin /home/bco/html/phpMyAdmin |
| - | * Check latest version of [[https://www.phpmyadmin.net/|phpMyAdmin]] | + | |
| - | * Download and install< | + | |
| - | sudo wget https:// | + | |
| - | tar xzf phpMyAdmin-5.1.0-english.tar.gz | + | |
| - | sudo mv phpMyAdmin-5.1.0-english phpmyadmin</ | + | |
| - | * Modify the following lines in / | + | |
| - | define(' | + | |
| - | * See [[https:// | + | |
| - | ===== Securing Your phpMyAdmin Instance ===== | + | < |
| - | Edit / | + | Options |
| - | Alias /phpmyadmin / | + | |
| - | | + | |
| - | Options | + | |
| DirectoryIndex index.php | DirectoryIndex index.php | ||
| - | + | ||
| - | # Allow user to access without password | + | < |
| - | Include conf-available/ | + | |
| - | | + | |
| - | < | + | |
| < | < | ||
| AddType application/ | AddType application/ | ||
| Line 72: | Line 38: | ||
| SetHandler application/ | SetHandler application/ | ||
| </ | </ | ||
| - | + | ||
| - | php_flag magic_quotes_gpc Off | + | |
| - | php_flag track_vars On | + | |
| - | php_flag register_globals Off | + | |
| - | php_admin_flag allow_url_fopen Off | + | |
| php_value include_path . | php_value include_path . | ||
| - | php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp | + | php_admin_value upload_tmp_dir /home/bco/html/ |
| - | php_admin_value open_basedir /usr/share/phpmyadmin/:/ | + | php_admin_value open_basedir /home/bco/html/phpMyAdmin/:/ |
| </ | </ | ||
| - | </ | ||
| - | conf-available/ | + | </Directory> |
| - | | + | |
| - | | + | # Authorize for setup |
| + | < | ||
| + | < | ||
| + | < | ||
| + | AuthType Basic | ||
| + | AuthName " | ||
| + | AuthUserFile / | ||
| + | </ | ||
| + | Require valid-user | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | # Disallow web access to directories that don't need it | ||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | < | ||
| + | Require all denied | ||
| + | </ | ||
| + | |||
| + | # Secure access to phpMyAdmin by restricting access to it's parent, for example by IP address or domain name, local or external | ||
| + | < | ||
| + | < | ||
| + | Require ip 127.0.0.1 | ||
| + | Require forward-dns ddns.domain.name | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | - You can replace the directives for the setup directory with '' | ||
| + | - Symlink the configuration file for Apache and restart the service:< | ||
| + | $ sudo service apache2 restart</ | ||
| + | | ||
| + | MariaDB [(none)]> | ||
| + | MariaDB [(none)]> | ||
| + | MariaDB [(none)]> | ||
| + | MariaDB [(none)]> | ||
| + | | ||
| + | ===== Run phpMyAdmin ===== | ||
| + | - Access phpMyAdmin by appending ''/ | ||
| + | |||
| ===== Links ===== | ===== Links ===== | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||