<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.christianyates.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Quercus</title>
 <link>http://www.christianyates.com/category/subject/quercus</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>Drupal on Glassfish with clean urls using Url Rewrite Filter</title>
 <link>http://www.christianyates.com/blog/glassfish/drupal-glassfish-clean-urls-using-url-rewrite-filter</link>
 <description>&lt;p&gt;You have a &lt;a href=&quot;http://glassfish.dev.java.net&quot;&gt;Glassfish&lt;/a&gt; server.&lt;/p&gt;
&lt;p&gt;You are a &lt;a href=&quot;https://drupal.org&quot;&gt;Drupal&lt;/a&gt; developer.&lt;/p&gt;
&lt;p&gt;You want to run Drupal in Glassfish. More importantly, you want to have it use &lt;a href=&quot;http://drupal.org/node/15365&quot;&gt;clean urls&lt;/a&gt; because without that capability, all of your urls look like this: &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;index.&lt;span style=&quot;color: #660066;&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;?&lt;/span&gt;foo&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;bar&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;baz&lt;/code&gt;&lt;/span&gt;. Which sucks, of course.&lt;/p&gt;
&lt;p&gt;Let&#039;s set aside for the moment the desirability of running PHP in a Java application container for the moment&lt;sup&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, and jump right to the meat of this geeky post. Here&#039;s how I got some of the clean url functionality you&#039;d normally get from Apache&#039;s mod_rewrite, or using either mod_rewrite or Lua in lighttpd.&lt;/p&gt;
&lt;p&gt;I&#039;m assuming you&#039;ve already got Glassfish installed, so from there:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get a copy of &lt;a href=&quot;http://quercus.caucho.com/&quot;&gt;Quercus&lt;/a&gt;, &lt;a href=&quot;http://www.caucho.com/&quot;&gt;Caucho&#039;s&lt;/a&gt; Java implementation of PHP 5. I downloaded the version &lt;a href=&quot;http://quercus.caucho.com/download/quercus-3.2.1.war&quot;&gt;3.2.1&lt;/a&gt; .war file.&lt;/li&gt;
&lt;li&gt;Unzip the .war:&lt;sup&gt;&lt;a href=&quot;#2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;jar &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;xvf quercus&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;3.2.1.&lt;span style=&quot;color: #660066;&quot;&gt;war&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;
&lt;li&gt;Get a copy of &lt;a href=&quot;http://tuckey.org/urlrewrite/#download&quot;&gt;Url Rewrite Filter&lt;/a&gt;. I used version 3.2.0 (beta), but 2.6 should work also.&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; cd quercus&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;3.2.1
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; wget http&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//urlrewritefilter.googlecode.com/files/urlrewritefilter-3.2.0-src.zip&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; unzip urlrewritefilter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;3.2.0&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;src.&lt;span style=&quot;color: #660066;&quot;&gt;zip&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Get Drupal. I used &lt;a href=&quot;http://drupal.org/drupal-6.10&quot;&gt;the latest 6.x version&lt;/a&gt;.:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; cd ..&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; wget http&lt;span style=&quot;color: #339933;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;//ftp.drupal.org/files/projects/drupal-6.10.tar.gz&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; tar zxvf drupal&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;6.10.&lt;span style=&quot;color: #660066;&quot;&gt;tar&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;gz&lt;/span&gt;
&amp;nbsp;
Copy Drupal files to the quercus docroot
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; cp &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;r drupal&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #CC0000;&quot;&gt;6.10&lt;/span&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;/* quercus-3.2.1/&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
Configure Url Rewrite Filter. This is where it gets a little sketchy. Drupal comes prepackaged with a &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;htaccess&lt;/span&gt;&lt;/code&gt;&lt;/span&gt; file, which sets up the mod_rewrite rules for Apache:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;# Rewrite current&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;style URLs of the form &lt;span style=&quot;color: #3366CC;&quot;&gt;&#039;index.php?q=x&#039;&lt;/span&gt;.
&lt;span style=&quot;color: #660066;&quot;&gt;RewriteCond&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_FILENAME&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!-&lt;/span&gt;f
RewriteCond &lt;span style=&quot;color: #339933;&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;REQUEST_FILENAME&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!-&lt;/span&gt;d
RewriteRule &lt;span style=&quot;color: #339933;&quot;&gt;^&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;$ index.&lt;span style=&quot;color: #660066;&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;?&lt;/span&gt;q&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt;L&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;QSA&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;em&gt;Unfortunately&lt;/em&gt;, Url Rewrite Filter doesn&#039;t support the REQUEST_FILENAME directive (&lt;a href=&quot;http://code.google.com/p/urlrewritefilter/wiki/ProposedFeatures&quot;&gt;yet&lt;/a&gt;). So I&#039;ve put in some hacks to at least get clean urls working. I don&#039;t pretend that this is production-ready, but it gets it working for basic testing. If anyone has input, I&#039;d welcome it. Anyway, in the WEB-INF/web.xml file, the following directives need to be added:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;name&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;UrlRewriteFilter&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;name&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;class&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;org.&lt;span style=&quot;color: #660066;&quot;&gt;tuckey&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;web&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;filters&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;urlrewrite&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;UrlRewriteFilter&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;class&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;mapping&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;name&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;UrlRewriteFilter&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;filter&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;name&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;url&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;pattern&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/filter-mapping&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
This should go before the &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;servlet&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;servlet&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt; section.&lt;/p&gt;
&lt;p&gt;Next, create &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;WEB&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;INF&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;urlrewrite.&lt;span style=&quot;color: #660066;&quot;&gt;xml&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;?&lt;/span&gt;xml version&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; encoding&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;!&lt;/span&gt;DOCTYPE urlrewrite
&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;PUBLIC&lt;/span&gt; &lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;-//tuckey.org//DTD UrlRewrite 2.6//EN&amp;quot;&lt;/span&gt;
&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;http://tuckey.org/res/dtds/urlrewrite2.6.dtd&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;urlrewrite&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
      Prevent rewriting of specific files. &lt;span style=&quot;color: #660066;&quot;&gt;Definitely&lt;/span&gt; not
      the best way to &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;do&lt;/span&gt; &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;.
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;^/&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;css|js|png|jpg|gif&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;$&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;/&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
      Prevent rewriting of files &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;in&lt;/span&gt; the files directory
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;^/&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;files&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;$&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;/&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;files&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;Do&lt;/span&gt; the Drupaly stuff
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;note&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;^/&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;.&lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;$&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;from&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;/&lt;/span&gt;index.&lt;span style=&quot;color: #660066;&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;?&lt;/span&gt;q&lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt;$&lt;span style=&quot;color: #CC0000;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;to&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;rule&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;/&lt;/span&gt;urlrewrite&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Re-zip your directory back into a .war file to deploy onto the app server:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt;jar &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;cvf quercus&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;3.2.1.&lt;span style=&quot;color: #660066;&quot;&gt;war&lt;/span&gt; quercus&lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;3.2.1&lt;span style=&quot;color: #006600; font-style: italic;&quot;&gt;/*&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Deploy to Glassfish through the admin console, or from the auto-deploy directory. Note that you should set your context-root to / to run Drupal at the root of the app server.
&lt;/li&gt;
&lt;li&gt;Oh yeah, you&#039;ll probably want to connect to a database too, right? In the admin panel, go to Resources &gt; JDBC &gt; Connection Pools and create a new Connection Pool. Let&#039;s call it &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;mysqlpool&lt;/code&gt;&lt;/span&gt;.
&lt;p&gt;Set Datasource Classname to &lt;span class=&quot;geshifilter&quot;&gt;&lt;code class=&quot;geshifilter-javascript&quot;&gt;com.&lt;span style=&quot;color: #660066;&quot;&gt;mysql&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;jdbc&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;jdbc2&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;optional&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;MysqlConnectionPoolDataSource&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Plug in the following Additional Parameters for your Drupal DB:&lt;br /&gt;
&lt;div class=&quot;geshifilter&quot;&gt;&lt;pre class=&quot;javascript geshifilter-javascript&quot; style=&quot;font-family:monospace;&quot;&gt;password
user
databaseName
portNumber
serverName&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That &lt;em&gt;should&lt;/em&gt; be about it.&lt;/p&gt;
&lt;div style=&quot;font-size:0.8em;&quot;&gt;
&lt;a name=&quot;1&quot;&gt;&lt;sup&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/sup&gt;&lt;/a&gt;: There are a couple of reasons I think this is interesting. First, Caucho claims that Quercus should run PHP apps as least as fast as Apache + &lt;a href=&quot;http://php.net/apc&quot;&gt;APC&lt;/a&gt;, and I&#039;ve seen numbers of 24-56% faster for the &lt;a href=&quot;http://www.jroller.com/ferg/entry/quercus_benchmarking&quot;&gt;same complex app&lt;/a&gt;. Second, you can use Java functions natively from within PHP. Working in an environment with a lot of Java code, that&#039;s potentially appealing, especially for complex scientific functions I don&#039;t really want to re-implement in PHP. Third, the ability to deploy a .war file containing the whole Drupal docroot is also interesting.&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;2&quot;&gt;&lt;sup&gt;&lt;strong&gt;2&lt;/strong&gt;&lt;/sup&gt;&lt;/a&gt;: I expect that most Drupal developers aren&#039;t using IDEs like Eclipse or NetBeans, so I&#039;m just using command-line tools here.&lt;/div&gt;
</description>
 <comments>http://www.christianyates.com/blog/glassfish/drupal-glassfish-clean-urls-using-url-rewrite-filter#comments</comments>
 <category domain="http://www.christianyates.com/taxonomy/term/33">Drupal</category>
 <category domain="http://www.christianyates.com/category/subject/glassfish">Glassfish</category>
 <category domain="http://www.christianyates.com/category/subject/java">Java</category>
 <category domain="http://www.christianyates.com/taxonomy/term/3">Mmm... Geeky</category>
 <category domain="http://www.christianyates.com/category/subject/quercus">Quercus</category>
 <category domain="http://www.christianyates.com/category/subject/urlrewritefilter">UrlRewriteFilter</category>
 <wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.christianyates.com/crss/node/652</wfw:commentRss>
 <pubDate>Tue, 17 Mar 2009 23:16:35 -0400</pubDate>
 <dc:creator>chris</dc:creator>
 <guid isPermaLink="false">652 at http://www.christianyates.com</guid>
</item>
</channel>
</rss>
