Page 1 of 3

phpMyAdmin to prompt for user password and user name

Posted: Wed Nov 16, 2005 8:50 am
by ljCharlie
I have setup my own IIS webserver with phpMyAdmin. How do set the config.inc.php so that when access the phpMyAdmin index page, the shows a logon for user name and password?

Posted: Wed Nov 16, 2005 8:57 am
by Maugrim_The_Reaper
type in "cookie", the others are "config" if you put the password in the config file (not recommended) or "http" for a login dialogue box.

Either cookie or http are generally used.

Posted: Wed Nov 16, 2005 8:59 am
by Burrito
for IIS, set permissions on the folder you could (windows permissions) then create a virtual directory and use windows permissiosn to access the VD you can.

prompt for a password it will (your windows credentials).

Posted: Wed Nov 16, 2005 9:07 am
by ljCharlie
Thank for the response. Here's what I have.

Code: Select all

$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = '';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
Now, this will give me an error saying access denied. So which line do I type in "cookie"?

Posted: Wed Nov 16, 2005 9:10 am
by ljCharlie
Burrito, if I use windows permission to the actual folder, who should have the permission to access the folder?

Posted: Wed Nov 16, 2005 9:12 am
by Burrito
not IUSR_<SERVER_NAME>

but whoever else you want should

Posted: Wed Nov 16, 2005 9:17 am
by ljCharlie
Okay, so I should first create those users in my windows Local Users and Groups/Users folder, correct? And after that I will be able to assing these people to the phpMyAdmin folder, correct? Now after I have all that done and created a virtual directory, these settings below should work on the web with a prompt for user name and password, right?

Code: Select all

$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = '';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed

Posted: Wed Nov 16, 2005 9:19 am
by Burrito
where the db un/pass goes in config.inc.php remember exactly I can not.

But somewhere in there need to put them you will.

Posted: Wed Nov 16, 2005 10:05 am
by Maugrim_The_Reaper

Code: Select all

$cfg['Servers'][$i]['auth_type']     = 'cookie';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = '';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
See where cookie is now? Leave user and password blank - type them in when the login dialogue appears. Luck.

Posted: Wed Nov 16, 2005 10:36 am
by ljCharlie
Okay, I got the virtual directory created, but how do I direct the default home directory to this virtual directory?

Posted: Wed Nov 16, 2005 10:42 am
by Burrito
VD properties -> Documents Tab -> Remove what is there -> Add "index.php"

Posted: Wed Nov 16, 2005 10:54 am
by ljCharlie
I understand that, but what do I do with the Home Directory tab of the Default Web Site? What should I use for the path of the Default Web Site? Here is the physical path of the folder structure.

D:\wwwroot\myDirectory\
D:\wwwroot\phpMyAdmin\

I want to use myDirectory to setup as the contents of my default website. So if I create myDirectory as the physical path of my VD, it will appear like this in the Default Web Site structure:

Default Web Site
---index.html
---testpage.html
---VD
---phpMyAdmin VD

I'm still confuse as to how I would define which VD to be my root website.

Posted: Wed Nov 16, 2005 11:03 am
by Burrito
understand you I do not.

a sample I will provide:

Code: Select all

assume domain is "mydomain.com"
and vd is called "db"

root of web points to d:\inetpub\wwwroot
root of vd (db) points to d:\inetpub\wwwroot\phpMyAdmin <-- This folder has windows permissions on it

both should have default file set to index.php

to hit your main web site by going to www.mydomain.com
hit your phpMyAdmin by going to www.mydomain.com/db

Posted: Wed Nov 16, 2005 11:28 am
by ljCharlie
Okay, when I tried what you suggested, I got this error on the page:
The page cannot be displayed
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
--------------------------------------------------------------------------------

Please try the following:

Contact the Web site administrator if you believe this directory should allow execute access.
HTTP Error 403.1 - Forbidden: Execute access is denied.
Internet Information Services (IIS)

Posted: Wed Nov 16, 2005 11:33 am
by Burrito
vd properties -> virtual directory tab -> Execute permissions -> scripts only.