Apache VCL logo Apache Software Foundation logo

phpMyAdmin Installation & Configuration

phpMyAdmin is a free and optional tool which allows MySQL or MariaDB to be administered using a web browser. It makes administering the VCL database easier. This tool can be installed on the VCL web server.
  1. Install phpMyAdmin via the yum package manager. Tested on clean installs of CentOS, Red Hat versions 6 and 7

    a. phpMyAdmin is in the extras repository, use epel-release package to add this repo

    yum -y install epel-release
    

    b. Install phpMyAdmin

    yum -y install phpMyAdmin
    

    c. Move the phpMyAdmin directory to the web server directory:

    mv /usr/share/phpMyAdmin /var/www/html/phpMyAdmin
    

    d. Edit /etc/httpd/conf.d/phpMyAdmin.conf with your favorite editor. Replace the paths created by the yum install, change each "/usr/share/phpMyAdmin" with /var/www/html/phpMyAdmin or use this sed command

    sed -i "s|/usr/share/|/var/www/html/|g" /etc/httpd/conf.d/phpMyAdmin.conf
    
  2. Follow the latest setup instructions at http://docs.phpmyadmin.net

    The "Securing your phpMyAdmin installation" instructions can be followed to secure phpMyAdmin. At a minimum set the MySQL user and password in the config.inc.php file Edit /etc/phpMyAdmin/config.inc.php and set the user and password variables to match the LockerWrtUser(typically vcluser) and wrtPass from /etc/vcl/vcld.conf

    $cfg['Servers'][$i]['user'] = 'vcluser';
    $cfg['Servers'][$i]['password'] = ''; //Use wrtPass from /etc/vcl/vcld.conf

  3. How to allow access to phpMyAdmin from other machines. The default server configuration limits access only to localhost (127.0.0.1). If desired to access from other machines, edit the server config file to allow other machines, change any lines with 127.0.0.1 to your workstation IP or a set of known IP addresses.

    In your editor, open /etc/httpd/conf.d/phpMyAdmin.conf Edit the first section, there are two locations that need to change

    Under the section labeled:  Directory /var/www/html/phpMyAdmin/
    . . .
    Require ip your_workstation_IP_address
    . . .
    Allow from your_workstation_IP_address
    . . .
    

  4. Restart httpd service and test

    service httpd restart
    

    If you receive 403-Forbidden errors after installing phpMyAdmin, the problem is likely caused by SELinux. Run the following command to correct the problem:

    chcon -R -t httpd_sys_content_t /var/www/html/phpMyAdmin
    

  5. Optional, Configure the phpMyAdmin-VCL Table relationships:

    After following the documentation on creating the phpMyAdmin Linked-tables infrastructure, you can set up the VCL table relationships. The phpmyadmin.sql file is provided in the mysql directory in the Apache VCL source code. It will add entries to the pma_table_info table in the phpmyadmin database. These entries cause corresponding information to be displayed when you hover over a value in the VCL database.

    Import the SQL file into the phpmyadmin database:

    mysql phpmyadmin < apache-VCL-2.4/mysql/phpmyadmin.sql