2

On my RHEL 7.1 I am running trying to set some environment variables for the IBMs httpd service. The variables are picked up by my httpd.conf to allow me to re-use it for multiple environments.

For whatever reason, the sysop didn't install it as a "proper" systemd snippet, so I only have

/etc/sysconfig/httpd

to work with

Contents of file looks like

HTTPD=/opt/IBMIHS/bin/httpd
OPTIONS="-f httpconf/httpd.conf" 

I then try to add

export my.server.name='www.domain.com'

and restart the httpd service by issuing

systemctl start httpd

And get the following error:

Ignoring invalid environment assignment 'export my.server.name='www.domain.com': /etc/sysconfig/httpd

I tried a few other permutations, like HTTPD_my.server.name=, but that gave the same response.

Anybody seen this? It might be RHEL related, as I have found many pages where they show this exact way to set the environment variables to expose to Apache.

Soraz
  • 225
  • 1
  • 4
  • 11

1 Answers1

3

D'oh

I forgot that *nix has very specific rules for how an environment variable can be named.

Only A-Z+ numbers + _, so by changing

export my.server.name='www.domain.com'

to

MY_SERVER_NAME='www.domain.com'

everything worked as expected.

The error message was what threw me off. By "Assignment" i assumed it mean the problem was on the RIGHT side of the assignment, i.e. the value that was being assigned.

Soraz
  • 225
  • 1
  • 4
  • 11