print "test:$(openssl passwd -crypt 123456)\n" >>/home/httppwd
????????
这里用的nginx
server{
listen 80;
server_name www.xxx.com xxx.com;
index index.html index.php;
root /home/www/root/www.xxx.com;
location /
{
auth_basic "Please input your username and password!";
auth_basic_user_file /home/htpasswd;
}
}
保存后 检查一下语法是否正确 nginx -t?
重启nginx systemctl restart nginx