<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Weiqi Gao&#039;s Observations - apache tag</title>
  <link>http://www.weiqigao.com/blog/tags/apache/</link>
  <description>Sharing My Experience...</description>
  <language>en</language>
  <copyright>Weiqi Gao</copyright>
  <lastBuildDate>Fri, 11 May 2012 12:48:36 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>Weiqi Gao&#039;s Observations</title>
    <link>http://www.weiqigao.com/blog/</link>
  </image>
  
  
  <item>
    <title>Tomcat 6.0.18, Apache 2.2.9, proxy_ajp on Ubuntu 8.10: Almost Trivial...</title>
    <link>http://www.weiqigao.com/blog/2008/12/23/tomcat_6_0_18_apache_2_2_9_proxy_ajp_on_ubuntu_8_10_almost_trivial.html</link>
    
      
        <description>
          &lt;p&gt;... after four hours of documentation re-reading.&lt;/p&gt;

&lt;p&gt;[&lt;b&gt;Update&lt;/b&gt; Tue Dec 23 15:30:20 CST 2008]  The above line was written two days ago when I moved this blog away from a dying PC.  Regular readers might have noticed outages of this blog for stretches of several hours at a time and during the evening hours.  The whole machine would lock up while the disk light is a solid on, presumably trying to read something off the disk.&lt;/p&gt;

&lt;p&gt;This is the second time a PC has died at home.  If you remember, &lt;a href= &#034;http://www.weiqigao.com/blog/2008/11/30/ubuntu_8_10_pure_frustration.html&#034; &gt;gao-2002 went out of commission&lt;/a&gt; only 23 days ago.  And now gao-2006 is gone.  You&#039;ve seen gao-2006 mentioned &lt;a href= &#034;http://www.weiqigao.com/blog/2005/12/12/ubuntu_5_10_first_impression.html&#034; &gt;here&lt;/a&gt;, &lt;a href= &#034;http://www.weiqigao.com/blog/2006/12/12/getting_files_around_secure_copy_scp.html&#034; &gt;here&lt;/a&gt;, &lt;a href= &#034;http://www.weiqigao.com/blog/2005/12/18/printers_that_just_worked_and_other_stories.html&#034; &gt;here&lt;/a&gt;, and &lt;a href= &#034;http://www.weiqigao.com/blog/2008/08/07/upgraded_weblog_software_to_pebble_2_3_1.html&#034; &gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Luckily, I was able to save all the data from the dying PC before it finally would get a kernel panic during the boot up process.  I felt that I was this close to writing a different blog entry that begins: &#034;I&#039;m an idiot and I lost all data in this blog...&#034;&lt;/p&gt;

&lt;hr align=&#034;center&#034; width=&#034;60%&#034; size=&#034;1&#034; noshade=&#034;noshade&#034;&gt;

&lt;p style=&#034;font-size: large; color: red&#034;&gt;Are your data backed up?  Now would be a good time to implement your backup strategy.&lt;/p&gt;

&lt;hr align=&#034;center&#034; width=&#034;60%&#034; size=&#034;1&#034; noshade=&#034;noshade&#034;&gt;

&lt;p&gt;With the backed up data, I was able to setup this blog on gao-2009 within four hours, most of it spent on one task.  Here&#039;s entire process on this Ubuntu 8.10 machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install sun-java6-jdk from Synaptic Package Manager&lt;/li&gt;
&lt;li&gt;Install apache2 from Synaptic Package Manager&lt;/li&gt;
&lt;li&gt;Install tomcat6 from Synaptic Package Manager&lt;/li&gt;
&lt;li&gt;Deploy my blog at &lt;tt&gt;/var/lib/tomcat6/webapp/blog&lt;/tt&gt;&lt;/li&gt;
&lt;li&gt;Connecting apache2 to tomcat6&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first four steps are trivial.  I did the first three prior to the move.  Step 4 took minutes.  Step 5 is also trivial, but I didn&#039;t know it when I started.  What tripped me up is Google.  Most of the search results leads to outdated information.  And I spent a number of hours following the wrong leads, most of them about &lt;a href= &#034;http://www.weiqigao.com/blog/2004/06/04/backups_rebuilds_upgrades.html&#034; &gt;mod_jk, which I custom compiled&lt;/a&gt; in the early days of this blog.&lt;/p&gt;

&lt;p&gt;It finally downed on me that perhaps I should read the documentations.  And what a good idea what was.  All I need to know is in the documentations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href= &#034;http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html&#034; &gt;Apache Module mod_proxy_ajp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href= &#034;http://tomcat.apache.org/tomcat-6.0-doc/connectors.html&#034; &gt;Apache Tomcat 6.0
Connectors How To&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The gist of the documentation can be distilled to three sentences: Apache 2.2.9 includes mod_proxy_ajp support.  Tomcat 6.0.18 is configured with an AJP connector by default.  All I need to do is to enable mod_proxy_ajp and then tell it where my webapp is.&lt;/p&gt;

&lt;p&gt;To enable mod_proxy_ajp I used the command:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;[root@gao-2009] # &lt;b&gt;a2enmod mod_proxy_ajp&lt;/b&gt;&lt;/pre&gt;

&lt;p&gt;To tell Apache 2.2.9 where my webapp is I added &lt;tt&gt;/etc/apache2/conf.d/proxy_ajp&lt;/tt&gt; with the following content:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;ProxyPass /blog ajp://localhost:8009/blog
ProxyPassReverse /blog ajp://localhost:8009/blog

&amp;lt;Proxy /blog&gt;
  Order deny,allow
  Allow from all
&amp;lt;/Proxy&gt;&lt;/pre&gt;

