phpMyAdmin to prompt for user password and user name

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

phpMyAdmin to prompt for user password and user name

Post 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?
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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).
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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"?
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post by ljCharlie »

Burrito, if I use windows permission to the actual folder, who should have the permission to access the folder?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

not IUSR_<SERVER_NAME>

but whoever else you want should
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post 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.
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post by ljCharlie »

Okay, I got the virtual directory created, but how do I direct the default home directory to this virtual directory?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

VD properties -> Documents Tab -> Remove what is there -> Add "index.php"
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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)
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

vd properties -> virtual directory tab -> Execute permissions -> scripts only.
Post Reply