01 September, 2008

Access logging under Tomcat

Do you want to get "access.log" file under Apache Tomcat Server as well as under Apache HTTP Server? Like this: - - [25/Aug/2008:15:08:11 +0400] "GET / HTTP/1.1" 200 82777 - - [25/Aug/2008:15:08:11 +0400] "GET /js/event-debug.js HTTP/1.1" 200 88582 - - [25/Aug/2008:15:08:11 +0400] "GET /js/history-debug.js HTTP/1.1" 200 28540 - - [25/Aug/2008:15:08:11 +0400] "GET /js/prototype.js HTTP/1.1" 200 126120 - - [25/Aug/2008:15:08:11 +0400] "GET /js/json2.js HTTP/1.1" 200 9490 - - [25/Aug/2008:15:08:12 +0400] "GET /css/app.css HTTP/1.1" 200 1937

Just insert one line into the "Engine" section of the "server.xml" file:
<Engine name="Catalina" defaultHost="localhost">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="access." suffix=".log" pattern="common"/>

Also it is possible to collect and filter the set of raised files via this script:


cat access.log | cut -f2 -d"\"" access.log | cut -f2 -d" " | egrep -v -f ignore.txt | sort

//Any other patterns

HowTo run IntelliJ IDEA from the RAM-Drive under Linux

Sometimes people need to run IntelliJ IDEA at "readonly" systems.
"Readonly" I mean - without unpacking IDEA into the local file system.

These scripts will help extract and start IDEA from the RAM-Drive and remove it after using:


export JDK_HOME=/usr/lib/jvm/java-6-sun
export REQUIRED_JVM_ARGS="-Didea.system.path=$IDEA_HOME/system -Didea.config.path=$IDEA_HOME/config"

mkdir $IDEA_HOME

sudo mount -t ramfs none $IDEA_HOME
tar -xz --strip 1 --file $IDEA_TAR_GZ -C $IDEA_HOME





sudo umount $IDEA_HOME
rm -rf $IDEA_HOME

Of course you should buy IntelliJ IDEA license, get open source license or... use evaluation version.