# Get it
cd
test -f installed/phpMyAdmin-5.2.0-english.tar.xz &&
mv -f phpMyAdmin-5.2.0-english.tar.xz .
test ! -f phpMyAdmin-5.2.0-english.tar.xz &&
wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/\
phpMyAdmin-5.2.0-english.tar.xz
# Verify tarball w/ sha256sum:
# (This came from my gpg-verified tarball;
# This works too: openssl sha256 phpMyAdmin-5.2.0-english.tar.xz)
echo "f141a5b493136b627bd910facd43a2d2203cccd9a6579566e4e323da8ccc03\
ba phpMyAdmin-5.2.0-english.tar.xz" | sha256sum -c
# This is a sample installation under a source-installed Apache 2.x running
# as user and group 'daemon'.
#
# If yours is a Slackware packaged Apache installed under /etc/httpd and
# /var/www, adjust paths as necessary. You probably need to use user
# and/or group 'apache' for file ownership of anything writable.
# Become root to set it up
su
# Check your Apache configuration to make sure of the owning user and group
egrep "^User[[:space:]]+" /usr/local/apache2/conf/httpd.conf
egrep "^Group[[:space:]]+" /usr/local/apache2/conf/httpd.conf
# Make sure the found user (e.g. 'daemon') exists
id daemon
# Make sure the found group (e.g. 'daemon') exists
getent group | egrep "^daemon:"
# Extract it to /usr/local/apache2/htdocs/
tar xJv -C /usr/local/apache2/htdocs -f phpMyAdmin-5.2.0-english.tar.xz
# One way is to create a symlink pointing to it so you can use
# a URL like:
# https://example.com/phpMyAdmin/
# rather than one like this:
# https://example.com/phpMyAdmin-5.2.0-english/
#
# In Apache's configuration, you will need 'Options FollowSymLinks' to be
# set for for that to be allowed
# (or use your VirtualHost path and it's configuration in httpd-vhosts.conf
# or httpd-ssl.conf)
cd /usr/local/apache2/htdocs
test -L phpMyAdmin && rm phpMyAdmin
ln -s phpMyAdmin-5.2.0-english phpMyAdmin
## ...or you can use Alias to create a URI that points to a directory,
## which does not necessarily need to be under htdocs, as long as you
## add a or for any needed configuration
## for that path
# Alias /phpMyAdmin /usr/local/apache2/htdocs/phpMyAdmin-5.2.0-english
# Do everything under the "real" installed location from here on
cd /usr/local/apache2/htdocs/phpMyAdmin-5.2.0-english
# Fix ownership and permissions of the extracted files
# If your Apache httpd runs as user daemon and group daemon,
# you probably need 750 for directories and 640 for read-only files
# This only removes permissions for "other", leaving the user and group
# ones as-is
chown -R root:daemon .
chmod -R o-rwx .
# Fix ownership and permissions of local docs and other things that nobody
# needs access to
chown root:root CONTRIBUTING.md ChangeLog LICENSE README \
RELEASE-DATE-5.2.0 config.sample.inc.php
chmod 600 CONTRIBUTING.md ChangeLog LICENSE README \
RELEASE-DATE-5.2.0 config.sample.inc.php
# Read the docs in ./README and ChangeLog (if upgrading)
# The full documentation can be read in the source tree with lynx or
# another console browser: lynx doc/html/index.html
# and is also available online:
# https://www.phpmyadmin.net/docs/
# If you are upgrading from an older version, read here for anything you may
# need to update:
# https://docs.phpmyadmin.net/en/latest/setup.html#upgrading-from-an-older-version
#
# Copy your old-version config.inc.php to your new phpMyAdmin-5.2.0-english directory.
# It only needs to be readable by the user that runs Apache.
test -f config.inc.php &&
( chown root:daemon config.inc.php ; chmod 640 config.inc.php )
# To instead create a configuration file using the setup script, create
# the config directory. In there will be the newly created config.inc.php
#
# After preparing for it, you can go to something like this, adjust for your
# sepcific setup, to use the setup script:
# https://yourserver.example.com/phpMyAdmin/setup
test ! -d config && mkdir -p -m 0770 config
test -s config.inc.php && mv -f config.inc.php config/
test ! -f config/config.inc.php && touch config/config.inc.php
chown root:daemon config config/config.inc.php
chmod 770 config
chmod 660 config/config.inc.php
# If you create a config.inc.php with the web interface, save a copy with
# the Download button, move that in to the top level directory, remove
# the temporary ./config/ directory, and adjust config.inc.php permissions:
test -d ./config/ && rm -r ./config/
chown root:daemon config.inc.php
chmod 640 config.inc.php
# The default configuration uses ./tmp/ under the main phpMyAdmin directory
# Change/set $cfg['TempDir'] to use a different path
mkdir -p /usr/local/apache2/htdocs/phpMyAdmin-5.2.0-english/tmp
chown root:daemon /usr/local/apache2/htdocs/phpMyAdmin-5.2.0-english/tmp
chmod 770 /usr/local/apache2/htdocs/phpMyAdmin-5.2.0-english/tmp
## Strongly advise limiting access to phpMyAdmin to certain IP addresses,
## by using Apache and/or phpMyAdmin configuration, on top of having to
## log in with username/password or however you handle authentication
## Here is an example .htaccess file, which may require some Apache httpd
## configuration updates, which would restrict access to phpMyAdmin to
## IP addresses on the local 192.168.123.x network and to localhost 127.0.0.1
#
# Require valid-user
#
# Require host localhost
# Require ip 192.168.2.0/255.255.255.0
#
#
## You can also limit access to even get to phpMyAdmin (which may have it's
## own username/password, by entering a username/password requested by the
## Apache httpd server. This would also go in the .htaccess file and you
## would create/update the /usr/local/apache2/pw file using the htpasswd
## program.
# AuthType Basic
# AuthName "Nunya Business"
# AuthUserFile /usr/local/apache2/pw
# Become your non-root user again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/phpMyAdmin-*.tar.*
mv phpMyAdmin-5.2.0-english.tar.xz installed/