[Webinar] Streamline your web hosting managementRegister Today


Apache 1.3.27 on WinXP - no HTTP authentication dialog box

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-03-04
Ok I am pretty sure I have done everything right. I know that I should be using Apache on a UNIX or Linux box, but this is for learning purposes.

I have read quite a few response on here and none have solved my problem.

I have placed the following in my httpd.conf and opted against an .htaccess file

<Directory "C:/Program Files/Apache Group/Apache/htdocs/phpmyadmin/">
    AuthUserFile "C:/Program Files/Apache Group/Apache/pswds/.htpass"    
    AuthType Basic
    AuthName "Database Config - Restricted Access"
    require valid-user  

this returns:

401 - Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.


Apache/1.3.27 Server at localhost Port 80

The problem is that the dialog box that should come up doesn't. What am i doing wrong?

Question by:ricbax
LVL 15

Accepted Solution

samri earned 285 total points
ID: 8040675

First of all, you would need to request for the other 2 "duplicate" question to be delete.

Back on the original problem, it may had to do with the way phyMyadmin is configure.  Specifically the authentication/authorization stuff.

Following are the working example that I had on my machine (Win2K).

In Apache config (httpd.conf).

Alias /phpMyadmin "C:/Websites/phpMyAdmin"
<Directory "C:/Websites/phpMyAdmin">
    Options Indexes FollowSymLinks MultiViews ExecCGI
    AllowOverride AuthConfig
    Order allow,deny

and in c:/websites/phpMyadmin, I had .htaccess, and .htpasswd

AuthName        "Database Administration"
AuthType        Basic
AuthUserFile    C:/Websites/phpMyAdmin/.htpasswd
AuthAuthoritative       on
require         valid-user
Satisfy         any

--.htpasswd (needs to be created with htpasswd.exe)

And in config.php.inc, check the line, and add it with the url that you will us

$cfg['PmaAbsoluteUri'] = 'http://yourserver/phpmyadmin//';

I hope this would help.

Expert Comment

ID: 8042464
I ran into this problem myself.
The solution is to not use paths that include spaces in them.  A space in Apache is like a break.
You have two options:
1) Relocate your .htpasswd file to a folder that does not have any spaces in its name
2) I believe that the folder "Program Files" can be referred to as "Progra~1".  Try replacing "Program Files" with that.

Expert Comment

ID: 8042575
The Directory Directive is based off of your Document Root.  If your Docuemnt Root is C:/Program Files/Apache Group/Apache/htdocs then you should set your Directory Directive as follows.

<Directory /phpmyadmin>
   AuthUserFile "C:/Program Files/Apache Group/Apache/pswds/.htpass"    
   AuthType Basic
   AuthName "Database Config - Restricted Access"
   require valid-user  

That should work provided you have created the password file as mentioned above.

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.


Expert Comment

ID: 8043675

Directory directive is based on the physical path on disc, just as it sounds.

Location directive on the other hand is based from document root, and I think it even works on aliases.

I agree with samri spaces are bad.
And you need both a .htaccess and a .htpasswd

You should have a file in bin dir of apache install.
I'm not sure in windows though.
You use this exe to create the password.

/Hans - Erik Skyttberg

Expert Comment

ID: 8044117

Please try the modification I sent.  I've tested it on my own box and it works.


Author Comment

ID: 8046330
The points are going to samri, his answer triggered the answer I was looking for with the line: $cfg['PmaAbsoluteUri'] = 'http://yourserver/phpmyadmin/';
in the config.php.inc file of phpmyadmin.

I realized that if you use http://localhost/phpmyadmin/ the dialog box will not pop-up because you are within your own local intranet. However if you type in that domain is recognized as an internet domain and then forces the dialog to pop-up.

I was still able to use only the httpd.conf file and .htpass file. No .htaccess file was necessary.

Thank you to everyone else that tried to solve my problem.    

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Suggested Courses
Course of the Month11 days, left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question