# プロキシサーバーを使用するようTomcatを設定

## 手順

1. Tomcatサーバーを停止します。
2. 設定は、Talend Administration Centerの実行方法によって異なります。
   * Talend Administration Centerをサーバーモジュールとして実行している場合は次のとおりです。
     1. &lt;TomcatPath&gt;\binに移動し、setenv.batファイルを編集します。このファイルが存在しない場合は作成します。
     2. 次のパラメーターを追加し、設定に一致するよう変更します:
        ```
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.proxyHost=proxy.server.com # Specify the host name or IP address of your HTTP proxy server. You can use this parameter for http and https host names.
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.proxyPort=YourHttpProxyPort # Specify the port number of your proxy server.
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1" # Specify a list of hosts separated by "|" that do not require access through your proxy server.
        ```

        例:
        ```
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.proxyHost=proxy.server.com 
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.proxyPort=3128
        set CATALINA_OPTS=%CATALINA_OPTS% -Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1"
        ```
     3. 認証付きプロキシを使用する場合は、&lt;tomcat\_path&gt;/WEB-INF/configuration.propertiesファイルに移動して以下の行をコメント解除します。
        * 認証付きプロトコル:
          ```
          #http.proxyUser=someuser
          #http.proxyPassword=somepassword
          ```
        * 認証付きHTTPSプロトコル:
          ```
          #https.proxyUser=someuser
          #https.proxyPassword=somepassword
          ```
   * Talend Administration CenterをWindowsサービスとして実行している場合は、WindowsのコマンドプロンプトでJavaプロパティを次のように変更します:
     1. 次のコマンドを実行します:
        ```
        <tomcat_directory>\bin\tomcat9w.exe //ES//talend-tac-x.x.x ++JvmOptions=-Dhttp.proxyHost=proxy.server.com
        <tomcat_directory>\bin\tomcat9w.exe //ES//talend-tac-x.x.x ++JvmOptions=-Dhttp.proxyPort=YourHttpProxyPort
        <tomcat_directory>\bin\tomcat9w.exe //ES//talend-tac-x.x.x ++JvmOptions=-Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1" 
        ```

        例:
        ```
        C:\Talend\7.3.1\tac\apache-tomcat\bin\tomcat9w.exe //ES//talend-tac-7.3.1 ++JvmOptions=-Dhttp.proxyHost=proxy.server.com
        C:\Talend\7.3.1\tac\apache-tomcat\bin\tomcat9w.exe //ES//talend-tac-7.3.1 ++JvmOptions=-Dhttp.proxyPort=3128
        C:\Talend\7.3.1\tac\apache-tomcat\bin\tomcat9w.exe //ES//tvalend-tac-7.3.1 ++JvmOptions=-Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1" 
        ```

   プロキシ設定の詳細は、https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.htmlをご覧ください。
3. Tomcatサーバーを再起動します。