3

Where can I find the envvars configuration file (if there are any) in CentOS?

I know in Ubuntu, Apache2, I can find it from /etc/apache2/envvars

I've tried the command,

export EXAMPLE=value command. Does it require server restart to get it affected?

Please advise, thanks in advance :)

Vaishak
  • 133

3 Answers3

4

Global Environment variable file is :- /etc/profile

Local Environment Variable ( User Specific ) file is :- ~/.bash_profile

1

Rehdat Equiv to /etc/apache2/envvars

The Redhat and Centos equiv to /etc/apache2/envvars is /etc/sysconfig/httpd

The other answers are also correct if you are ok with the variables being truly global. Using /etc/sysconfig/httpd will keep the variables confined to httpd.

As Siddharth sharma pointed out, you can also set the environment variable in the apache config.

e.g.

SetEnv TMPDIR /var/www/.cgitmp
Aaron
  • 2,899
  • 2
  • 14
  • 31
0

Just run set and you will see all env variables of your session.
export acts immideately, you don't need any extra actions.

user1700494
  • 1,662