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 1: Line 1:
 
[[Category:Quercus]]
 
[[Category:Quercus]]
  
==Download Resin 3.1.1+==
+
[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.
The newest Resin versions have several bug fixes for Drupal.
+
  
==Download Drupal==
+
== installation ==
Download [http://drupal.org/download Drupal] into $resin_home/webapps/ROOT/drupal.
+
  
==Download MySQL JDBC Driver==
+
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 [http://www.mysql.com/products/connector/j/ MySQL Connector/J JDBC Driver] into $resin_home/lib.  Any version is fine.
+
  
==Add resin-web.xml==
+
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 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.
+
  
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.
+
* 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
  
  <b><web-app xmlns="http://caucho.com/ns/resin"></b>
+
== resin-web.xml configuration file ==
   <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></user>
+
       <user>root</user>
 
       <password></password>
 
       <password></password>
 
     </driver>
 
     </driver>
 
   </database>
 
   </database>
 
   
 
   
   <b><servlet-mapping url-pattern="*.php"
+
   <servlet servlet-name="php"
                    servlet-class="com.caucho.quercus.servlet.QuercusServlet">
+
            servlet-class="com.caucho.quercus.servlet.QuercusServlet">
     <init></b>
+
     <init database="jdbc/drupal"/>
      <database>jdbc/drupal</database>
+
   </servlet>
      <compile>true</compile>
+
      <b><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></b>
+
 
   
 
   
  <b><welcome-file-list>index.php</welcome-file-list>
+
    <servlet-mapping url-pattern="*.php" servlet-name="php"/>
</web-app></b>
+
  
==Finish==
+
  <welcome-file-list><welcome-file>index.php</welcome-file></welcome-file-list>
Run Drupal's installation. That's it!
+
 +
  <rewrite-dispatch>
 +
    <dispatch regexp="\.(php|gif|css|jpg|png|ico|js)"/>
 +
    <forward regexp="^/" target="/index.php?q="/>
 +
  </rewrite-dispatch>
 +
  </web-app>

Revision as of 22:06, 14 February 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>
Personal tools