English 中文(简体)
转正阿帕奇基本原因服务器连接故障
原标题:Turning on Apache Basic Auth causes server connection failure

我正试图测试一个Pache http://pache的网络服务器的基本认证单元。 出于某种原因,在我上台时,浏览器似乎甚至无法与服务器连接。 详情如下。 欢迎任何帮助。

OS: Mac OSX
Apache/Mysql
Browser: Safari

I have a mysql db "mydb" storing username and password in a table called "login". Password is encrypted using SHA.

我有一个像名录这样的结构。

/Users/Myname/Sites
/Users/Myname/Sites/Secret

I want to secure the Secreter.

在httpsd.conf,我有以下几行:

DBDriver mysql
DBDParams "dbname=mydb user=admin password=myadminpasswd"

DBDMin  4
DBDKeep 8
DBDMax  20
DBDExptime 300

<Directory "/Users/Myname/Sites/Secret">
 # core authentication and mod_auth_basic configuration                                                                                                                     
  # for mod_authn_dbd                                                                                                                                                       
  AuthType Basic
  AuthName "My Server"
  AuthBasicProvider dbd

  # core authorization configuration                                                                                                                                        
  Require valid-user

  # mod_authn_dbd SQL query to authenticate a user                                                                                                                          
  AuthDBDUserPWQuery "SELECT password FROM login WHERE username = %s"
</Directory>

After this I restart the apache httpd server. I cannot even access http://localhost anymore. It gives the following error: Safari can’t open the page “http://localhost/” because Safari can’t connect to the server “localhost”.

I was hoping to be able to access localhost but not http://localhost/~myname/Secret

Does anyone has any idea as to what went wrong?

I believe I can access the secret folder via http://mysername:mypasswd@localhost/~myname/Secret

Notes: I have made sure that the following is loaded in httpd.conf

mod_authz_user.so
mod_authn_dbd.so

thanks mbh

问题回答

请核对您的阿普切服务器记录,并看到你在重新启用时出现哪些错误。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签