开发者

Use user-environment variable in apache

开发者 https://www.devze.com 2023-01-19 08:26 出处:网络
I create svn config file, use apache as: <Location /svn/myproject> SVNPath D:\\svnserver\\projects\\myproject\\svn

I create svn config file, use apache as:

<Location /svn/myproject>
SVNPath D:\svnserver\projects\myproject\svn   
AuthzSVNAccessFile D:\svnserver\projects\myproject\conf\access.conf   
Include D:\svnserver\projects\myproject\conf\require_users
</Location>

But root-path is repeated so much.

I want to set path as environment variable to simple this config.

SetEnvironment PROJECT_PATH D:\svnserver\projects

<Location /svn/myproject>
SVNPath $PROJECT_PATH\myproject\svn   
AuthzSVNAccessFile $PROJECT_PATH\myproject\conf\access.conf   
Include $PROJECT_PATH\myproject\conf\require_users
</Location>

Is this possible? How to implement this?

I tried with SetE开发者_开发技巧nv, SetEnvIf of Apache, but couldn't success.

Please help.


Per the documentation for SetEnv:

Sets an environment variable, which is then passed on to CGI scripts and SSI pages.

So using SetEnv (and SetEnvIf) makes the var available to scripts, but not to apache itself. Unfortunately what you're wanting to do isn't supported.

0

精彩评论

暂无评论...
验证码 换一张
取 消