apache_conf 用openssl替换htpasswd

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf 用openssl替换htpasswd相关的知识,希望对你有一定的参考价值。

#!/bin/sh

# Writes an APR1-format password hash to the provided <htpasswd-file> for a provided <username>
# This is useful where an alternative web server (e.g. nginx) supports APR1 but no `htpasswd` is installed.
# The APR1 format provides signifcantly stronger password validation, and is described here: 
#	 http://httpd.apache.org/docs/current/misc/password_encryptions.html

help (){
cat <<EOF
  Usage: $0 <htpasswd-file> <username>

  Prompts for password (twice) via openssl.

EOF
}

[ $# -lt 2 ] && help;
[ $# -eq 2 ] && printf "${2}:`openssl passwd -apr1`\n" >> ${1}

以上是关于apache_conf 用openssl替换htpasswd的主要内容,如果未能解决你的问题,请参考以下文章

PHP - 用 openssl_random_pseudo_bytes() 替换 mcrypt_create_iv()

apache_conf 在gulp构建过程中创建配置模块。 (替换引号的想法来自:https://github.com/guzart/gulp-ng-constant/issues/26#

apache_conf 用php轻松配置

apache_conf Laravel - 像老板一样修补(用PsySH)

apache_conf WordPress的高速化用の的.htaccess

apache_conf [Python,Flask]与doctests一起运行测试用例