Procédure
- Arrêtez votre serveur Tomcat.
- Paramétrez la configuration. Le fichier de configuration est <TomcatPath>/bin/setenv.sh. Si le fichier n'existe pas, créez-le.
-
Ajoutez les paramètres suivants en les modifiant pour les adapter à votre configuration :
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. CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyPort=YourHttpProxyPort # Specify the port number of your proxy server. 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.
Par exemple :CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyHost=proxy.server.com CATALINA_OPTS=$CATALINA_OPTS -Dhttp.proxyPort=3128 CATALINA_OPTS=$CATALINA_OPTS -Dhttp.nonProxyHosts="localhost|host.mydomain.com|192.168.0.1"
Si vous utilisez un proxy avec une authentification, allez dans le fichier<tomcat_path>/WEB-INF/classes/configuration.properties
et décommentez les lignes suivantes :- proxy avec le protocole HTTP :
#http.proxyUser=someuser #http.proxyPassword=somepassword
- proxy avec le protocole HTTPS :
#https.proxyUser=someuser #https.proxyPassword=somepassword
- proxy avec le protocole HTTP :
- Redémarrez votre serveur Tomcat.