系統(tǒng)運(yùn)維
1,首先編輯nginx.conf配置文件建(標(biāo)紅部分) server?{? ?????listen???????80; ?????server_name??xxxxx; ?????location?/?{? ????????????root???html; ????????????index??index.html?index.htm; ??????????? ??????????? ??????} 2,通過htpasswd命令生成用戶名及對應(yīng)密碼文件。? mkdir?/usr/local/nginx htpasswd?-c?/usr/local/nginx/passwd?admin???####創(chuàng)建認(rèn)證信息,admin?為認(rèn)證用戶名? New?password:?*******???####輸入認(rèn)證密碼? Re-type?new?password:?********???####再次輸入認(rèn)證密碼? Adding?password?for?user?admin? cat?/usr/local/nginx/passwd?????????????####可以看到通過htpasswd生成的密碼為加密格式 3,重啟nginx nginx?-s?reload