如何将新环境变量插入指令中?

时间:2016-12-08 03:23:06

标签: apache .htaccess ubuntu

我在服务器上,我唯一可用的配置Apache的功能是通过.htaccess文件。因此,在Ubuntu Linux上没有添加Apache模块,没有httpd.conf访问等Apache 2.2。

我需要根据现有的环境变量创建一个新的环境变量。

SetEnv my_new_var /debug/path/to/password/.passwd
SetEnvIf PREESTABLISHED_VAR "a" my_new_var=/first/path/to/password/.passwd
SetEnvIf PREESTABLISHED_VAR "b" my_new_var=/second/path/to/password/.passwd
AuthType basic
AuthName "User name"
AuthUserFile ???????
Require valid-user

我如何为AuthUserFile的值替换my_new_var的值来代替问号?

AuthUserFile my_new_var

产生日志错误

No such file or directory: Could not open password file: /etc/apache2/my_new_var

AuthUserFile $my_new_var

产生日志错误

No such file or directory: Could not open password file: /etc/apache2/$my_new_var

AuthUserFile ${my_new_var}

产生日志错误

No such file or directory: Could not open password file: /etc/apache2/${my_new_var}

(作为不应该影响解决方案的附注,使用https而非http来提供身份验证;密码文件在文档系统之外;并且密码内的密码被散列。)

0 个答案:

没有答案
相关问题