LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 568|回复: 0

apache服务器实现用户验证

[复制链接]
发表于 2005-4-26 14:32:43 | 显示全部楼层 |阅读模式
1、vi /etc/httpd/conf/httpd.conf
     <Directory "/var/www/html/test">
           AllowOverride None  //不使用.htaccess文件
       AuthType Basic
         AuthName "share area"
        AuthUserFile  /var/www/html/test/htpasswd
        require user frank
    </Directory>

2、创建认证口令,并添加用户
   mkdir /var/www/html/test
    cd /var/www/html/test
    htpasswd -c htpasswd frank //修改口令用htpasswd -m htpasswd frank
3、将口令属主改为apaceh
    chown apache:apache htpasswd
4、重新启动httpd
    service httpd restart
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表