Apache server implements user authentication

zhaozj2021-02-16  81

Very simple, you don't have to watch it. ^ _ ^ Original: http://sjemayi.126.comhttp://mayi545.mblogger.cn

Source: traces of gray: Passengers please indicate the source :)

Apache Server Implementing User Verification Apache Server has built-in user verification mechanism, as long as it is set, you can control some parts of the website to implement user verification. As soon as I follow, I should easily implement user verification. Preparatory Apache must already be installed

Step 1: We build a Yanzheng directory under / var / www (Apache's home page root directory)

Mkdir /var/www/yanzhenghtp://61.191.20.150:81/mayi/yz/1.jpg

Step 2. Then we edit content in httpd.conf httpd.conf Lane added Allowoverride noneorder allow, denyallow from allauthtype basicauthname "qing shu ru yong hu ming he mi ma!" Authuserfile / etc / .htpasswdrequire valid-user

Http://61.191.20.150:81/mayi/yz/2.jpg

Step 3 is to create an Apache's verification user htpasswd -c /etc/.htpasswd mayiHttp: //61.191.20.150: 81 / mayi / yz / 3.jpg # will prompt the input password # / etc / .htpasswd is the password file storage Where the Mayi is a verification user # for the first time, creating a user to use the -c parameter for the second addition of the user, if you do not use the -c parameter If you want to change your password, you can click Htpasswd -m /etc/.htpasswd Mayi

OK, restart the Apache service, then access http: // Your website address / yanzheng If you go smoothly, you should be able to see a user-validated pop-up window, just fill in the username and password created by step 4.

Http://61.191.20.150:81/mayi/yz/4.jpGHttp://61.191.20.150:81/mayi/yz/yanzheng.jpGHttp:81/mayi/yz/yanzhenngyemian.jpGHTTP: //61.191.20.150:81/mayi/yz/5.jpg The following is a comment in httpd.conf

#The directory, that is, when accessing this directory, you will prompt the username and password, Allowoverride None # represents authentication. Server ignores the setting of the access control file Order Allow, Denyallow from ALL # Trust anywhere's ipauthty basIC # authtype specifies the type of authentication. In http1.0, there is only one certification type: Basic. There are several types of certification in HTTP1.1, such as: MD5. Authname "Qing Shu Ru Yong Hu Ming He Mi MA!" # 弹 弹 出 a 地))))))))))) 或)) 地))) 地 用户 用户 地 用户 用户 用户 用户 用户 用户The group can be licensed. Such as: Require User1 User2 (User 1 and User2 can be accessed) Require Valid-User (any user can be accessed in AuthiSerfile)

转载请注明原文地址:https://www.9cbs.com/read-13065.html

New Post(0)