<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>rave8151's Feed - Programmer's Heaven</title>
    <link>http://www.programmersheaven.com/feed/User/323734/RSS.aspx</link>
    <description>Events at Programmer's Heaven related to the user rave8151.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Fri, 24 May 2013 21:29:15 -0700</pubDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <item>
      <title>Re: Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy</title>
      <link>http://www.programmersheaven.com/mb/Apache/373413/373432/ReadMessage.aspx#373432</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/Apache/373413/373432/ReadMessage.aspx#373432"&gt;Re: Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/Apache/Board.aspx"&gt;Apache&lt;/a&gt; forum.&lt;/p&gt;For anyone experiencing similar problems, here are the VirtualHost settings that I used to fix my problems, provided by 'richardk' of &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;VirtualHost 1.2.3.4:80&amp;gt;
   ServerName domain1.com
   ServerAlias www.domain1.com
   ServerAdmin webmaster@domain1.com

   ErrorLog  /usr/var/log/vhosts/www.domain1.com-error_log
   CustomLog /usr/var/log/vhosts/www.domain1.com-access_log combined

   RewriteEngine On

   RewriteRule ^/$ /cmsapp/homepage.html [PT,L]
   RewriteRule ^/([a-z0-9_-]{1,30})$ /cmsapp/$1.do.html [NC,R=301,L]

   ProxyRequests Off

   ProxyPass        / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt; #Tomcat Server
   ProxyPassReverse / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
