Apache 1.3.27 on WinXP - no HTTP authentication dialog box

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?

Who is Participating?
goodatunixConnect With a Mentor Commented:
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.

linxitConnect With a Mentor Commented:
How have you created the .htpass file? Does it contain all the users you want? It should look something like


The correct way is to run (for the first name)

htpasswd -c C:/Program Files/Apache Group/Apache/pswds/.htpass username

Then enter the password at the prompt

This also creates the file and truncates it if it exists, so for subsequent users you have to run the command without the -c flag.


just a thought that you are using cgi version og PHP and it dosent allow your http auth. to working with http auth you have to have ISAPI version of php installed on you IIS.
To use the ISAPI module, do the following:

    If you don't want to perform HTTP Authentication using PHP,
    you can (and should) skip this step. Under ISAPI Filters,
    add a new ISAPI filter. Use PHP as the filter name, and
    supply a path to the php4isapi.dll.

    Under 'Home Directory', click on the 'Configuration' button.
    Add a new entry to the Application Mappings. Use the path
    to the php4isapi.dll as the Executable, supply .php as the
    extension, leave Method exclusions blank, and check the
    Script engine checkbox.

    Stop IIS completely (net stop iisadmin)
    Start IIS again  (net start w3svc)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.