&lt;p&gt;It turns out I also need to edit &lt;tt&gt;/etc/apache2/mods-enabled/proxy.conf&lt;/tt&gt; to change a line that says &lt;tt style=&#034;font-weight:bold&#034;&gt;Deny from all&lt;/tt&gt; into &lt;tt style=&#034;font-weight:bold&#034;&gt;Allow from all&lt;/tt&gt;.  Without this change, noone can access the blog and I get error message that reads:&lt;/p&gt;

&lt;pre style=&#034;margin-left:3em&#034;&gt;... client denied by server configuration: proxy:ajp://localhost:8009/...&lt;/pre&gt;

&lt;p&gt;That&#039;s all there is to it.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2008/12/23/tomcat_6_0_18_apache_2_2_9_proxy_ajp_on_ubuntu_8_10_almost_trivial.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2008/12/23/tomcat_6_0_18_apache_2_2_9_proxy_ajp_on_ubuntu_8_10_almost_trivial.html</guid>
    <pubDate>Wed, 24 Dec 2008 02:15:11 GMT</pubDate>
  </item>
  
  <item>
    <title>Thursday Ant Quiz</title>
    <link>http://www.weiqigao.com/blog/2008/03/13/thursday_ant_quiz.html</link>
    
      
        <description>
          &lt;p&gt;I&#039;m tearing my hairs out, so I think you should do the same.  I&#039;ll make you, as a matter of fact, by way of a Thursday Ant quiz:&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The Set Up&lt;/b&gt;: There are two files in the current directory: &lt;tt&gt;Foo.java&lt;/tt&gt; and &lt;tt&gt;Foo.class&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Q&lt;/b&gt;: Write an Apache Ant 1.7.0 compatible &lt;tt&gt;build.xml&lt;/tt&gt; file in the directory, which, when invoked with the &lt;tt&gt;&lt;b&gt;ant&lt;/b&gt;&lt;/tt&gt;, removes &lt;tt&gt;Foo.class&lt;/tt&gt; but not &lt;tt&gt;Foo.java&lt;/tt&gt;.  You cannot use the word &#034;&lt;tt&gt;Foo&lt;/tt&gt;&#034; in the build file.&lt;/p&gt;

&lt;p&gt;No Googling, no peeking into the online Ant manual or any Ant books.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2008/03/13/thursday_ant_quiz.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2008/03/13/thursday_ant_quiz.html</guid>
    <pubDate>Thu, 13 Mar 2008 18:27:36 GMT</pubDate>
  </item>
  
  <item>
    <title>Google Flavored Java?</title>
    <link>http://www.weiqigao.com/blog/2007/11/13/google_flavored_java.html</link>
    
      
        <description>
          &lt;p&gt;&lt;em&gt;(Via &lt;a href= &#034;http://tirania.org/blog/archive/2007/Nov-13-1.html&#034; &gt;Miguel de Icaza&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;a href= &#034;http://www.betaversion.org/~stefano/linotype/news/110/&#034; &gt;Stefano Mazzocchi&lt;/a&gt;: Today Google released the Android code and I took a serious look at its internals... and found the solution for the licensing problem. It&#039;s called Dalvik and it&#039;s the new name of Sun&#039;s worst nightmares.&lt;/p&gt;

&lt;p&gt;&lt;a href= &#034;http://code.google.com/android/what-is-android.html&#034; &gt;Dalvik is a virtual machine&lt;/a&gt;, just like Java&#039;s or .NET&#039;s.. but it&#039;s Google&#039;s own and they&#039;re making it open source without having to ask permission to anyone (well, for now, in the future expect a shit-load of IP-related lawsuits on this, especially since Sun and Microsoft signed a cross-IP licensing agreement on exactly such virtual machines technologies years ago... but don&#039;t forget IBM who has been writing emulation code for mainframes since the beginning of time).&lt;/p&gt;

&lt;p&gt;But Android&#039;s programs are written in Java, using Java-oriented IDEs (it also comes with an Eclipse plugin)... it just doesn&#039;t compile the java code into java bytecode but (ops, Sun didn&#039;t see this one coming) into Dalvik bytecode.&lt;/p&gt;

&lt;p&gt;So, Android uses the &lt;strong&gt;syntax&lt;/strong&gt; of the Java platform (the Java &#034;language&#034;, if you wish, which is enough to make java programmers feel at home and IDEs to support the editing smoothly) and the java SE class library but not the Java bytecode or the Java virtual machine to execute it on the phone (and, note, Android&#039;s implementation of the Java SE class library is, indeed, &lt;span style=&#034;color:red&#034;&gt;Apache Harmony&lt;/span&gt;&#039;s!)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I haven&#039;t looked inside Android, but I trust Stefano&#039;s description.  And I believe we are seeing fruits of &lt;a href= &#034;http://www.weiqigao.com/blog/2007/04/12/java_the_third_fork_from_sun.html&#034; &gt;The Third Fork From Sun&lt;/a&gt; that I outlines 215 days ago.&lt;/p&gt;

&lt;p&gt;[&lt;b&gt;Update&lt;/b&gt;]:  Wow.  This thing (the emulator) works!&lt;/p&gt;

&lt;center&gt;
&lt;img src=&#034;http://www.weiqigao.com/blog/images/android.png&#034; title=&#034;Android Phone&#034; width=&#034;251&#034; height=&#034;420&#034; /&gt;
&lt;/center&gt;

&lt;p&gt;And it advertises itself as &#034;&lt;tt&gt;Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3&lt;/tt&gt;&#034;&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2007/11/13/google_flavored_java.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2007/11/13/google_flavored_java.html</guid>
    <pubDate>Tue, 13 Nov 2007 18:57:01 GMT</pubDate>
  </item>
  
  </channel>
</rss>

