首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 冲浪宝典 > 网络资源 > Installing phpMyAdmin
【标  题】:Installing phpMyAdmin
【关键字】:Installing,phpMyAdmin
【来  源】:http://www.cublog.cn/u/6418/showart.php?id=81404

Installing phpMyAdmin

First we'll create a directory that's out of the way of Debian's package management system in /usr/local. We'll call it php5 since we'll be putting Smarty and ADODB files here as well.

$> mkdir /usr/local/php5

Now we untar phpMyAdmin in this directory (creates /usr/local/php5/phpMyAdmin-2.7.0-pl2), and remove the tar.gz file.

$> cp phpMyAdmin-2.7.0-pl2.tar.gz /usr/local/php5/
$> cd /usr/local/php5/
$> tar -zxvf phpMyAdmin-2.7.0-pl2.tar.gz
$> rm phpMyAdmin-2.7.0-pl2.tar.gz

Note: I opt to leave the version info in the phpMyAdmin directory name so I can easily untar a new version right next it without blowing anything away.

Configuring phpMyAdmin

The sample config file provided is config.default.php. We need to copy it to config.inc.php.

$> cd /usr/local/php5/phpMyAdmin-2.7.0-pl2/
$> cp config.default.php config.inc.php

Now we need to make a couple of changes to config.inc.php. First, let's define the URI we'll be using to access PhpMyAdmin (this is not the path to the phpMyAdmin directory, but rather the alias we will use for it in the Apache config). Find the following line,

$cfg['PmaAbsoluteUri'] = '';

and change it to something like this.

$cfg['http://www.mydomain.com/phpmyadmin'] = '';

Next we need to choose an auth type. The three options are 'config', 'http', and 'cookie'. The 'config' option is the default, and requires you to keep your MySQL password right here in this file, which I don't like. The 'http' option prompts you for the password when you access PhpMyAdmin, but will send the password in clear text, which I also don't like. The 'cookie' option is the best I think, and allows you to define a passphrase with the [blowfish_secret] parameter, which phpMyAdmin will use to encrypt the password in a cookie when you log in. To use the 'cookie' auth type, we need to make two changes. First, find the section of the file that looks like this:

/**
 * The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
 * at least one server configuration uses 'cookie' auth_type, enter here a
 * passphrase that will be used by blowfish. The maximum length seems to be 46
 * characters.
 */
$cfg[''] = '';

You need to change this line ..

$cfg[''] = '';

.. to something like the following. Note that you have to add the "blowfish_secret" part within the brackets (I don't know why). Note also that you will not be prompted for the passphrase you enter here, so feel free to make it a real ugly one.

$cfg['blowfish_secret'] = 'some_passphrase_under_46_characters_long';

Then find this line ..

$cfg['Servers'][$i]['auth_type']     = 'config';

... and change the auth type from 'config' to 'cookie', like so ..

$cfg['Servers'][$i]['auth_type']     = 'cookie';

That's it. Save the file.

Configuring Apache to Display phpMyAdmin

Now we need to tell Apache where phpMyAdmin lives, and also create an Apache alias for the phpMyAdmin directory (so we don't have to remember to type "phpMyAdmin-2.7.0-pl2" into the browser all the time). Also, since I don't want anyone else to even try logging in to phpMyAdmin, I will restrict access to just the IP address of my own workstation. To do all this we just need to add a small section to the file /etc/apache2/sites-available/mydomain.com that we created earlier. Add a section like the following, remebering to change the IP address to something appropriate.

# Provide an alias to phpmyadmin
Alias /phpmyadmin /usr/local/php5/phpMyAdmin-2.7.0-pl2
<Directory /usr/local/php5/phpMyAdmin-2.7.0-pl2>
        # Restrict phpmyadmin access to just my worksation
        Order Deny,Allow
        Deny from all
        Allow from 192.168.1.2
</Directory>

Reload Apache, and you should be able to point your browser at www.mydomain.com/phpmyadmin and login as the MySQL root user.
mysqldump 导出大表出错的解决:【上一篇】
linux下mysql 启动问题:【下一篇】
【相关文章】
  • 学会使用基于Web数据库的管理工具phpMyAdmin
  • 几个简单的mysql命令就可以解决的问题非要用什么phpmyadmin么?
  • 关于phpmyadmin2.8及以后版本的安装
  • Installing and configuring Exim 4 on Debian
  • Installing Simscan prerequisites
  • Installing DiskSuite
  • Installing Veritas volume manager 3.5
  • winxp下APACHE2+PHP5+MYSQL4+PHPMYADMIN 的配置
  • iis php zend mysql phpmyadmin
  • Apache+PHP+Mysql+PhpMyAdmin+IPB实战指南
  • 【随机文章】
  • All Aboard! SE 完全破解实战(3)
  • Net 是未来的趋势, 为什么?
  • 在PowerBulider中读写IC卡
  • switch_to
  • AuthorWare Attain中一个打包设置选项的妙用
  • CString详细讲解(ZT)
  • 《神迹》神灯高手论魔道正确的挂机设置
  • 如何让一个mc只播放一次,不循
  • 十一Gmail邀请大派送
  • 如何用Visual Basic编写小型的网络系统
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.