phpMyAdmin

phpMyAdmin is a browser-based utility for managing MySQL databases.

Prerequisites
phpMyAdmin likes to have libmcrypt installed with your PHP:

yum -y install libmcrypt-devel

Then compile your PHP with mcrypt support by adding --with-mcrypt to it's configure options.

Webserver Configuration
Create a base directory for the your private, local site:

mkdir -p /var/websites/private/logs/
mkdir -p /var/websites/private/htdocs
chown nobody:nobody /var/websites/private/logs
chown nobody:nobody /var/websites/private/htdocs
  • Apache
    Edit /usr/local/apache2/conf/httpd.conf and add a non-standard port for it to listen on (maximum allowed is 65535):

    Listen 12345

    Edit /usr/local/apache2/conf/extra/httpd-vhosts.conf and add a virtual host directive:

    <VirtualHost _default_:12345>
      DocumentRoot /var/websites/private/htdocs

      <Directory /var/websites/private/htdocs>
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
      </Directory>

      ErrorLog /var/websites/private/logs/private-error_log
      CustomLog /var/websites/private/logs/private-access_log combined
    </VirtualHost>

  • Lighttpd
    Edit /server/lighttpd/root/sites/private.conf and add a virtual host directive:

    var.basedir = "/var/websites/private/"
    server.document-root = basedir + "htdocs/"
    accesslog.filename = basedir + "logs/access.log"

    Edit /service/lighttpd/root/lighttpd.conf and add the link to the virtual host file:

    $SERVER["socket"] == ":12345" {
      include "sites/private.conf" 
    }

Installation
Download the source tarball:

cd /var/websites/private/htdocs
wget https://files.phpmyadmin.net/phpMyAdmin/4.5.0.2/phpMyAdmin-4.5.0.2-english.tar.gz
tar zxf phpMyAdmin-4.5.0.2-english.tar.gz
rm phpMyAdmin-4.5.0.2-english.tar.gz

Move the phpmyadmin source files into the base directory:

mv phpMyAdmin-4.5.0.2-english phpmyadmin
chown -R nobody:nobody phpmyadmin

Configuration
In order to use the config script, we'll need to set up a conf directory:

cd /var/websites/private/htdocs/phpmyadmin
mkdir config
chown nobody:nobody config
chmod o+rw config

Access the setup script at http://<myserver>:12345/phpmyadmin/setup For the typical local install of MySQL, the default options for a new server will work just fine. If you are want to add a MySQL Sandbox server, then configure it with the sandbox's Server port(eg. 5141), Server socket (eg. /tmp/mysql_sandbox5141.sock), and set the Connection type to socket.

Once the config file has been saved, move it to the proper location:

cd /var/websites/private/htdocs/phpmyadmin
mv config/config.inc.php .
chmod o-rw config.inc.php

You should delete the config directory once you are done:

rm -rf config

Recent Updates

  • PHP
    1 year 7 months ago
    PHP 7.4
  • 1 year 7 months ago
    MariaDB 10.4.12
  • 1 year 7 months ago
    Dovecot 2.3.10
  • 1 year 7 months ago
    CentOS 6 revisions
  • 1 year 7 months ago
    Copy of the revision from Wed, 08/22/2018 - 13:39.