基于MySQL的Apache用户认证 不指定

, 2007/08/14 22:13 , Apache , 评论(0) , 阅读(4687) , Via 本站原创 | |
wget http://mesh.dl.sourceforge.net/sourceforge/modauthmysql/mod_auth_mysql-2.9.0.tar.gz
tar xzfv mod_auth_mysql-2.9.0.tar.gz
cd mod_auth_mysql-2.9.0
/usr/local/apache/bin/apxs -c -I/usr/local/mysql/include -L/usr/local/mysql/lib -lmysqlclient -lm -lz mod_auth_mysql.c
/usr/local/apache/bin/apxs -i mod_auth_mysql.la
vi /usr/local/apache/conf/httpd.conf
添加:
LoadModule mysql_auth_module modules/mod_auth_mysql.so

<Directory "/www/client/awstats/cgi-bin">
        Options None
        AllowOverride AuthConfig
        Order allow,deny
        Allow from all
</Directory>

引用
.htaccess
AuthName "请输入访问相册的帐号密码:"
AuthType Basic
AuthUserFile /www/client/awstats/cgi-bin/.htpasswd
AuthType Basic
AuthName "请输入访问统计的帐号密码:"
AuthMySQLHost localhost
AuthMySQLPort 3306
AuthMySQLDB FTPdb
AuthMySQLUser FTPUSER
AuthMySQLPassword dfg5345345345756
AuthMySQLPwEncryption md5
AuthMySQLEnable On
AuthMySQLUserTable ftpd
AuthMySQLNameField User
AuthMySQLPasswordField Password
Require valid-user

#/usr/local/apache/bin/apachectl restart
搞定。
Tags:
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]