Apache Server configuration support - Apache - define and use custom variables in config

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > August 2006 > Apache - define and use custom variables in config





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache - define and use custom variables in config
mirko4u@gmail.com

2006-07-30, 7:32 am

Hi,

I'd like to define custom variables in the http.conf file, and then use
them in the directives.
This would save lots of time when you want to use the same
configuration for move than one pc, allowing you to change only a few
lines in the config.

How is it possible ?
Does anyone know how to do it ?

Thank you in advance.
Mirko
PS. I'm using Apache 2.0 but soon upgrading to 2.2.

Flamer

2006-07-31, 1:25 am


mirko4u@gmail.com wrote:

> Hi,
>
> I'd like to define custom variables in the http.conf file, and then use
> them in the directives.
> This would save lots of time when you want to use the same
> configuration for move than one pc, allowing you to change only a few
> lines in the config.
>
> How is it possible ?
> Does anyone know how to do it ?
>
> Thank you in advance.
> Mirko
> PS. I'm using Apache 2.0 but soon upgrading to 2.2.


SetEnv varname VALUE

sets the enviroment variable varname to VALUE.

Flamer.

mirko4u@gmail.com

2006-08-02, 7:24 pm

Thank you but that is for defining environment variables, that can be
read from php for example. I don't think these environment variables
can be defined and used within the config file.

How do I define a variable in the config file of Apache, and use it
inside the config itself ?

For example to define common paths and then use them in DocumentRoot
and the other directives.
Something like
SetEnv COMMONPATH "C:\somewhere"
DocumentRoot COMMONPATH

Ciao
Mirko


Flamer wrote:
> mirko4u@gmail.com wrote:
>
>
> SetEnv varname VALUE
>
> sets the enviroment variable varname to VALUE.
>
> Flamer.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com