Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-05 Thread Jens-U. Mozdzen

Hi Dirk,

Zitat von Dirk Devos :

So, if I understand this correctly I should be putting my changes in
"/usr/sbin/apachectl" and not "/etc/sysconfig/httpd".


this depends on your distribution's setup. In my case I can see that  
apache(2)ctl does *source* /etc/sysconfig/apache2, which would be then  
the proper place for local customization. How your distro handles  
this, is something you will have to find out (i.e. by looking at your  
apachectl script).



So if I want to have a variable available to me in httpd.conf that contains
the server's host name that I am running on, what do I need. I have tried
variable=$(hostname) and variable=`hostname` and when I use that variable in
httpd.conf is always resolves to the actual literal "$(hostname)" or
"`hostname`".


Why your variables aren't set properly is a different (shell  
scripting) story, maybe running your script via "set -x" will give you  
a clue.


Regards,
Jens


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-05 Thread Dirk Devos
So, if I understand this correctly I should be putting my changes in
"/usr/sbin/apachectl" and not "/etc/sysconfig/httpd". 

So if I want to have a variable available to me in httpd.conf that contains
the server's host name that I am running on, what do I need. I have tried
variable=$(hostname) and variable=`hostname` and when I use that variable in
httpd.conf is always resolves to the actual literal "$(hostname)" or
"`hostname`".

The naming convention for our hostnames tells us if it is a development server
or a production server. I want to use that to create http.conf files that are
more generic across all our apache servers.



-- Original Message --
Received: 01:50 PM CDT, 06/03/2015
From: Andy Wang 
To: 
Subject: Re: [users@httpd] Documentation for /etc/sysconfig/httpd file



On 06/03/2015 10:31 AM, Jens-U. Mozdzen wrote:
> Hi Dirk,
>
> Zitat von Dirk Devos :
>> Hi,
>>
>> I am running Redhat 7.1 and apache 2.4 but I am not able to find any
>> documentation on the "/etc/sysconfig/httpd" file.
>> [...]
>> This works.
>>
>> HTTPD_ENV_NAME="devl"
>>
>>
>> I have tried the following with no success.
>>
>> HTTPD_HOSTNAME=`hostname`
>> HTTPD_HOSTNAME=${hostname}
>> HTTPD_HOSTNAME=$(hostname)
>
> the first an the last line should work (while I prefer the $() version)
> - what catches the eye is the change in variable names (HTTPD_ENV_NAME
> vs. HTTPD_HOSTNAME)...
>
> Regards,
> Jens
>

Couple of starter points
1) the apache httpd project is not responsible for the distribution 
specific builds.  The /etc/sysconfig/httpd thing is a red hat-ism.
2) you should contact red hat for support on that

In general /etc/sysconfig/httpd (which at some point will be deprected 
-it already is with fedora as systemd generally doesn't use 
/etc/sysconfig files) are simply ./sourced into the init script 
environment.  So if the particular VARNAME value is actually USED by the 
distro init scripts and passed into it's httpd configuration, it will be 
used.  If it's not, then it doesn't actually have any impact at all.  So 
you'll want to look more closely at the init script and the httpd 
configuration files to even know if what you're trying to do in 
/etc/sysconfig/httpd is doable.

Andy


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-04 Thread Jens-U. Mozdzen

Hi Dirk,

Zitat von Dirk Devos :
I am confused. Based on the documentation on apache's website we  
need to use "apachectl" but in that module it says to use  
"apachectl". So what is the right place.


hm, looks identical to me ;) And on a random machine I picked to look  
things up, it's "apache2ctl" :D


I realize that the variables are different and that was done on  
purpose. I wanted to compare the two ways of assigning a value.


and what happens if you dynamically assign a value to the variable  
that's currently working statically and vice versa?


To me it looks like you have to find out if either

a - it's a problem assigning the value (including finding the right  
place to do so), which is more of a "shell programming" question, or


b - it's a problem of accessing the content of a shell variable from  
where you're trying to do so (which might be an httpd question)


Regards,
Jens


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



