Quercus: Drupal

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(Noted the need for Connector/J)
Line 1: Line 1:
 
[[Category:Quercus]]
 
[[Category:Quercus]]
  
[http://drupal.org Drupal], a forum/blog content management system, now works on Quercus (requires the latest snapshot or 3.0.18).  The [http://forum.caucho.com Caucho Forum] is now running using Drupal.
+
[http://drupal.org Drupal 4.7.5], a forum/blog content management system, now works on Quercus (requires the latest snapshot or 3.1.1).  The [http://forum.caucho.com Caucho Forum] is now running using Drupal.
  
 
== installation ==
 
== installation ==
Line 32: Line 32:
 
   <servlet servlet-name="php"
 
   <servlet servlet-name="php"
 
             servlet-class="com.caucho.quercus.servlet.QuercusServlet">
 
             servlet-class="com.caucho.quercus.servlet.QuercusServlet">
     <init database="jdbc/drupal"/>
+
     <init>
 +
      <database>jdbc/drupal</database>
 +
      <script-encoding>iso-8859-1</script-encoding>
 +
      <php-ini>
 +
        <sendmail_from>my_email_address</sendmail_from>
 +
        <smtp_username>my_email_username</smtp_username>
 +
        <smtp_password>my_email_password</smtp_password>
 +
      </php-ini>
 +
    </init>
 
   </servlet>
 
   </servlet>
 
   
 
   
    <servlet-mapping url-pattern="*.php" servlet-name="php"/>
+
  <servlet-mapping url-pattern="*.php" servlet-name="php"/>
 
+
 
   <welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
 
   <welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
 
   
 
   

Revision as of 05:16, 15 January 2007


Drupal 4.7.5, a forum/blog content management system, now works on Quercus (requires the latest snapshot or 3.1.1). 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</database>
      <script-encoding>iso-8859-1</script-encoding>
      <php-ini>
        <sendmail_from>my_email_address</sendmail_from>
        <smtp_username>my_email_username</smtp_username>
        <smtp_password>my_email_password</smtp_password>
      </php-ini>
    </init>
  </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>
Personal tools