perl生产crypt脚本
cat passwd.pl
#!/usr/bin/perl
use strict;
my $pw=$ARGV[0] ;
print crypt($pw,$pw)."\n";
chmod +x passwd.pl
./passwd.pl 密码 (将输出crypt加密后的密码)
加入Nginx需要验证的目录
server
{
listen 80;
server_name passwd.1314it.com;
index index.html index.htm index.PHP;
root /var/www/html/url/passwd;
autoindex on;
access_log logs/passwd.1314it.com-access.log wwwlogs;
error_log logs/passwd.1314it.com-error.log;
location ^~ /
{
auth_basic "Authorized users only";
auth_basic_user_file /usr/local/Nginx/conf/passwd;
}
}