在Apache Tomcat上安装Wordpress 2.3
作者:lizongbo 发表于:9:10 上午. 星期一, 10月 22nd, 2007版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明。
http://618119.com/archives/2007/10/22/11.html
在Apache Tomcat上安装Wordpress 2.3
借助quercus这个纯Java PHP引擎,我们可以在Tomcat上安装Wordpress.
1.首先下载
JDK: jdk-6u3-windows-i586-p.exe http://www.mnidc.net/software/java_se/jdk-6u3-windows-i586-p.exe
mysql 5.0.45: http://ftp.ntu.edu.tw/pub/--escaped_anchor:eb0ea675fbb8e7d924e684d322873a93--/Downloads/MySQL-5.0/mysql-noinstall-5.0.45-win32.zip
Tomcat 6.0.14: http://www.apache.org/dist/--escaped_anchor:079305423cce36d6691457475e081123--/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.zip
quercus 3.1.3: http://quercus.caucho.com/download/quercus-3.1.3.war
Wordpress 2.3: http://wordpress.org/latest.zip
Wordpress 2.3 简体中文语言包 第二版: http://wpcn.googlecode.com/files/--escaped_anchor:514bf1cb49cdb8c6451b5e8c6d9d8e64---2-3-zh_CN-po-mo.zip
mysql jdbc: http://ftp.ntu.edu.tw/pub/--escaped_anchor:eb0ea675fbb8e7d924e684d322873a93--/Downloads/Connector-J/mysql-connector-java-5.1.0.zip
javamail
2.安装:
运行jdk-6u3-windows-i586-p.exe安装 JDK 到D:\Java\jdk1.6.0_03
配置环境变量JAVA_HOME=D:\Java\jdk1.6.0_03
环境变量Path中加入D:\Java\jdk1.6.0_03\bin;
解压mysql-noinstall-5.0.45-win32.zip为:E:\mysql-5.0.45-win32
解压pache-tomcat-6.0.14.zip到为:D:\Java\apache-tomcat-6.0.14
解压quercus-3.1.3.war为:D:\Java\apache-tomcat-6.0.14\webapps\quercus
解压latest.zip为D:\Java\apache-tomcat-6.0.14\webapps\quercus\wordpress
解压wordpress-2-3-zh_CN-po-mo.zip到 D:\Java\apache-tomcat-6.0.14\webapps\quercus\wordpress\wp-content\language
解压mysql-connector-java-5.1.0.zip得到mysql-connector-java-5.1.0.jar,将其复制到D:\Java\apache-tomcat-6.0.14\webapps\quercus\WEB-INF\lib
将activation.jar和mail.jar复制到D:\Java\apache-tomcat-6.0.14\webapps\quercus\WEB-INF\lib。
4.配置:
将 D:\Java\apache-tomcat-6.0.14\webapps\quercus\wordpress\下的wp-config-sample.php重命名为wp-config.php
编辑后的wp-config.php的内容如下:
<?php
// ** MySQL settings ** //
define(’DB_NAME’, ‘wordpress’); // The name of the database
define(’DB_USER’, ‘root’); // Your MySQL username
define(’DB_PASSWORD’, ”); // …and password
define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
define(’DB_CHARSET’, ‘utf8′);
define(’DB_COLLATE’, ”);
// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = ‘wp_’; // Only numbers, letters, and underscores please!
// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to ‘de’
// to enable German language support.
define (’WPLANG’, ‘zh_CN’);
/* That’s all, stop editing! Happy blogging. */
define(’ABSPATH’, dirname(__FILE__).’/');
require_once(ABSPATH.’wp-settings.php’);
?>
5.启动:
运行E:\mysql-5.0.45-win32\bin\mysqld.exe
运行D:\Java\apache-tomcat-6.0.14\bin\startup.bat
6.安装设置Wordpress
打开浏览器,访问 http://localhost:8080/quercus/wordpress/wp-admin/install.php
进行安装。
(Tomcat后台此时会报很多异常,这是因为wordpress在检测相关的表是否已经创建)
7.访问
http://localhost:8080/quercus/wordpress/ 可以看到内容显示正常。
8.尚存在的问题:
a.我配置了中文语言包,却没能配置成功,不知道是quercus的问题还是我配置的不对。
b.quercus对php中所写的正则表达式支持的还不够,所以导致没法发文章。
参考 http://bugs.caucho.com/view.--escaped_anchor:09f011909a439f4a34f2e56cd58ebd9f--?id=1329 (该bug被关闭了,但是在quercus 3.1.3里还是有)
我把 wp-includes/formatting.php中的 第1126行
$safe_text = preg_replace(’/(x)?0*(?(1)27|39);?/i’, “‘”, stripslashes($safe_text));
改为:$safe_text = preg_replace(’\r\n’, “‘”, stripslashes($safe_text));
(修改保存好formatting.php之后重新刷新页面,发现并未即时生效,)
然后重起Tomcat,然后可以正常打开http://localhost:8080/quercus/wordpress/wp-admin/post-new.php了。
然后可以正常发文章。
提交了bug: http://bugs.caucho.com/view.--escaped_anchor:09f011909a439f4a34f2e56cd58ebd9f--?id=2089
c.在激活插件的时候,页面重定向会出错。但是插件会被激活。
http://localhost:8080/quercus/wordpress/wp-admin/plugins.php?action=activate&plugin=hello.php&_wpnonce=6c0cd42523
提交了bug: http://bugs.caucho.com/view.--escaped_anchor:09f011909a439f4a34f2e56cd58ebd9f--?id=2090
Tags: mysql, php, quercus, Tomcat, WordpressRelated posts
Tags: mysql, php, quercus, Tomcat, Wordpress