开源webbloger Roller安装手记

近几天比较的空,心里有点空空的,无意中看到Roller这个开源博客软件,比较有兴趣,想搭建起来试用一下,本来以为根据Installation Guide很容易就可以搭建起来,可事实还是花了一翻工夫。现在把它写下来,希望能给想搭建这个软件的同仁一个参考。

好了,费话少说,在开始介绍以前先说一下我的机器环境:

windows2000 ad Server+jdk1.4.2+DB2 8.2+tomcat5.0.28

1.                  首先,到www.rollerwebbloger.org根据提示在相应的网站下载roller 2.0稳定版(最好还下载源代码,实在不明白的时候可以看看相关内容的源代码:))

2.                  设置系统变量JAVA_HOME=c:/j2sdk142为你的JDK安装目录,然后安装tomcat,并设置系统变量CATALINA_HOME=d:/tomcat5,因为我是这安装在d:/tomcat5这个目录,这个要根据自己安装的位置进设置。

3.                  解压roller的下载包到CATALINA_HOME/WEBAPPS下,其实你可以解压出来将roller这个目录整个拷贝到CATALINA_HOME/WEBAPPS也可以。

4.                  建立roller所需要的数据库,数据表。因为我用的是DB2,所以在CLP建立数据库rollerdb,然后从CATALINA_HOME/webapps/roller/WEB-INF/dbcripts/db2下执行createdb.sql脚本建立所需数据表(这一步每个数据库的情况都不一样,所以根据具体的数据库进行设置,roller默认的数据库是mysql

5.                  JDBC驱动包拷贝到CATALINA_HOME/common/lib下,我的是db2java.zipdb2jcc.jar;同时根据安装指南,将mail.jaractivation.jar移动到CATALINA_HOME/common/lib下。

6.                  将从安装指南下载的roller_tomcat_5_0.xml进行修改后放到CATALINA_HOME/conf/Catalina/localhost目录下。并改名为roller.xml,下面是我的文件内容

<!--

     Example roller context configuration file for Tomcat 5.0.X and MySQL 4.1.X

     Place this file at CATALINA_HOME/conf/Catalina/localhost/roller.xml and replace

     the following values:

     DBNAME - The name of your Roller database (the name you used with 'create database')

     DBUSERNAME - A MySQL user with full access to that database

     DBPASSWORD - The password for that user

     This file assumes you are deploying Roller to the URI "/roller" and have put it under

     "roller" in your normal Tomcat appbase (typically "webapps").  If not, see the

     instructions for setting up Roller to run under a different URI.

-->

<Context path="/roller" docBase="roller" debug="99" workDir="work/Catalina/localhost/roller">

    

<Realm className="org.apache.catalina.realm.JDBCRealm"     

    driverName="COM.ibm.db2.app.DB2Driver"

    connectionURL="jdbc:db2:ROLLERDB"

    connectionName="db2admin"

    connectionPassword="12345678"

    userTable="rolleruser"

    userNameCol="username"

    userCredCol="passphrase"

    userRoleTable="userrole"

    roleNameCol="rolename" debug="99" />

 

 

<Resource name="jdbc/rollerdb" auth="Container" type="javax.sql.DataSource" />

 

 

<ResourceParams name="jdbc/rollerdb">

    <parameter>

       <name>factory</name>

       <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>

    </parameter>

    <parameter>

       <name>driverClassName</name>

       <value>COM.ibm.db2.app.DB2Driver</value>

    </parameter>

    <parameter>

      <name>url</name>

      <value>jdbc:db2:ROLLERDB

      </value>

    </parameter>

    <parameter><name>username</name><value>db2admin</value></parameter>

    <parameter><name>password</name><value>12345678</value></parameter>

    <parameter><name>maxActive</name><value>50</value></parameter>

    <parameter><name>maxIdle</name><value>5</value></parameter>

    <parameter><name>removeAbandoned</name><value>true</value></parameter>

    <parameter><name>maxWait</name><value>3000</value></parameter>

</ResourceParams>

 

 

<!--

To enable email notification of comments: uncomment the resouce below,

set your mailhost, and make sure you have mail.jar and activation.jar

in <tomcat>/common/lib.

-->

<!--

    <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>

    <ResourceParams name="mail/Session">

        <parameter>

            <name>mail.smtp.host</name>

            <value>mailhost.example.com</value>

        </parameter>

    </ResourceParams>

-->

 

 

</Context>

7.                  设置tomcat服务器支持UTF-8

    <Connector

port="8080"               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"

               enableLookups="false" redirectPort="8443" acceptCount="100"

               debug="0" connectionTimeout="20000" URIEncoding="UTF-8"

               disableUploadTimeout="true" />

8.                  配置rollerhibernate.cfg.xml.(roller/web-inf/classes)系统默认的mysql,这里需要改成自己所用数据库的配置。我的配置如下:(如果不配置这一步,在访问http://localhost:8080/roller的时候会出现null|main menu|登录,请在此困惑的朋友注意,这个问题在roller mail list里有解答,看来有时候安装指南也不可靠)

  <property name="show_sql">false</property>

        <property name="connection.datasource">java:comp/env/jdbc/rollerdb</property>

         <property name="dialect">org.hibernate.dialect.DB2Dialect</property>

9.                  启动tomcat。访问http://localhost:8080/roller,现在注册新用户出来了,第一个注册的用户自动是管理员,这个时候你就可以进行配置和管理了。

10.               安装完成,这里我只是采用了默认的安装方式,没有进行配置,有兴趣的朋友可以自己研究。

 

 

小结:总的来说安装还是比较简单的,关键是hibernate.cfg.xml这个一步没有在安装说明里有介绍,所以造成一些朋友安装起来以后不可以使用,比较难理解,我刚开始也是一样,后来我到roller mail list里浏览一下,找到了解答,看来开源的东东还得多看看相关的资料才行。

阅读更多

roller安装出现的问题

08-21

我按照网上以及roller的帮助文档搭建roller,rn可是总是出现现在错误!rn请教各位达人,这个错误是怎么回事?怎么解决?rnrnrnINFO 2006-08-21 19:16:28,765 RollerConfig: - successfully loaded default properties.rnINFO 2006-08-21 19:16:28,781 RollerConfig: - no custom properties file found in classpathrnINFO 2006-08-21 19:16:28,781 RollerConfig: - no custom properties file specified via jvm optionrnERROR 2006-08-21 19:16:28,812 RollerFactory:setRoller - Error instantiating org.apache.roller.business.hibernate.HibernateRollerImplrnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.roller.model.RollerFactory.setRoller(RollerFactory.java:103)rn at org.apache.roller.model.RollerFactory.getRoller(RollerFactory.java:72)rn at org.apache.roller.presentation.RollerContext.contextDestroyed(RollerContext.java:123)rn at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3733)rn at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4306)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4155)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)rn at org.apache.catalina.core.StandardService.start(StandardService.java:450)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:536)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rnCaused by: org.apache.roller.RollerExceptionrn at org.apache.roller.business.hibernate.HibernateRollerImpl.(HibernateRollerImpl.java:73)rn at org.apache.roller.business.hibernate.HibernateRollerImpl.instantiate(HibernateRollerImpl.java:84)rn ... 32 morernFATAL 2006-08-21 19:16:28,828 RollerFactory:setRoller - Failed to instantiate fallback roller implrnjava.lang.Exception: Doh! Couldn't instantiate a roller classrn at org.apache.roller.model.RollerFactory.setRoller(RollerFactory.java:130)rn at org.apache.roller.model.RollerFactory.getRoller(RollerFactory.java:72)rn at org.apache.roller.presentation.RollerContext.contextDestroyed(RollerContext.java:123)rn at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3733)rn at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4306)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4155)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)rn at org.apache.catalina.core.StandardService.start(StandardService.java:450)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:536)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)rn

没有更多推荐了,返回首页