?
Solved

Apache 1.3.27 on WinXP - no HTTP authentication dialog box

Posted on 2003-02-27
6
Medium Priority
?
231 Views
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  
</Directory>

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?

0
Comment
Question by:ricbax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Accepted Solution

by:
samri earned 285 total points
ID: 8040675
ricbax,

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
</Directory>


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

--.htaccess
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)
samri:<thepassword>

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.
0
 

Expert Comment

by:zshipley
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.
0
 

Expert Comment

by:goodatunix
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  
</Directory>

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

--Goodatunix
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 8

Expert Comment

by:heskyttberg
ID: 8043675
Hi!

goodatunix:
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.

Regards
/Hans - Erik Skyttberg
0
 

Expert Comment

by:goodatunix
ID: 8044117
Ricbax,

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

--goodatunix
0
 
LVL 3

Author Comment

by:ricbax
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 http://127.0.0.1/phpmyadmin/ 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.    
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 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