Quercus: Drupal

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Nam (Talk); changed back to last version by Emil)
Line 21: Line 21:
 
The <[[rewrite-dispatch]]> lets you use clean URLs, so your paths will look like http://windansea.caucho.com/forum instead of http://windansea.caucho.com/index.php?q=forum
 
The <[[rewrite-dispatch]]> lets you use clean URLs, so your paths will look like http://windansea.caucho.com/forum instead of http://windansea.caucho.com/index.php?q=forum
  
 +
<pre>
 
  <web-app xmlns="http://caucho.com/ns/resin">
 
  <web-app xmlns="http://caucho.com/ns/resin">
 
   <database jndi-name="jdbc/drupal">
 
   <database jndi-name="jdbc/drupal">
Line 44: Line 45:
 
   </rewrite-dispatch>
 
   </rewrite-dispatch>
 
  </web-app>
 
  </web-app>
 +
</pre>
 +
 +
== clean URLs ==
 +
 +
You may need to modify the settings.php to force clean URLs
 +
 +
  $conf['clean_url'] = 1;

Revision as of 02:39, 2 May 2008


Drupal, a forum/blog content management system, now works on Quercus (requires the latest snapshot or 3.0.18). The Caucho Forum is now running using Drupal.

installation

Drupal requires JavaMail to send user confirmation and passwords. You will need to download JavaMail from the Sun site and install it in resin/lib for Drupal to work. This example also uses MySQL as Drupal's database. In order to connect to MySQL through Java, you will need to download MySQL Connector/J and install the jar file in resin/lib.

To install Drupal, just expand the Drupal .tar file into webapps/drupal (or webapps/ROOT). From there, follow the Drupal documentation. Essentially, you'll just need to:

  • modify drupal/sites/default/settings.php (to set the expected URL)
  • create the database with 'mysql drupal < drupal/database/database.mysql'
  • Add a drupal/WEB-INF/resin-web.xml to configure Quercus and modify the URLs

resin-web.xml configuration file

The resin-web.xml file is placed in webapps/drupal/WEB-INF/resin-web.xml.

Configuring the <database> is optional, but allows you complete control over the database connections Drupal uses. If you do not configure the <database>, Quercus will create a new database pool automatically.

The <rewrite-dispatch> lets you use clean URLs, so your paths will look like http://windansea.caucho.com/forum instead of http://windansea.caucho.com/index.php?q=forum

 <web-app xmlns="http://caucho.com/ns/resin">
   <database jndi-name="jdbc/drupal">
     <driver type="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
       <url>jdbc:mysql://localhost:3306/drupal</url>
       <user>root</user>
       <password></password>
     </driver>
   </database>
 
   <servlet servlet-name="php"
            servlet-class="com.caucho.quercus.servlet.QuercusServlet">
     <init database="jdbc/drupal"/>
   </servlet>
 
    <servlet-mapping url-pattern="*.php" servlet-name="php"/>

   <welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
 
   <rewrite-dispatch>
     <dispatch regexp="\.(php|gif|css|jpg|png|ico|js)"/>
     <forward regexp="^/" target="/index.php?q="/>
   </rewrite-dispatch>
 </web-app>

clean URLs

You may need to modify the settings.php to force clean URLs

 $conf['clean_url'] = 1;
Personal tools