Quercus: WordPress on Resin 3.1

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
m (delete index.jsp)
(unicode database)
Line 38: Line 38:
 
# Run <pre>java -jar /usr/local/share/resin-3.1.6/lib/resin.jar -conf /etc/resin/resin.conf start</pre>
 
# Run <pre>java -jar /usr/local/share/resin-3.1.6/lib/resin.jar -conf /etc/resin/resin.conf start</pre>
 
# Browse to http://blog.example.com:8080 and set up WordPress according to the online directions
 
# Browse to http://blog.example.com:8080 and set up WordPress according to the online directions
 +
 +
==Notes==
 +
If you see strange characters in posts or characters, you may need to tell the database driver to use unicode.  Add the following resin-web.xml file to the WEB-INF directory in the webapp where you installed WordPress:
 +
<pre>
 +
<?xml version="1.0"?>
 +
<web-app xmlns="http://caucho.com/ns/resin">
 +
  <database jndi-name="jdbc/blog">
 +
    <driver type="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
 +
      <url>jdbc:mysql://localhost:3306/blog</url>
 +
      <user>root</user>
 +
      <password></password>
 +
      <useUnicode>true</useUnicode>
 +
    </driver>
 +
  </database>
 +
 +
  <servlet servlet-name="php"
 +
          servlet-class="com.caucho.quercus.servlet.QuercusServlet">
 +
    <init database="jdbc/blog"/>
 +
  </servlet>
 +
 +
  <servlet-mapping url-pattern="*.php" servlet-name="php"/>
 +
 +
</web-app>
 +
</pre>
 +
You may need to change the values of the <url>, <user>, or <password> tags to reflect your database name, user, or password depending on your database.

Revision as of 15:43, 2 July 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. Delete resin-3.1.6/webapps/ROOT/index.jsp
  5. Unzip WordPress and copy all files and directories to resin-3.1.6/webapps/ROOT
  6. Create the WordPress database:
    mysql -u root
    mysql> CREATE DATABASE wordpress;
  7. Create the directory resin-3.1.6/webapps/ROOT/WEB-INF/lib
  8. Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)
  9. 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
  10. Run
    java -jar resin-3.1.6/lib/resin.jar
  11. 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. Create the directory /var/www/hosts/blog.example.com/webapps/ROOT/WEB-INF/lib
  10. Download MySQL Connector/J 5.1.6 (http://dev.mysql.com/downloads/connector/j/5.1.html)
  11. 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
  12. Run
    java -jar /usr/local/share/resin-3.1.6/lib/resin.jar -conf /etc/resin/resin.conf start
  13. Browse to http://blog.example.com:8080 and set up WordPress according to the online directions

Notes

If you see strange characters in posts or characters, you may need to tell the database driver to use unicode. Add the following resin-web.xml file to the WEB-INF directory in the webapp where you installed WordPress:

<?xml version="1.0"?>
<web-app xmlns="http://caucho.com/ns/resin">
  <database jndi-name="jdbc/blog">
    <driver type="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
      <url>jdbc:mysql://localhost:3306/blog</url>
      <user>root</user>
      <password></password>
      <useUnicode>true</useUnicode>
    </driver>
  </database>

  <servlet servlet-name="php"
           servlet-class="com.caucho.quercus.servlet.QuercusServlet">
    <init database="jdbc/blog"/>
  </servlet>

  <servlet-mapping url-pattern="*.php" servlet-name="php"/>

</web-app>

You may need to change the values of the <url>, <user>, or <password> tags to reflect your database name, user, or password depending on your database.

Personal tools