Total Pageviews

Tuesday 27 March 2012

Roller Java WebBlog 安裝簡介 at GlassFish

1.簡介

Apache Roller 是一套Java的WebBlog framework
官網
Apache Roller
它支援市面上大部份的資料庫(oracle、MSSQL、mysql、javadb、apache Derby,PostgresSQL…)
Java application Server部份只要可以使用Servlet 2.4 API的Container都可以(resin、Tomcat 5.5 up、Glashfish 2.0 up…)
Jdk部份則需要1.5 up ,如果是使用Roller 3.x則可以使用Java 1.4.2版本

2.事前準備

需要先安裝一個java Servlert Continaer Web Server,在這裡使用GlashFish 2.x做範例,
而資料庫部份,則是使用MySQL
以上這二部份需要先自行安裝及設定完成
另外需要準備MySQL的JDBC DriverJavaMail所需的jar檔
mysql-connector-java-x.x.x-bin.jar
activation.jar
mail.jar
ps.Apache Roller支援i18n多國語系,為了讓URI支援i18n,所以在Tomcat下請設定/conf/server.xml
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" debug="0"
acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8" />

3.開始安裝

一、下載Roller

http://roller.apache.org/download.cgi#roller40
Roller Web Application 4.0.1.zip

二、再來要建立安裝用的WAR檔

解壓縮後,利用command(命令提示字元)進入其目錄
% cd apache-roller-x.x.x/webapp/roller
% jar cvf ../roller.war *

三、設定資料庫

需要建立一個Database,在MySQL下的方法如下:
% mysql -u root -p
password: *****
mysql> create database rollerdb;
mysql> grant all on rollerdb.* to scott@'%' identified by 'tiger';
mysql> grant all on rollerdb.* to scott@localhost identified by 'tiger';

四、放入所需的jar檔

GlashFish已內建所需jar檔
如果是Tomcat 5.5 以下,請放入Tomcat 5.5目錄\common\lib\裡
如果是Tomcat 6則放入Tomcat 目錄\lib\裡

五、建立參數檔

建立一個檔案名稱為roller-custom.properties的檔案
內容:
installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=JDBC driver class name
database.jdbc.connectionURL=JDBC connection URL
database.jdbc.username=database username
database.jdbc.password=database password
mail.configurationType=properties
mail.hostname=mail server hostname
mail.username=mail username
mail.password=mail passwd
一個簡單的範例如下:
installation.type=auto
database.configurationType=jdbc
database.jdbc.driverClass=com.mysql.jdbc.Driver
database.jdbc.connectionURL=jdbc:mysql://localhost:3306/rollerdb
database.jdbc.username=scott
database.jdbc.password=tiger
mail.configurationType=properties
mail.hostname=smtp-server.example.com
mail.username=scott
mail.password=tiger
然後把這個檔案放入
GlashFish
GlashFish\domains\domain1\lib\classes
Tomcat 5.5 and down
Tomcat\common\classes
Tomcat 6
Tomcat\lib\

六、deploying to web Server

再來我們把剛才建好的war檔(應該是在剛才解壓縮Roller的目錄裡)
利用GlashFish的admin console來Deploy

完成後就會多一個roller出來了,可以按Action裡的Launch來看看執行的狀況

如果沒有問題,應該是如下的畫面

再來你就可以建立使用者來看看嚕,如果並不如預期,可以查看Server 的log檔看有那裡出了問題
ps.Tomcat部份請安裝Tomcat administrator後,用法大概一樣

七.修改roller-custom.properties設定

再來把剛才roller-custom.properties的
installation.type=auto
改成
installation.type=manual
然後重新啟動Server 就可以啦
其它比較詳細的設定可以參考
官網的安裝手冊


from http://blog.yslifes.com/archives/405

 

No comments:

Post a Comment