RHEL で Apache httpd に環境変数をエクスポートする方法
Issue
-
環境変数を
httpdサービスにエクスポートし、それを設定ファイルで使用するにはどうすればよいですか? これは httpd のバージョンと RHEL のバージョンで異なりますか? -
環境変数を
/etc/sysconfig/httpdに追加しました。これは RHEL6 では機能しますが、RHEL7 でsystemctl start httpdを実行すると、次のようなエラーが発生します。systemd[1]: Ignoring invalid environment assignment 'export MY_CUSTOM_VARIABLE=prod.example.com': /etc/sysconfig/httpd -
RHEL7 および RHEL8 では、
/etc/sysconfig/httpdのカスタム環境変数は、apachectlを使用する場合に表示されますが、systemctl start httpdで Apache を起動する場合には表示されません。 -
RHEL7 および RHEL8 では、
/etc/sysconfig/httpdのカスタム環境変数は、systemctl start httpdを使用する場合には表示されますが、apachectlを使用する場合には表示されません。
Environment
- Red Hat Enterprise Linux
- Apache httpd
/etc/sysconfig/httpdまたは/etc/systemd/system/httpd*でエクスポートされるカスタム環境変数
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.