<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Devon Hillard&#039;s Digital Sanctuary &#187; proxy</title>
	<atom:link href="http://www.digitalsanctuary.com/tech-blog/tag/proxy/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalsanctuary.com/tech-blog</link>
	<description>Java, ATG, Seam, and related Technologies</description>
	<lastBuildDate>Mon, 30 Jan 2012 23:04:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting the Real IP Address from a Proxied Request in ATG</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/atg/getting-the-real-ip-address-from-a-proxied-request-in-atg.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/atg/getting-the-real-ip-address-from-a-proxied-request-in-atg.html#comments</comments>
		<pubDate>Wed, 09 Apr 2008 00:32:41 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[ATG]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/?p=89</guid>
		<description><![CDATA[Many things can obscure the real IP address of the end user when they visit your site: a load balancer in front of your ATG cluster, Akamai, the user&#8217;s ISP or office network, and more. This makes correlating logging events, &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/atg/getting-the-real-ip-address-from-a-proxied-request-in-atg.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Many things can obscure the real IP address of the end user when they visit your site: a load balancer in front of your ATG cluster, Akamai, the user&#8217;s ISP or office network, and more.  This makes correlating logging events, or using the ATG session IP validation security option, and more, very difficult.  In light of that challange I&#8217;ve added a new mini-module to my <a href="http://www.digitalsanctuary.com/atg-dynamo-technologies.html" target="_new">Open Source ATG Modules</a> called the ProxyIPFixer.  It uses a simple ATG pipeline Servlet to examine the X-FORWARDED-FOR request header, and if it finds one, parse through the IP addresses to find the originating IP address of the user, and puts that value into the ATG Request object&#8217;s remoteAddr property.</p>
<p>This allows downstream pipeline servlets, code, and pages to see the real user&#8217;s IP address.  </p>
<p>The caveat is that the header can be faked, and that some ISPs/companies, such as AOL, do not set the true end point of the user, and you can only see back to their outgoing proxy server.  In AOL&#8217;s case in particular, they can also route subsequent requests by the same AOL user through different AOL proxy points, which will make it appear that someone is hijacking a session (if you&#8217;re using the ATG session security mechanism).  So be aware of the limitations.  However it can be very useful.</p>
<p>For those who don&#8217;t want to download the whole module package, I have attached the Java source and the ATG properties file to this post.</p>
<p>Enjoy!  (and as always feel free to contact me with questions, issues, improvements, etc&#8230;)</p>
<p><a href='http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2008/04/proxyipfixerservlet.java' target="_new">ProxyIPFixerServlet Java Source</a></p>
<p><a href='http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2008/04/proxyipfixer.properties' target="_new">ProxyIPFixer ATG Properties File</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/atg/getting-the-real-ip-address-from-a-proxied-request-in-atg.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apache Proxy Breaks RichFaces</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/apache-proxy-breaks-richfaces.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/apache-proxy-breaks-richfaces.html#comments</comments>
		<pubDate>Mon, 24 Mar 2008 07:24:19 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Seam]]></category>
		<category><![CDATA[a4j]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[richfaces]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/apache-proxy-breaks-richfaces.html</guid>
		<description><![CDATA[I&#8217;ve run into this twice now, so I wanted to document it here to help other folks, and to see if anyone knows the root cause of the issue. When using RichFaces with Seam, things work just fine on my &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/apache-proxy-breaks-richfaces.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve run into this twice now, so I wanted to document it here to help other folks, and to see if anyone knows the root cause of the issue.</p>
<p>When using RichFaces with Seam, things work just fine on my local development JBoss instance.  But when I deploy the same EAR file up to my production JBoss instance, which is sitting behind an Apache proxy, everything works EXCEPT the rich/ajax stuff.  </p>
<p>The issue was that the JavaScript located here: ContextRoot/a4j_3_1_4.GAorg.ajax4jsf.javascript.AjaxScript</p>
<p>would not load.</p>
<p>My Apache proxy was configured like this:</p>
<pre>
	ProxyPass /10MinuteMail balancer://mycluster/10MinuteMail/
	ProxyPass /10MinuteMail/* balancer://mycluster/10MinuteMail/
	ProxyPassReverse /10MinuteMail http://127.0.0.1:8080/10MinuteMail
</pre>
<p>With mycluster defined like this:</p>
<pre>
        <Proxy balancer://mycluster>
                AddDefaultCharset off
                Order deny,allow
                Allow from all

		BalancerMember http://127.0.0.1:8080
                #Allow from .example.com
        </Proxy>
</pre>
<p>Again, this configuration worked fine for everything EXCEPT that RichFaces JavaScript.</p>
<p>Since I am only using one node for 10MinuteMail, there is no real need for a load balancer configuration, so I replaced the configuration with this:</p>
<pre>
	ProxyPass /10MinuteMail http://127.0.0.1:8080/10MinuteMail
	ProxyPass /10MinuteMail/ http://127.0.0.1:8080/10MinuteMail/
        ProxyPassReverse /10MinuteMail/ http://127.0.0.1:8080/10MinuteMail/
</pre>
<p>Which works, and fixed the RichFaces reference.</p>
<p>So there&#8217;s your solution.  However I have no idea what the actual root cause is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/apache-proxy-breaks-richfaces.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Apache Proxy &amp; Making Things Look Nice</title>
		<link>http://www.digitalsanctuary.com/tech-blog/general/apache-proxy-making-things-look-nice.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/general/apache-proxy-making-things-look-nice.html#comments</comments>
		<pubDate>Fri, 19 Oct 2007 04:27:50 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/general/apache-proxy-making-things-look-nice.html</guid>
		<description><![CDATA[I recently setup a dev/build server with Jira, Confluence, Hudson, ATG (with two web apps and the atg admin), Oracle (with web admin), and Postgres (with web admin). I&#8217;m running everything independantly, and everything is listening on it&#8217;s own high &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/general/apache-proxy-making-things-look-nice.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently setup a dev/build server with <a href="http://www.atlassian.com/software/jira/" title="Jira" target="_blank">Jira</a>, <a href="http://www.atlassian.com/software/confluence/" title="Confluence" target="_blank">Confluence</a>, <a href="https://hudson.dev.java.net/" title="Hudson" target="_blank">Hudson</a>, <a href="http://www.atg.com/" title="ATG" target="_blank">ATG</a> (with two web apps and the atg admin), <a href="http://www.oracle.com/index.html" title="Oracle" target="_blank">Oracle</a> (with web admin), and <a href="http://www.postgresql.org/" title="Postgres" target="_blank">Postgres</a> (with <a href="http://phppgadmin.sourceforge.net/" title="phppgadmin" target="_blank">web admin</a>).  I&#8217;m running everything independantly, and everything is listening on it&#8217;s own high number port.  This makes the URLs ugly, and finding what you want tricky.</p>
<p>I used Apache 2.2 and mod_proxy_http to wrap all of the services in the Apache running on port 80.</p>
<p>Any Apache 2.2 installation should come with mod_proxy and mod_proxy_http.  You may need to activate them with something like this:<br />
<code>LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so<br />
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so</code></p>
<p>then set a basic configuration for security:<br />
<code>ProxyRequests Off<br />
ProxyPreserveHost On</p>
<p>&lt;Proxy *&gt;<br />
    Order deny,allow<br />
    Allow from all<br />
&lt;/Proxy&gt;</code></p>
<p>It&#8217;s best to ensure all the applications you are trying to wrap are listening at context roots, not the base URL/port.  So you want hudson on :9000/hudson/ or whatever your setup has (for instance: java -jar hudson.war &#8211;httpPost=9000 &#8211;prefix=/hudson ).  Same for Jira and everything else.</p>
<p>Then setup your proxy mappings in your apache configs.</p>
<p><code>ProxyPass           /jira       http://localhost:8080/jira<br />
ProxyPassReverse    /jira       http://localhost:8080/jira<br />
&lt;Location /jira&gt;<br />
    Order allow,deny<br />
    Allow from all<br />
&lt;/Location&gt;</code></p>
<p>Repeat for all of your applications.  Then just restart apache to pickup all the changes:</p>
<p><code>apachectl restart</code></p>
<p>So now we have Jira at host/jira, Confluence at host/confluence, Hudson at host/hudson, and so on.  Pretty, easy to book mark, easy to cross link.  It just looks more professional.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/general/apache-proxy-making-things-look-nice.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/17 queries in 0.003 seconds using disk: basic
Object Caching 383/411 objects using disk: basic

Served from: www.digitalsanctuary.com @ 2012-02-06 23:55:19 -->
