2017-09-06 5 views
0

私はApache 2.0のRedHat 7.xで動作しているapache 2.4を持っています。 HTTPSのVirtualHostセクションhttpd-ssl.confでapacheの実行スクリプトと変数を変数として使用する方法

... 

<VirtualHost _default_:8082> 

DocumentRoot "/some/location/httpd2_4_27/htdocs" 
ServerName some_url:8082 
... 
... 

# RewriteMap elastic_cookies "prg:/some/location/get_cookies.sh" 
# SetEnv ELASTIC5 %{elastic_cookies}e 


SetEnv ELASTIC5 "some_long_cookie_string" 

RequestHeader set Cookie "SSOLogin=badcookie; SSOCookie=%{ELASTIC5}e" 

ProxyPass/https://my.web/o/rest/user 
ProxyPassReverse/https://my.web/o/rest/user 

</VirtualHost> 

私は私のウェブサーバ上で電話をかけるときしかし、私は基本的にそれをクッキーために電話をかけるだろう シェルスクリプトを実行できるようにしたいでしょうsome_long_cookie_stringを動的に提供してください。

ハードコードされていると機能します。私は必要なもの

SetEnv ELASTIC5 "some_long_cookie_string" 

は、私の意見では、このようなものですが、それが動作していません。

# RewriteMap elastic_cookies "prg:/some/location/get_cookies.sh" 
# SetEnv ELASTIC5 %{elastic_cookies}e 

私の目標はスクリプトと出力get_cookies.shを呼び出すことです - >some_long_cookie_string意志すべての呼び出しで動的に設定することができます。

任意のアイデア?????????????

答えて

0

詳細な説明は、このブログ https://linuxinuse.com/devopsblogで見つけることができるの下に貼付されている方法はApache 2.4の設定に変数を使用する答え、https://linuxinuse.com/devopsblog/make-heartbeat-5-use-ssocookies-authentication-method-leveraging-apache-2-4-proxy-dynamically-loaded-ssocookies-variable/

Listen 8000 
... 
SSLProxyEngine on 
RewriteEngine On 
RewriteMap elastic_cookies "txt:/opt/apache/httpd_2.4/up_to_date_cookie.txt" 
RewriteRule (.*) - [E=ELASTIC5:${elastic_cookies:my_cookies},P] 
RequestHeader set Cookie "SSOLogin=badcookie; SSOCookie=%{ELASTIC5}e" 
ProxyPass /end_point http://www.endpoint.com 
ProxyPassReverse /end_point http://www.endpoint.com 
ProxyPass /other_end_point http://www.other_end_point.com 
ProxyPassReverse /other_end_point http://www.other_end_point.com 
</VirtualHost> 
関連する問題