[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Apache 1.3.27 on WinXP - no HTTP authentication dialog box

Posted on 2003-02-27
6
Medium Priority
?
232 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
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
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.

 
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

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