Skip to content

Sysadmin grodoudou phpmyadmin 08062012

Yannouk edited this page Jul 5, 2012 · 1 revision

Session

  • user : root
  • host : grodoudou.seizam.com
  • date : 06/08/12 10:52
  • curpath : /root

Commands

 [email protected]# cd /usr/share
 [email protected]# mkdir phpmyadmin
 [email protected]# cd phpmyadmin/
 [email protected]# wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.5.1/phpMyAdmin-3.5.1-all-languages.tar.gz?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php&ts=1339145624&use_mirror=freefr
 [email protected]# mv phpMyAdmin-3.5.1-all-languages.tar.gz?r=http:%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Fdownloads.php phpMyAdmin-3.5.1-all-languages.tar.gz
 [email protected]# tar -xvf phpMyAdmin-3.5.1-all-languages.tar.gz
 [email protected]# mv phpMyAdmin-3.5.1-all-languages /usr/share/
 [email protected]# mv /usr/share/phpMyAdmin-3.5.1-all-languages/ /usr/share/phpmyadmin
 [email protected]# chgrp -R www-data /usr/share/phpmyadmin/
 [email protected]# cd /usr/share/phpmyadmin/
  • Edit /usr/share/phpmyadmin/config.inc.php, see [1]
 [email protected]# cd /etc/apache2/sites-available/
  • Edit /etc/apache2/sites-available/sys-admin-tools, see [2]
 [email protected]# a2ensite
  • Need to fix the env var LC_ALL
 [email protected]# export LC_ALL=en_GB.UTF-8
 [email protected]# a2ensite sys-admin-tools
 [email protected]# cd sites-enabled/
 [email protected]# mv sys-admin-tools 050-sys-admin-tools
 [email protected]# /etc/init.d/apache2 reload
 [email protected]# chgrp -R www-data phpmyadmin/
 [email protected]# chmod -R 755 phpmyadmin/

Files

  • [1] Edit /usr/share/phpmyadmin/config.inc.php
<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 3.5.1 setup script
 * Date: Fri, 08 Jun 2012 11:41:45 +0200
 */

/* Servers configuration */
$i = 0;

/* Server: Grodoudou [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'Grodoudou';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

/* End of servers configuration */

$cfg['blowfish_secret'] = 'a_secret_string';
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['UserprefsDeveloperTab'] = true;
$cfg['Error_Handler']['display'] = true;
$cfg['Error_Handler']['gather'] = true;
$cfg['VersionCheck'] = false;
$cfg['ShowPhpInfo'] = true;
$cfg['ProtectBinary'] = 0;
$cfg['LightTabs'] = true;
$cfg['PropertiesIconic'] = true;
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
?>
  • [2] Edit /etc/apache2/sites-available/sys-admin-tools
<VirtualHost *:80>
	ServerName localhost
	ServerAdmin webmaster@localhost

	DocumentRoot /var/www
	<Directory />
		Options FollowSymLinks
		AllowOverride None
		Order deny,allow
                Deny from all
	</directory>

	# PHPMYADMIN
        # ----------

        Alias /phpmyadmin /usr/share/phpmyadmin

        <Directory /usr/share/phpmyadmin>
                Options FollowSymLinks
                DirectoryIndex index.php

                <IfModule mod_php5.c>
                        AddType application/x-httpd-php .php

                        php_flag magic_quotes_gpc Off
                        php_flag track_vars On
                        php_flag register_globals Off
                        php_value include_path .
                </ifmodule>
        
                Order deny,allow
                Deny from all
                Allow from 127.0.0.1
        </directory>

	# Disallow web access to directories that don't need it
        <Directory /usr/share/phpmyadmin/libraries>
            Order Deny,Allow
            Deny from All
        </directory>
        <Directory /usr/share/phpmyadmin/setup/lib>
            Order Deny,Allow
            Deny from All
        </directory>


	ErrorLog ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/access.log combined
</virtualhost>
Clone this wiki locally