RE: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-03 Thread Dirk Devos
I am confused. Based on the documentation on apache's website we need to use 
"apachectl" but in that module it says to use "apachectl". So what is the right 
place.

I realize that the variables are different and that was done on purpose. I 
wanted to compare the two ways of assigning a value. 

**   From http://httpd.apache.org/docs/2.4/programs/apachectl.html
apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) 
server. It is designed to help the administrator control the functioning of the 
Apache httpd daemon.
The apachectl script can operate in two modes. First, it can act as a simple 
front-end to the httpd command that simply sets any necessary environment 
variables and then invokes httpd, passing through any command line arguments. 
Second, apachectl can act as a SysV init script, taking simple one-word 
arguments like start, restart, and stop, and translating them into appropriate 
signals to httpd.
If your Apache installation uses non-standard paths, you will need to edit the 
apachectl script to set the appropriate paths to the httpd binary. You can also 
specify any necessary httpd command line arguments. See the comments in the 
script for details.
The apachectl script returns a 0 exit value on success, and >0 if an error 
occurs. For more details, view the comments in the script.


**   So I found the "apachectl" file in "/usr/sbin/" and in the file I 
found the following.
if [ "x$2" != "x" ] ; then
echo Passing arguments to httpd using apachectl is no longer supported.
echo You can only start/stop/restart httpd using this script.
echo If you want to pass extra arguments to httpd, edit the
echo /etc/sysconfig/httpd config file.
fi

-Original Message-
From: Jens-U. Mozdzen [mailto:jmozd...@nde.ag] 
Sent: Wednesday, June 03, 2015 2:45 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

Hi Andy,

Zitat von Andy Wang :
> On 06/03/2015 10:31 AM, Jens-U. Mozdzen wrote:
>> Hi Dirk,
>>
>> Zitat von Dirk Devos :
>>> Hi,
>>>
>>> I am running Redhat 7.1 and apache 2.4 but I am not able to find any 
>>> documentation on the "/etc/sysconfig/httpd" file.
>>> [...]
>>> This works.
>>>
>>> HTTPD_ENV_NAME="devl"
>>>
>>>
>>> I have tried the following with no success.
>>>
>>> HTTPD_HOSTNAME=`hostname`
>>> HTTPD_HOSTNAME=${hostname}
>>> HTTPD_HOSTNAME=$(hostname)
>>
>> the first an the last line should work (while I prefer the $() 
>> version)
>> - what catches the eye is the change in variable names 
>> (HTTPD_ENV_NAME vs. HTTPD_HOSTNAME)...
>>
>> Regards,
>> Jens
>>
>
> Couple of starter points
> 1) the apache httpd project is not responsible for the distribution 
> specific builds.  The /etc/sysconfig/httpd thing is a red hat-ism.

just for the records, you'll see that with SUSE Linux Enterprise
(SLES) as well, at least up to (still widely used) SLES11.

> 2) you should contact red hat for support on that
>
> In general /etc/sysconfig/httpd (which at some point will be deprected 
> -it already is with fedora as systemd generally doesn't use 
> /etc/sysconfig files) are simply ./sourced into the init script

well, had you redirected the OP to some shell scripting list, I'd have agreed, 
but...

> [...] So you'll want to look more closely at the init script and the 
> httpd configuration files to even know if what you're trying to do in 
> /etc/sysconfig/httpd is doable.

...obviously he already found a working way of setting the value statically, 
but didn't manage to do so dynamically. Hence I thought it polite to point out 
that mismatch in variable names between these two variants.

Regards,
Jens


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-03 Thread Jens-U. Mozdzen

Hi Andy,

Zitat von Andy Wang :

On 06/03/2015 10:31 AM, Jens-U. Mozdzen wrote:

Hi Dirk,

Zitat von Dirk Devos :

Hi,

I am running Redhat 7.1 and apache 2.4 but I am not able to find any
documentation on the "/etc/sysconfig/httpd" file.
[...]
This works.

HTTPD_ENV_NAME="devl"


I have tried the following with no success.

HTTPD_HOSTNAME=`hostname`
HTTPD_HOSTNAME=${hostname}
HTTPD_HOSTNAME=$(hostname)


