Google
Tech-Bits: March 2005

Tech-Bits

Saturday, March 26, 2005

Configuring and setting ProxyHTMLURLMap for Reverse Proxy with Apache2.2 on WindowsXP

ProxyHTMLURLMap - it rewrites links in the served webpages from the server which is being proxied.
But For enabling ProxyHTMLURLMap we need mod_proxy_html.so in your modules directory.

Steps:
download the package http://www.apachelounge.com/download/mods/mod_proxy_html-3.1.2-w32.zip
The install-help is in the readme.txt available in the zip, and I have detailed it here.

1. Create folder .../apache2/modules/mod_proxy_html
and copy mod_proxy_html.so

2. Install the Visual C++ 2008 Redistributable Package
Download, it from:
www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

3. A couple of pre-requisite dll's are needed on Windows.

4. Get the following from ftp://ftp.zlatkovic.com/libxml/
- libxml*.zip
- zlib*.zip
- iconv*.zip

5. Unpack the zip to extract the following files to the mod_proxy_html folder created above.
- iconv.dll
- zlib.dll
- libxml2.dll

6. Add to your httpd.conf
LoadModule headers_module modules/mod_headers.so
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadModule proxy_html_module modules/mod_proxy_html.so

Now you're ready to work with Html re-writes.

An example configuration along with proxy pass is:


ServerName externaldns.com
ProxyRequests Off
ProxyPreserveHost Off

Order deny,allow
Allow from all

ProxyPass /uk http://internal-server:8080/UK/
ProxyPass /us http://internal-server:8080/NA/
ProxyHTMLURLMap http://internal-server:8080/UK
ProxyHTMLURLMap http://internal-server:8080/NA

ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /uk
ProxyHTMLURLMap /uk /uk
RequestHeader unset Accept-Encoding



ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /na
ProxyHTMLURLMap /na /na
RequestHeader unset Accept-Encoding



Friday, March 11, 2005

ORB error: Script executes from shell while throws error executing from Cron

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
org.openorb.io.LocalInputStream.read_boolean(Unknown Source)
org.omg.CosNaming.NamingContextHelper.narrow

1.This is necessary for the Marshalling and building the Objects for the ORB to un-Marshall on the other end.
2.This is available when executing as a normall shell script from command-line but when executing from cron, the cron uses root permissions and settings so these settings as necessitated by Omni-ORB need to be set by us. Otherwise if we run the script using cron it will fail.
LC_MONETARY=en_GB.ISO8859-15
LC_TIME=en_GB.ISO8859-15
LC_MESSAGES=C
LC_CTYPE=en_GB.ISO8859-15
LC_COLLATE=en_GB.ISO8859-15
LC_NUMERIC=en_GB.ISO8859-15

These settings are building blocks for the Object building and communication.

Monday, March 07, 2005

Error Building with Ant in WSAD - Modern compiler not found - looking for classic compiler

Errors:
1.Modern compiler not found - looking for classic compiler
2.[javac] BUILD FAILED: Error starting modern compiler
3.target JDK should be comprised in between '1.1' and '1.4': javac1.4

Hi,
These errors pop up when I use Ant within WSAD 5.1 I was trying to compile my source code for complying to JAVA 1.4 When I use WSAD build/rebuild project it works. Then I figured Ant was using the 1.3 compiler inside eclipse plugin. So I set the compiler attribute to pick up the 1.4 compiler. Still I had similar errors [3rd error]. I think ant script behaves wierd inside of eclipse/wsad. The basic problem is :
Ant starts with whatever JRE/JDK WSAD starts up with.
After exhausting myself with all kinds of solutions pointed over the web :
1. Add tools.jar of java1.4 to ant library path
2. set JAVA_HOME to jdk1.4
etc.,
The solution I found courtesy Google and some blogging is to start WSAD with the specified java virtual machine[jvm] :
"C:\Program Files\IBM\WebSphere Studio\Application Developer\v5.1.1\wsappdev.exe" -vm "C:\j2sdk1.4.2\bin\java.exe"