How to use the setEnv variable in apache?

前端 未结 2 530
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 03:31

I need to set my apache environment to \'foobar\'

I know I need to set in in my vhost, but what should I type there and where?

2条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 04:02

    SetEnv sets a particular variable to some value, so you need something like

    SetEnv varname varvalue
    

    If this is for a specific virtual host, and you have access to the Apache configuration files, this would go inside the directive for that virtual host.

    If you don't have control of the config files, you'll need to put it in a .htaccess file. But for this to work, SetEnv must be allowed in .htaccess files, which is specified using the AllowOverride directive.

提交回复
热议问题