the first an the last line should work (while I prefer the $() version)
- what catches the eye is the change in variable names (HTTPD_ENV_NAME
vs. HTTPD_HOSTNAME)...

Regards,
Jens



Couple of starter points
1) the apache httpd project is not responsible for the distribution  
specific builds.  The /etc/sysconfig/httpd thing is a red hat-ism.


just for the records, you'll see that with SUSE Linux Enterprise  
(SLES) as well, at least up to (still widely used) SLES11.



2) you should contact red hat for support on that

In general /etc/sysconfig/httpd (which at some point will be  
deprected -it already is with fedora as systemd generally doesn't  
use /etc/sysconfig files) are simply ./sourced into the init script


well, had you redirected the OP to some shell scripting list, I'd have  
agreed, but...


[...] So you'll want to look more closely at the init script and the  
httpd configuration files to even know if what you're trying to do  
in /etc/sysconfig/httpd is doable.


...obviously he already found a working way of setting the value  
statically, but didn't manage to do so dynamically. Hence I thought it  
polite to point out that mismatch in variable names between these two  
variants.


Regards,
Jens


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-03 Thread Andy Wang



On 06/03/2015 10:31 AM, Jens-U. Mozdzen wrote:

Hi Dirk,

Zitat von Dirk Devos :

Hi,

I am running Redhat 7.1 and apache 2.4 but I am not able to find any
documentation on the "/etc/sysconfig/httpd" file.
[...]
This works.

HTTPD_ENV_NAME="devl"


I have tried the following with no success.

HTTPD_HOSTNAME=`hostname`
HTTPD_HOSTNAME=${hostname}
HTTPD_HOSTNAME=$(hostname)


the first an the last line should work (while I prefer the $() version)
- what catches the eye is the change in variable names (HTTPD_ENV_NAME
vs. HTTPD_HOSTNAME)...

Regards,
Jens



Couple of starter points
1) the apache httpd project is not responsible for the distribution 
specific builds.  The /etc/sysconfig/httpd thing is a red hat-ism.

2) you should contact red hat for support on that

In general /etc/sysconfig/httpd (which at some point will be deprected 
-it already is with fedora as systemd generally doesn't use 
/etc/sysconfig files) are simply ./sourced into the init script 
environment.  So if the particular VARNAME value is actually USED by the 
distro init scripts and passed into it's httpd configuration, it will be 
used.  If it's not, then it doesn't actually have any impact at all.  So 
you'll want to look more closely at the init script and the httpd 
configuration files to even know if what you're trying to do in 
/etc/sysconfig/httpd is doable.


Andy


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-03 Thread Jens-U. Mozdzen

Hi Dirk,

Zitat von Dirk Devos :

Hi,

I am running Redhat 7.1 and apache 2.4 but I am not able to find any
documentation on the "/etc/sysconfig/httpd" file.
[...]
This works.

HTTPD_ENV_NAME="devl"


I have tried the following with no success.

HTTPD_HOSTNAME=`hostname`
HTTPD_HOSTNAME=${hostname}
HTTPD_HOSTNAME=$(hostname)


the first an the last line should work (while I prefer the $()  
version) - what catches the eye is the change in variable names  
(HTTPD_ENV_NAME vs. HTTPD_HOSTNAME)...


Regards,
Jens


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] Documentation for /etc/sysconfig/httpd file

2015-06-03 Thread Dirk Devos
Hi,

I am running Redhat 7.1 and apache 2.4 but I am not able to find any
documentation on the "/etc/sysconfig/httpd" file.

I am new to apache and I am trying to save the value of "uname -n" to a
variable and from what I was reading the place to set the value would be in
the "/etc/sysconfig/httpd" file. 

I was able to assign a constant value to a variable but I would like to get
the name of the server that is running the httpd daemon so that I can use
regex to determine if I am running in development or production.


This works.

HTTPD_ENV_NAME="devl"


I have tried the following with no success.

HTTPD_HOSTNAME=`hostname`
HTTPD_HOSTNAME=${hostname}
HTTPD_HOSTNAME=$(hostname)

Any help on what I am doing wrong would be appreciated.


-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org