我正试图测试一个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