Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

401 Error in Dreamweaver Connecting to Mysql DB (Apache)

Status
Not open for further replies.

mrhapyhipy

Technical User
Feb 24, 2005
7
GB
OK, where to be begin. I'm working on a dynamic site at the moment. I am using Apache1 with PHP4 and mysql as a testing server, on the localhost. I have Basic Authentication on the server (not an option to remove).

Now when I try and connect to a Mysql database I get a "HTTP 401 Unauthorised" error. Dreamweaver is uploading its invisible files to the server. But isn't getting any further.

I was wondering if anyone knows away around this. Either by making changes to Dreamweaver or disabling basic auth just for "Localhost".
 
setup:
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Cheers
But it's NOT a problem with apache, I have it running with PHP, SSL, and Basic Authentication, and it servers PHP pages (that get info from a MySQL DB) fine. I've tested the Auth realm in a browser and that works fine to, its when you connect to it with DW, it gives a 401 error, that is "Authentication Required". DW is connecting over FTP to the server and is uploading DW hidden files to the server. Really what I think is needed is for some how to get DW to send a username and password to apache when it requests those hidden files over HTTP. The invisible files I'm referring to are "_mmServerScripts"

Its also might me possible to get apache to ignore Basic Auth for localhost / .local . I know it can be done on other servers. Though how I don't know.

Is there anyone that has had this problem before?

 
then it must be the way u setup your connection to your site....being that is local there should not be any need to use FTP or any type of "connection" but rather just the path...or maybe I am not seeing how ur conneting....write more about your Site Setup in DW since server side is OK.
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
I tryed both methods of connecting first Local/Network then FTP as it asks for a username and Password, I thought it might use them to Authrise HTTP as well. But it didn't.

How I've got it set up is, I got Local files in the Documents folder. For testing they are copied over with DM to the testing server which is. /users/username/sites/ in the dir system. To get the pages on the server you could call username/ <-- (this is the Authentication protected realm) it all worked fine until I started using Basic Authentication.

Hope that is enough Info


Thanks
 
I found the solution.


Error 401 - Authorisation Error

Another error you may get is a 401 - Authorisation Error, which occurs if your web site is password protected, using an .htaccess file. This means that when Dreamweaver MX uploads its hidden files to get the database information and then tries to read it back, it can`t, because it can`t supply the password so is denied access to the files.

This only occurs if your main website directory is protected, and so by default, every directory underneath is also protected.

This problem is easy to solve. Create a plain text file called .htaccess. Add the following:

satisfy any allow from all

Save the file, and then upload it into the hidden directory _mmServerScripts which is in the web root directory of your website. This file turns off protection for this directory only, allowing Dreamweaver MX to read the files correctly and will allow you to connect to the database.

<!-- Thanks for your help libisol -->
 
Not a problem!
U did it...not me! ;-)
.htaccess is...part of the Apacehe config and should not be taken that lightly....read up on it before u put this thing in production!
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
No problem. Looking into only allowing localhost as I know MySQL details are stored in these hidden files. _mmServerScripts.

//As much as possible use the httpd.conf file rather then .htaccess files to cofigure Apache.

Thanks
 
cool, then ur on a good track!
Take care!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top