Saturday, 13 September 2014

Define Variables in Log4j

we Have WebSphere running multiple JVM servers; each JVM has their log file system directory for log4j logging we can configure path as follows.


Define variables in log4j.properties as below.

1)
log4j.appender.logFileAudit.File=/var/logs/${server.name}/application.log


2)
Set the variable server.name in the JVM arguments. For WebSphere update server.xml

<jvmEntries debugArgs="-Dcom.ibm.ws.classloader.j9enabled=true -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777" debugMode="false" disableJIT="false" genericJvmArguments="-Xquickstart -Dserver.name=server1"…

to configure above go to 


Application servers > server1 > Process definition > Java Virtual Machine

add Generic JVM arguments with value .....        

-Dserver.name=server1

X-Forwarded-For

How do we  configure IBM HTTP Server to set a header called "X-Forwarded-For" equal to the IP address of the client?


Note:The X-Forwarded-For header is not required by IBM HTTP Server (IHS) or by IBM WebSphere Application Server (WAS). But it may be required by software from other vendors.


#######set a header called "X-Forwarded-For" equal to the IP address of the client######
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
RewriteEngine on
RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L]
RequestHeader set x-forwarded-for %{CLIENT_IP}e




  1. To configure IBM HTTP Server to set the X-Forwarded-For header to the client IP address, in a non-proxy request, you need to enable the mod_rewrite and mod_headers modules, and then add the following lines in the IBM HTTP Server config (httpd.conf):
  2. No configuration is necessary when IBM HTTP Server is configured as a reverse proxy, as this header is added automatically by mod_proxy_http
  3. more:http://en.wikipedia.org/wiki/X-Forwarded-For

Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Failed to create a thread: retVal -1073741830, errno 11" received

1. Output of the following commands (non root): ulimit -u ulimit -a df -k 2. From any of the JVM that is running, please get it's...