Quercus: WordPress on Resin 3.1

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(removed support question)
(Rewrite to modern versions)
Line 1: Line 1:
 
[[Category: Quercus]]
 
[[Category: Quercus]]
  
Running Wordpress 2.2.1 on Resin 3.1.2
+
=Running Wordpress 2.5.1 on Resin 3.1.6=
--------------------------------------
+
Wordpress 2.2 will run on Resin without modification.  However, Wordpress 2.2.1 will require a fix to wp-includes/formatting.php.  The Wordpress function js_escape() was changed in 2.2.1 to use conditional constructs in regular expressions.  Java does not support conditional constructs.  The workaround is to revert the change to that function detailed here:
+
  
http://trac.wordpress.org/changeset/5736
+
==Requirements==
 +
# MySQL server
 +
# Java 1.5 or higher
  
 +
==Quick start==
 +
Follow these instructions if you would simply like to evaluate running WordPress without doing a system-wide installation.  Follow the instructions below to perform a system-wide installation.
  
Running Wordpress 2.0.3 on Resin
+
# Download WordPress 2.5.1 from http://www.wordpress.org/download
--------------------------------
+
# Download Resin 3.1.6 from http://www.caucho.com/download
Created: July 9, 2006
+
# Unzip Resin 3.1.6
Tested on: Mac OS X 10.4.7 on an Intel Mac, July 9, 2006)
+
# Unzip WordPress and copy all files and directories to resin-3.1.6/webapps/ROOT
Author: Tony Field
+
# Create the WordPress database: <pre>mysql -u root</pre><pre>mysql> CREATE DATABASE wordpress;</pre>
+
# Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)  
You can't install WordPress 2.0.3 on Resin 3.0.19 and configure it "just like that" -  
+
# Unzip MySQL Connector/J and place the mysql-connector-java-5.1.6-bin.jar in resin-3.1.6/webapps/ROOT/WEB-INF/lib
there were apparently some problems with Quercus that have since been fixed:  the
+
# Run <pre>java -jar resin-3.1.6/lib/resin.jar</pre>
install script fails part-way through. However, you can indeed run WordPress on
+
# Browse to http://localhost:8080 and set up WordPress according to the online directions
Resin 3.0.19 after you get it running using a more recent snapshotHere are the instructions.
+
 
+
==Full installation==
1. Download WordPress 2.0.3 <http://www.wordpress.org/download/>
+
Follow these instructions if you would like to perform a permanent installation with virtual hostsFollow the above directions for a quick start evaluation.
+
 
