我可以在哪里findCentOS中的envvarsconfiguration文件(如果有的话)?
我知道在Ubuntu,Apache2,我可以从/etc/apache2/envvarsfind它
我试过这个命令,
export EXAMPLE=value命令。 是否需要重新启动服务器才能使其受到影响?
请指教,提前致谢:)
全局环境variables文件是: – /etc/profile
本地环境variables(User Specific)文件是: ~/.bash_profile
只要运行set ,你会看到你的会话的所有envvariables。
export行为,你不需要任何额外的行动。
Rehdat等于/ etc / apache2 / envvars
Redhat和CentOS等同于/ etc / apache2 / envvars是/etc/sysconfig/httpd
其他答案也是正确的,如果你确定variables是真正的全球性。 使用/etc/sysconfig/httpd将使variables局限于httpd。
正如Siddharth sharma指出的,你也可以在apacheconfiguration中设置环境variables。
例如
SetEnv TMPDIR /var/www/.cgitmp