martedì 15 giugno 2010

Install mod_jk on CentOS 5.5

This little tutorial requires that apache and tomcat are installed. I used apache 2.2.3 and tomcat 6.0.20

Here are the instructions
-download mod_jk from tomcat website
-cd native
-./buildconfig.sh
-verify if you have apxs (Apache Extension tool). if not install latest httpd-devel rpm (you can search for it with "yum provides */apxs"
-./configure --with-apxs=/usr/sbin/apxs
-cp mod_jk.so /usr/lib64/httpd/modules/ (or wherever your lib modules are)
-touch /etc/httpd/workers.properties
-vim /etc/httpd/workers.properties

create a workers.properties file in your etc/httpd dir, with at least:

# workers.properties -
workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/lib/java
ps=/

worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13

add at least this to your httpd.conf

# Where to find workers.properties
JkWorkersFile /etc/httpd/workers.properties
# Where to put jk logs
JkLogFile /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel debug
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"



then, if you have not any VirtualHost, just add all the JkMount you need in order to reach your tomcat apps.
The following two lines query tomcat each time a.jsp or .do page is asked.
JkMount /*.jsp ajp13
JkMount /*.do ajp13
If you do have VirtualHosts defined, then be aware that Jkmounts are not inherited in any way. So, or you define JkMount inside all the Virtual hosts you expect to serve your apps, or define them globally and use JkMountCopy in the vhosts.

martedì 9 marzo 2010

venerdì 29 gennaio 2010

Enabling port forwarding in windows xp

it might happen you need to enable port forwarding in windoze. If so, you need to change this key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
set key IpEnableRouter to DWORD value 1
More info here

domenica 3 gennaio 2010

Eclipse Galileo + Ubuntu 9.10 buttons not responsive

Dear all,
today I upgraded my linux to Ubuntu 9.10 Karmic Koala and installed Eclipse 3.5
At a first sight, everything looked good, at a second not! I initially found that I couldn't install any new plugin in Eclipse, since the "Next" button in the install procedure, was clickable but not responsive. I initially thought about a plugins handling failure (like directory permission etc..) but then I discovered all the IDE was having this kind of problems.
I finally found the solution thanks to this post fix eclipse Basically the problem is into the updated GTK libraries and in particular the GDK api, who introduced the concept of client side windows. These new feature enables the developer to use handles windows without calling the underlying X server until explicitly required. In this way the system has reduced overhead (i.e. filckering) and it's possible to implement advanced graphical effects otherwise not availble.
Ok, now the solution :)
Basically Eclipse (but it seems this applies to Acroread too) does not support this feature (it should be from release 3.6) and then the problems. A patch to this mismatch is adding a global variable:
GDK_NATIVE_WINDOWS=1
This will disable the client windows and let eclipse work smoothly