PhpMyAdmin: Difference between revisions

From Q
Jump to navigation Jump to search
Tgurr (talk | contribs)
No edit summary
Tgurr (talk | contribs)
No edit summary
Line 78: Line 78:
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
/* Hide lost+found if on a separate partition */
/* Hide lost+found if on a separate partition */
$cfg['Servers'][$i]['hide_db'] = '#mysql50#lost|^(information\_schema|performance\_schema|mysql|phpmyadmin)$';
$cfg['Servers'][$i]['hide_db'] = '#mysql50#lost|^(information\_schema|performance\_schema|mysql|phpmyadmin)$';

Revision as of 18:14, 16 December 2013

Apache vhost configuration

File: /etc/apache2/vhosts.d/phpmyadmin.<domain>.conf
<VirtualHost *:80>

    ServerName phpmyadmin.<domain>:80

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

</VirtualHost>

<VirtualHost *:443>

    DocumentRoot "/var/www/phpmyadmin.<domain>/htdocs"
    ServerName phpmyadmin.<domain>:443
    DirectoryIndex index.php
    AddDefaultCharset UTF-8

    <IfModule mpm_itk_module>
        AssignUserId apache apache
    </IfModule>

    <Directory "/var/www/phpmyadmin.<domain>/htdocs">
        Options None
        AllowOverride Limit
        Require ip 10.133 10.132
    </Directory>

    php_admin_value open_basedir /var/www/phpmyadmin.<domain>:/usr/bin:/usr/share/php
    php_admin_value upload_tmp_dir /var/www/phpmyadmin.<domain>/tmp
    php_admin_value session.save_path /var/www/phpmyadmin.<domain>/session
    php_admin_value sys_temp_dir /var/www/phpmyadmin.<domain>/tmp

    SSLEngine On
    SSLCertificateFile /etc/ssl/apache2/phpmyadmin.<domain>/phpmyadmin.<domain>.crt
    SSLCertificateKeyFile /etc/ssl/apache2/phpmyadmin.<domain>/phpmyadmin.<domain>.key
    SSLCertificateChainFile /etc/ssl/apache2/phpmyadmin.<domain>/phpmyadmin.<domain>.pem

</VirtualHost>

Installation

File: /etc/portage/package.use
dev-db/phpmyadmin vhosts
# emerge phpmyadmin
# webapp-config -I -h phpmyadmin.<domain> phpmyadmin <version>
# mysql -u root -p < /usr/share/webapps/phpmyadmin/<version>/htdocs/examples/create_tables.sql

Configuration

File: /var/www/phpmyadmin.<domain>/htdocs/config.inc.php
/* Servers configuration */
$i = 0;

/* Server localhost (http) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'http';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'phpmyadmin';
$cfg['Servers'][$i]['controlpass'] = 'xxx';
/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
/* Hide lost+found if on a separate partition */
$cfg['Servers'][$i]['hide_db'] = '#mysql50#lost|^(information\_schema|performance\_schema|mysql|phpmyadmin)$';
/* End of servers configuration */

/* Misc settings */
$cfg['Export']['compression'] = 'bzip2';
$cfg['DefaultLang'] = 'de';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['VersionCheck'] = 0;

To make the installation scripts inaccessible you should delete the setup directory.

Update

# emerge phpmyadmin
# webapp-config -U -h phpmyadmin.<domain> phpmyadmin <newversion>
# CONFIG_PROTECT="/var/www/phpmyadmin.<domain>/htdocs//libraries" etc-update
# 1
# q
# 2
# y
# emerge -C phpmyadmin-<oldversion>