Yog tias xav tau kom txwv txoj kev nkag mus rau cov neeg tsis tuaj yeem rau lub vev xaib, tom qab ntawd cov kev daws teeb meem yooj yim yog kev siv cov ntawv tso cai los ua rau lub web server. Hauv qab no yog cov lus qhia txog kev ua raws nraim li cas ua tiav.
Cov Lus Qhia
Kauj ruam 1
Tsim cov nplaub tshev rau ntawm tus neeg rau zaub mov rau cov nplooj ntawv koj xav tiv thaiv thiab tsiv mus nyob rau ntawd. Yog tias koj xav txwv txoj kev nkag mus rau tag nrho cov nplooj ntawv, tom qab ntawd koj tuaj yeem hla cov kauj ruam no - kev tiv thaiv yuav raug teeb tsa rau hauv cov hauv paus ntawm koj qhov chaw.
Kauj ruam 2
Apache server qhov teeb meem ntawm cov kev ua yog xws li thaum nws pom ib qho kev pabcuam hu ua ".htaccess" hauv cov nplaub tshev, nws siv cov lus qhia uas muaj nyob hauv cov ntaub ntawv thaum ua cov ntaub ntawv thov los ntawm tus xaib mus rau cov ntaub ntawv hauv no thiab txhua subfolders. Koj yuav tsum tsim cov ntaub ntawv no thiab tso rau hauv nws cov lus taw qhia kom txwv tsis pub nkag mus rau txhua lossis cov ntawv ntiag tug hauv cov ntawv no. Tsim cov ntaub ntawv khoob (CTRL + N) thiab sau cov kab no rau hauv nws: AuthType Basic
AuthName "Kev nkag mus rau nplooj ntawv txwv!"
AuthUserFile /usr/account/site/.htpasswd
yuav tsum siv tau-tus neeg siv cov lus qhia ntawm thawj kab ntawv suav nrog kev tso cai siv tshuab (AuthType Basic). Nrog hom kev tso cai no, tus qhua tus lej xa tawm los ntawm lub browser zais nrog siv Base64 algorithm. Cov lus qhia hauv kab thib ob qhia cov ntsiab lus ntawm cov ntawv qhia tias tus browser yuav tso tawm thaum tus qhua nkag mus tiv thaiv ib feem ntawm lub xaib. Nkag mus rau hauv cov ntawv koj xav tau yam uas tsis siv cov cim ( ). Kab thib peb yog txoj hauv kev mus rau cov ntaub ntawv khaws cia tus ID nkag mus: cov khub password uas raug tso cai nkag mus rau cov nplooj ntawv ntawm cov ntawv no. Tus ID nkag mus khaws cia hauv cov ntawv ntshiab, thiab tus password Absolute (uas yog los ntawm server lub hauv paus) txoj hauv kev rau koj lub xaib tuaj yeem pom nyob hauv pawg tswj hwm ntawm lub xaib lossis nug hosting kev pab txhawb lossis lossis koj tuaj yeem siv phpinfo () cov lus ntawm PHP lus. Hauv kab plaub yog txhais qhov tseeb ntawm kev cai. Yog tias koj qhia tus nqi rau Tus Neeg Siv, tom qab ntawd tsuas yog cov neeg siv uas tau tso cai nkag mus yuav tsum tau teev nyob ntawm no cais los ntawm qhov chaw. los ntawm qhov chaw seem Yog tias siv tau-tus neeg siv - txhua tus neeg siv uas nws lub npe nyob rau hauv AuthUserFile.
Kauj ruam 3
Khaws cov ntawv tsim nyob hauv qab lub npe.htaccess los ntawm xaiv cov "Txhua cov ntaub ntawv" cov khoom hauv "Cov hom ntaub ntawv" daim ntawv teev cov ntawv sau tseg - qhov no thiaj li hais tias cov ntawv nyeem tsis cia li ntxiv txt qhov txuas ntxiv.
Kauj ruam 4
Tam sim no koj yuav tsum tsim cov ntawv zais (password) teev nyob hauv AuthUserFile kev taw qhia -.htpasswd. Qhov no yog ua los ntawm cov tuam txhab htpasswd.exe los ntawm Apache server. Nws nyob hauv rau hauv cov ntawv tais ceev tseg kom rub tawm cov nqi hluav taws xob no, piv txwv li, ntawm no - https://www.intrex.net/techsupp/htpasswd.exe Qhov no yog console program, ntawd yog, nws yuav tsum khiav los ntawm kab hais kom ua. Hauv Windows XP, koj tuaj yeem ua nws zoo li no: luam tawm htpasswd.exe rau lub nplaub tshev cais, nyem qhov nplaub tshev thiab xaiv "Run Command Prompt Here". Ntawm qhov kev hais kom ua, nkag mus: htpasswd -cm.htpasswd FirstUser Tus hloov "-cm" qhia tau tias yuav tsim ib tus password tshiab tsim thiab MD5 yog siv rau kev siv encryption (qhov no yog vim li cas lub Windows OS). Yog hais tias hloov los ntawm "m" koj qhia "d" - lub chaw tso dej yuav siv DES encryption algorithm, yog tias "s" - SHA algorithm, thiab yog tias "p" - lo lus zais yuav raug cawm yam tsis muaj encryption. FirstUser yog nkag mus ntawm thawj tus neeg siv hauv daim npe, hloov nws nrog qhov yuav tsum tau rau koj. Cov nqi hluav taws xob yuav nug tus password rau nws tom qab koj nias Enter. Txhawm rau ntxiv rau tus neeg siv tom ntej rau cov ntawv tsim, khiav cov nqi hluav taws xob dua, tab sis tsis muaj ntawv "c" hauv qhov hloov kho
Kauj ruam 5
Tso rau tsim.htaccess thiab.htpasswd cov ntaub ntawv ntawm tus neeg rau zaub mov ntawm koj lub xaib siv cov ntaub ntawv tus thawj tswj ntawm lub rooj tsav xwm lossis FTP tus thov. Cov ntaub ntawv.htaccess yuav tsum nyob hauv daim nplaub tshev qub nrog cov nplooj ntawv tiv thaiv, thiab.htpasswd ntawv yuav tsum nyob hauv daim nplaub tshev, txoj hauv kev uas koj tau teev nyob rau hauv AuthUserFile qhia. Feem ntau, cov ntawv zais (password) tau muab tso rau hauv cov npe chaw nyob sab saud lub hauv paus ntawm qhov chaw kom tsis suav nkag mus rau nws los ntawm Is Taws Nem.