Quercus: Drupal

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Quercus]]
 
[[Category:Quercus]]
  
[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.
+
==Download Resin 3.1.1+==
 +
The newest Resin versions have several bug fixes for Drupal.
  
== installation ==
+
==Download Drupal==
 +
Download [http://drupal.org/download Drupal] into $resin_home/webapps/ROOT/drupal.
  
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.
+
==Download MySQL JDBC Driver==
 +
Download [http://www.mysql.com/products/connector/j/ MySQL Connector/J JDBC Driver] into $resin_home/lib.  Any version is fine.
  
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:
+
==Add resin-web.xml==
 +
Add the following resin-web.xml file to $resin_home/webapps/ROOT/drupal/WEB-INFCustomize email settings to allow the sending of emails from PHP.  Anything not in <b>bold</b> is optional.
  
* modify drupal/sites/default/settings.php (to set the expected URL)
+
The resin-web.xml needs to have the QuercusServlet mapped to *.php.  Optionally, it can have a <[[database]]> as PHP's database. Quercus can automatically create database pools if you omit the <[[database]]> configuration, but it's better to configure it explicitly.
* 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 ==
+
  <b><web-app xmlns="http://caucho.com/ns/resin"></b>
 
+
   <database jndi-name='jdbc/drupal'>
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">
 
     <driver type="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
 
       <url>jdbc:mysql://localhost:3306/drupal</url>
 
       <url>jdbc:mysql://localhost:3306/drupal</url>
       <user>root</user>
+
       <user></user>
 
       <password></password>
 
       <password></password>
 
     </driver>
 
     </driver>
 
   </database>
 
   </database>
 
   
 
   
   <servlet servlet-name="php"
+
   <b><servlet-mapping url-pattern="*.php"
            servlet-class="com.caucho.quercus.servlet.QuercusServlet">
+
                    servlet-class="com.caucho.quercus.servlet.QuercusServlet">
     <init>
+
     <init></b>
 
       <database>jdbc/drupal</database>
 
       <database>jdbc/drupal</database>
       <script-encoding>iso-8859-1</script-encoding>
+
       <compile>true</compile>
       <php-ini>
+
       <b><php-ini>
 
         <sendmail_from>my_email_address</sendmail_from>
 
         <sendmail_from>my_email_address</sendmail_from>
 
         <smtp_username>my_email_username</smtp_username>
 
         <smtp_username>my_email_username</smtp_username>
Line 41: Line 35:
 
       </php-ini>
 
       </php-ini>
 
     </init>
 
     </init>
   </servlet>
+
   </servlet-mapping></b>
 
   
 
   
   <servlet-mapping url-pattern="*.php" servlet-name="php"/>
+
   <b><welcome-file-list>index.php</welcome-file-list>
  <welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
+
  </web-app></b>
   
+
 
  <rewrite-dispatch>
+
==Finish==
    <dispatch regexp="\.(php|gif|css|jpg|png|ico|js)"/>
+
Run Drupal's installation. That's it!
    <forward regexp="^/" target="/index.php?q="/>
+
 
  </rewrite-dispatch>
+
==Known Issues==
</web-app>
+
1. Rapid queries made by the user from the search module may cause subsequent database search queries from the same user to fail.

Revision as of 21:10, 15 February 2007


Contents

Download Resin 3.1.1+

The newest Resin versions have several bug fixes for Drupal.

Download Drupal

Download Drupal into $resin_home/webapps/ROOT/drupal.

Download MySQL JDBC Driver

Download MySQL Connector/J JDBC Driver into $resin_home/lib. Any version is fine.

Add resin-web.xml

Add the following resin-web.xml file to $resin_home/webapps/ROOT/drupal/WEB-INF. Customize email settings to allow the sending of emails from PHP. Anything not in bold is optional.

The resin-web.xml needs to have the QuercusServlet mapped to *.php. Optionally, it can have a <database> as PHP's database. Quercus can automatically create database pools if you omit the <database> configuration, but it's better to configure it explicitly.

<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></user>
      <password></password>
    </driver>
  </database>

  <servlet-mapping url-pattern="*.php"
                   servlet-class="com.caucho.quercus.servlet.QuercusServlet">
    <init>
      <database>jdbc/drupal</database>
      <compile>true</compile>
      <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-mapping>

  <welcome-file-list>index.php</welcome-file-list>
</web-app>

Finish

Run Drupal's installation. That's it!

Known Issues

1. Rapid queries made by the user from the search module may cause subsequent database search queries from the same user to fail.

Personal tools