2. Download & install/configure a snapshot of Resin 3, July 5 or later (I haven't tried earlier snapshots)
+
# Download WordPress 2.5.1 from http://www.wordpress.org/download
+
# Download Resin 3.1.6 from http://www.caucho.com/download
3. Extract the WordPress zip file and put it into your webapps folder.
+
# Unzip Resin 3.1.6 in /usr/local/share
+
# Copy /usr/local/share/resin-3.1.6/conf/resin.conf to /etc/resin/resin.conf
4. Create your database, datasource, and add the driver to <resin_home>/lib/local
+
# Edit /etc/resin/resin.conf to change the host-deploy directory:<pre><host-deploy path="/var/www/hosts"></pre>
+
# Create a virtual host directory for your domain:<pre>/var/www/hosts/blog.example.com/webapps/ROOT</pre> (in this example, the domain is blog.example.com)
5. Tell Quercus about this php app:  Create a WEB-INF folder and put this content inside a web.xml file:
+
# Unzip WordPress and copy all files and directories to /var/www/hosts/blog.example.com/webapps/ROOT
+
# Create the WordPress database: <pre>mysql -u root</pre><pre>mysql> CREATE DATABASE wordpress;</pre>
<web-app xmlns="http://caucho.com/ns/resin">
+
# Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)
<servlet-mapping url-pattern="*.php" servlet-class="com.caucho.quercus.servlet.QuercusServlet">
+
# Unzip MySQL Connector/J and place the mysql-connector-java-5.1.6-bin.jar in /var/www/hosts/blog.example.com/webapps/ROOT/WEB-INF/lib
<init>
+
# Run <pre>java -jar /usr/local/share/resin-3.1.6/lib/resin.jar -conf /etc/resin/resin.conf start</pre>
<compile>
+
# Browse to http://blog.example.com:8080 and set up WordPress according to the online directions
false
+
</compile>
+
<database>
+
jdbc/<your-dsn>
+
</database>
+
<php-ini SMTP="smtp.your-isp.ca" sendmail_from="your@email.address.ca"/>
+
</init>
+
</servlet-mapping>
+
</web-app>
+
+
6. Fix WordPress problems - 2 current issues:
+
+
Fix, the first:
+
+
Remove the trailing '-' on line 101 of /webapps/wordpress/wp-includes/functions-formatting.php :
+
/webapps/wordpress/wp-includes/functions-formatting.php:102:
+
-$text is an invalid left-hand side of an assignment. in
+
functions-formatting.php:101: $text = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/','&#038;$1', $text);-
+
+
Fix, the second:
+
+
Open the file /webapps/wordpress/wp-includes/class-snoopy.php
+
and re-save it as UTF-8 if it is not already in UTF-8.  (Required for Mac OS X, as the file opens
+
as "Western (Mac OS Roman)" by default).
+
+
7. Start the Resin snapshot and run the installation wizard
+
<http://localhost:8080/wordpress/wp-admin/install.php>. 
+
You'll see numerous exceptions where WordPress is looking for a table that doesn't exist.  These will
+
continue throughout the wizard then stop forever once you're all set up.
+
+
8. Shut down the Resin snapshot and move your webapp to resin-3.0.19
+
+
9. Start resin-3.0.19 and visit your blog:  <http://localhost:8080/wordpress/>
+

Revision as of 15:22, 19 June 2008


Contents

Running Wordpress 2.5.1 on Resin 3.1.6

Requirements

  1. MySQL server
  2. Java 1.5 or higher

Quick start

Follow these instructions if you would simply like to evaluate running WordPress without doing a system-wide installation. Follow the instructions below to perform a system-wide installation.

  1. Download WordPress 2.5.1 from http://www.wordpress.org/download
  2. Download Resin 3.1.6 from http://www.caucho.com/download
  3. Unzip Resin 3.1.6
  4. Unzip WordPress and copy all files and directories to resin-3.1.6/webapps/ROOT
  5. Create the WordPress database:
    mysql -u root
    mysql> CREATE DATABASE wordpress;
  6. Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)
  7. Unzip MySQL Connector/J and place the mysql-connector-java-5.1.6-bin.jar in resin-3.1.6/webapps/ROOT/WEB-INF/lib
  8. Run
    java -jar resin-3.1.6/lib/resin.jar
  9. Browse to http://localhost:8080 and set up WordPress according to the online directions

Full installation

Follow these instructions if you would like to perform a permanent installation with virtual hosts. Follow the above directions for a quick start evaluation.

  1. Download WordPress 2.5.1 from http://www.wordpress.org/download
  2. Download Resin 3.1.6 from http://www.caucho.com/download
  3. Unzip Resin 3.1.6 in /usr/local/share
  4. Copy /usr/local/share/resin-3.1.6/conf/resin.conf to /etc/resin/resin.conf
  5. Edit /etc/resin/resin.conf to change the host-deploy directory:
    <host-deploy path="/var/www/hosts">
  6. Create a virtual host directory for your domain:
    /var/www/hosts/blog.example.com/webapps/ROOT
    (in this example, the domain is blog.example.com)
  7. Unzip WordPress and copy all files and directories to /var/www/hosts/blog.example.com/webapps/ROOT
  8. Create the WordPress database:
    mysql -u root
    mysql> CREATE DATABASE wordpress;
  9. Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)
  10. Unzip MySQL Connector/J and place the mysql-connector-java-5.1.6-bin.jar in /var/www/hosts/blog.example.com/webapps/ROOT/WEB-INF/lib
  11. Run
    java -jar /usr/local/share/resin-3.1.6/lib/resin.jar -conf /etc/resin/resin.conf start
  12. Browse to http://blog.example.com:8080 and set up WordPress according to the online directions
Personal tools