: Hi all, I have a problem that I can't seem to find info on anywhere! &lt;br /&gt;
: &lt;br /&gt;
: &lt;strong&gt;CURRENT SETUP:&lt;/strong&gt;&lt;br /&gt;
: I'm running Apache 1.3 on Server_1 which directs all requests with &lt;br /&gt;
: JkMount to Server_2 which runs a home grown CMS application &lt;br /&gt;
: &lt;br /&gt;
: ('cmsapp') and a related application ('app1') on tomcat 5.&lt;br /&gt;
: &lt;br /&gt;
: The CMS application services 20+ domains, and the Apache server uses &lt;br /&gt;
: VirtualHosts for each of them. e.g:&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;&amp;lt;VirtualHost 1.2.3.4:80&amp;gt;
: 	ServerAdmin webmaster@domain1.com
: 	DocumentRoot /usr/local/www/data/vhosts
: 	ServerName domain1.com
: 	ServerAlias www.domain1.com
: 	
: 	ErrorLog /usr/var/log/vhosts/www.domain1.com-error_log
: 	CustomLog /usr/var/log/vhosts/www.domain1.com-access_log combined
: 	
:         JkMount /cmsapp/* worker1
: 	JkMount /app1/* worker1
: 
: 	&amp;lt;Directory "/usr/local/www/data/vhosts"&amp;gt;
: 		RewriteEngine On
: 		RewriteBase /	
: 		RewriteRule ^$ /cmsapp/homepage.html [L]
: 		RewriteRule ^([a-zA-Z0-9_-]{1,30})$ /cmsapp/$1.do.html [R]
: 	&amp;lt;/Directory&amp;gt;
: &amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: The RewriteRules (as I understand them) allow us to direct to a &lt;br /&gt;
: different default starting page for each domain name, as &lt;br /&gt;
: &lt;br /&gt;
: specified in the VirtualHost settings.&lt;br /&gt;
: &lt;br /&gt;
: This all works fine and there have been no real problems with this &lt;br /&gt;
: setup for over 2 years.&lt;br /&gt;
: &lt;br /&gt;
: &lt;strong&gt;PROBLEM:&lt;/strong&gt;&lt;br /&gt;
: &lt;br /&gt;
: An increase in the number of domains being managed by the CMS and &lt;br /&gt;
: the rise in traffic means our little tomcat server can't handle &lt;br /&gt;
: &lt;br /&gt;
: it fast enough! I really want to upgrade to Apache 2.2 and get rid &lt;br /&gt;
: of the JkMount setup and implement a reverse proxy so I can &lt;br /&gt;
: &lt;br /&gt;
: set up a cache for the Tomcat applications. This, I think, will &lt;br /&gt;
: alleviate the problems.&lt;br /&gt;
: &lt;br /&gt;
: But try as I might I can't get the setup to work! Maybe my &lt;br /&gt;
: VirtualHost settings are wrong for Apache2.2, maybe I don't know &lt;br /&gt;
: &lt;br /&gt;
: enough about Regex, but I think the problem is my lack of experience &lt;br /&gt;
: with mod_rewrite and mod_proxy.&lt;br /&gt;
: &lt;br /&gt;
: Below are the best settings I have found so far for the domain shown &lt;br /&gt;
: above. This resolves requests for specific pages and &lt;br /&gt;
: &lt;br /&gt;
: displays them properly, but the rewrite rules (which work for Apache &lt;br /&gt;
: 1.3) don't get executed. So instead of rewriting the request &lt;br /&gt;
: &lt;br /&gt;
: for 'http://www.domain1.com' to the default homepage for that &lt;br /&gt;
: domain, it just goes to the Tomcat default homepage, &lt;br /&gt;
: &lt;br /&gt;
: "$CATALINA_HOME/webapps/ROOT/index.jsp":&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;&amp;lt;VirtualHost 1.2.3.4:80&amp;gt;
: 	ServerAdmin webmaster@domain1.com
: 	DocumentRoot /usr/local/www/data/vhosts
: 	ServerName domain1.com
: 	ServerAlias www.domain1.com
: 
:         ErrorLog /usr/var/log/vhosts/www.domain1.com-error_log
: 	CustomLog /usr/var/log/vhosts/www.domain1.com-access_log combined
: 
:         ProxyRequests Off
: 
:         ProxyPass / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt;          #Tomcat Server
:         ProxyPassReverse / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt;   
: 
:         &amp;lt;Directory "/usr/local/www/data/vhosts"&amp;gt;
:                 RewriteEngine On
:                 RewriteBase /
:                 RewriteRule ^$ /cmsapp/homepage.html [L]
: 		RewriteRule ^([a-zA-Z0-9_-]{1,30})$ /cmsapp/$1.do.html[R]
:         &amp;lt;/Directory&amp;gt;
: &amp;lt;/VirtualHost&amp;gt;
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: I think the issue is something to do with the module order, but I &lt;br /&gt;
: can't figure out a solution. I read somewhere that one can &lt;br /&gt;
: &lt;br /&gt;
: leave out the 'ProxyPass' directive and just use 'RewriteRule' to &lt;br /&gt;
: send requests through a compiled-in mod_proxy. I tried setting &lt;br /&gt;
: &lt;br /&gt;
: that up but then I couldn't access any pages at all, with every &lt;br /&gt;
: request returning an HTTP 403 error message.&lt;br /&gt;
: &lt;br /&gt;
: Does anyone know how I can get the old RewriteRule directives to &lt;br /&gt;
: work and fix this problem?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Apache/373413/373432/ReadMessage.aspx#373432</guid>
      <pubDate>Wed, 16 Jul 2008 09:16:54 -0700</pubDate>
    </item>
    <item>
      <title>Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy + Rewrite</title>
      <link>http://www.programmersheaven.com/mb/Apache/373413/373413/ReadMessage.aspx#373413</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/Apache/373413/373413/ReadMessage.aspx#373413"&gt;Can't figure out Apache VirtualHosts + Tomcat + ReverseProxy + Rewrite&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/Apache/Board.aspx"&gt;Apache&lt;/a&gt; forum.&lt;/p&gt;Hi all, I have a problem that I can't seem to find info on anywhere! &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;CURRENT SETUP:&lt;/strong&gt;&lt;br /&gt;
I'm running Apache 1.3 on Server_1 which directs all requests with JkMount to Server_2 which runs a home grown CMS application &lt;br /&gt;
&lt;br /&gt;
('cmsapp') and a related application ('app1') on tomcat 5.&lt;br /&gt;
&lt;br /&gt;
The CMS application services 20+ domains, and the Apache server uses VirtualHosts for each of them. e.g:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;VirtualHost 1.2.3.4:80&amp;gt;
	ServerAdmin webmaster@domain1.com
	DocumentRoot /usr/local/www/data/vhosts
	ServerName domain1.com
	ServerAlias www.domain1.com
	
	ErrorLog /usr/var/log/vhosts/www.domain1.com-error_log
	CustomLog /usr/var/log/vhosts/www.domain1.com-access_log combined
	
        JkMount /cmsapp/* worker1
	JkMount /app1/* worker1

	&amp;lt;Directory "/usr/local/www/data/vhosts"&amp;gt;
		RewriteEngine On
		RewriteBase /	
		RewriteRule ^$ /cmsapp/homepage.html [L]
		RewriteRule ^([a-zA-Z0-9_-]{1,30})$ /cmsapp/$1.do.html [R]
	&amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The RewriteRules (as I understand them) allow us to direct to a different default starting page for each domain name, as &lt;br /&gt;
&lt;br /&gt;
specified in the VirtualHost settings.&lt;br /&gt;
&lt;br /&gt;
This all works fine and there have been no real problems with this setup for over 2 years.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;PROBLEM:&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
An increase in the number of domains being managed by the CMS and the rise in traffic means our little tomcat server can't handle &lt;br /&gt;
&lt;br /&gt;
it fast enough! I really want to upgrade to Apache 2.2 and get rid of the JkMount setup and implement a reverse proxy so I can &lt;br /&gt;
&lt;br /&gt;
set up a cache for the Tomcat applications. This, I think, will alleviate the problems.&lt;br /&gt;
&lt;br /&gt;
But try as I might I can't get the setup to work! Maybe my VirtualHost settings are wrong for Apache2.2, maybe I don't know &lt;br /&gt;
&lt;br /&gt;
enough about Regex, but I think the problem is my lack of experience with mod_rewrite and mod_proxy.&lt;br /&gt;
&lt;br /&gt;
Below are the best settings I have found so far for the domain shown above. This resolves requests for specific pages and &lt;br /&gt;
&lt;br /&gt;
displays them properly, but the rewrite rules (which work for Apache 1.3) don't get executed. So instead of rewriting the request &lt;br /&gt;
&lt;br /&gt;
for 'http://www.domain1.com' to the default homepage for that domain, it just goes to the Tomcat default homepage, &lt;br /&gt;
&lt;br /&gt;
"$CATALINA_HOME/webapps/ROOT/index.jsp":&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;&amp;lt;VirtualHost 1.2.3.4:80&amp;gt;
	ServerAdmin webmaster@domain1.com
	DocumentRoot /usr/local/www/data/vhosts
	ServerName domain1.com
	ServerAlias www.domain1.com

        ErrorLog /usr/var/log/vhosts/www.domain1.com-error_log
	CustomLog /usr/var/log/vhosts/www.domain1.com-access_log combined

        ProxyRequests Off

        ProxyPass / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt;          #Tomcat Server
        ProxyPassReverse / &lt;a href="http://1.2.3.111:8180/"&gt;http://1.2.3.111:8180/&lt;/a&gt;   

        &amp;lt;Directory "/usr/local/www/data/vhosts"&amp;gt;
                RewriteEngine On
                RewriteBase /
                RewriteRule ^$ /cmsapp/homepage.html [L]
		RewriteRule ^([a-zA-Z0-9_-]{1,30})$ /cmsapp/$1.do.html[R]
        &amp;lt;/Directory&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I think the issue is something to do with the module order, but I can't figure out a solution. I read somewhere that one can &lt;br /&gt;
&lt;br /&gt;
leave out the 'ProxyPass' directive and just use 'RewriteRule' to send requests through a compiled-in mod_proxy. I tried setting &lt;br /&gt;
&lt;br /&gt;
that up but then I couldn't access any pages at all, with every request returning an HTTP 403 error message.&lt;br /&gt;
&lt;br /&gt;
Does anyone know how I can get the old RewriteRule directives to work and fix this problem?</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Apache/373413/373413/ReadMessage.aspx#373413</guid>
      <pubDate>Tue, 15 Jul 2008 12:28:11 -0700</pubDate>
    </item>
  </channel>
</rss>