1.configure the config file httpd.conf or apache.conf
#vi /etc/httpd/conf/httpd.conf
2.edit description as below
AccessFileName .htaccess
<file>
Order allow,deny
Deny from all
</files>
<directory>
AllowOverride
AuthConfig
Order allow,deny
Allow from all
</directory>
3.create authorization file(authorize path)
# vi .htaccess
content as :
AuthName "(text name)"
Authtype Basic
AuthUserFile (authorization file path)
require user (username)
4.Create user and password
#htpasswd -c (authorization file path) (username)
it can enter several user and password.


沒有留言:
張貼留言