練功房推薦書單

  • 猛虎出柙雙劍合璧版:最新 OCA / OCP Java SE 7 Programmer 專業認證
  • 流浪教師存零股存到3000萬
  • SCJP 6.0認證教戰手冊(第二版)Oracle Certified Professional Java Programmer(附光碟)
  • 小資女艾蜜莉:我的資產翻倍存股筆記
OLAT 6.1.1->6.2.1升級筆記  RSS feed
討論區首頁 » OLAT中文社群 OLAT Chinese Users Community
發表人 內容
andowson

七段學員
[Avatar]

註冊時間: 2007-01-02 22:20:40
文章: 704
來自: 台北
離線
步驟如下:
1.切換到下載目錄
cd ~/download

2.下載原始碼壓縮檔
wget http://www.olat.org/downloads/stable/OLAT-6.2.1.zip

3.解壓縮
unzip OLAT-6.2.1.zip

4.將舊版程式目錄更名
mv olat3 OLAT-6.1.1

5.將解縮壓後的目錄更名為olat3
mv OLAT-6.2.1-PUBLIC-* olat3

6.切換到olat3目錄
cd olat3

7.開啟build.properties.default,輸入:set nu,搜尋mysql,找到mysql的起始和結尾行號
vi build.properties.default

8.產生build.properties,先不啟用instantMessaging
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/data\/olatdata/g" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat6/g" \
-e "1,$$s/www.myolat.com/www.andowson.com/g" \
-e "1,$$s/myolat.com/andowson.com/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/server.modjk.enabled=false/server.modjk.enabled=true/g" \
-e "55a\server.modjk.jvmRoute=worker1" \
-e "s/defaultcharset=ISO-8859-1/defaultcharset=UTF-8/g" \
-e "s/registration.enableNotificationEmail=false/registration.enableNotificationEmail=true/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=smtp.other.com/g" \
-e "s/smtp.user=/smtp.user=username/g" \
-e "s/smtp.pwd=/smtp.pwd=password/g" \
-e "121,143d" \
-e "1,$$s/#db/db/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/g" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/g" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=openfire/g" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=openfire/g" \
-e "s/cluster.catalinaport=8006/cluster.catalinaport=8105/" \
-e "s/cluster.ajpport=8009/cluster.ajpport=8109/" build.properties.default > build.properties

9.調整螢幕右上方語言選單,加入簡體中文(zh_CN)和正體中文(zh_TW)
sed -i -e "s/<enabledLanguages>en,de,fr,it,es<\/enabledLanguages>/<enabledLanguages>en,de,fr,it,es,zh_CN,zh_TW<\/enabledLanguages>/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in

10.修改系統自動產生之使用者預設的電子郵件網域名稱
sed -i -e "1,$$s/olat-newinstallation.org/andowson.com/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in

11.修正web.xml中註解
sed -i -e "13c\        <\!-- default session timeout -->" ~/download/olat3/webapp/WEB-INF/web.xml.in

12.修正無法編譯的錯誤:刪除build.xml中findbugs區段,行號可由build.xml中找出
sed -i -e "1351,1364d" build.xml

13.開始編譯
ant config-all
ant build

14.關閉Tomcat
sudo /etc/init.d/tomcat stop

15.備份資料庫
sudo -u postgres pg_dump olat > /tmp/olat.bak

16.檢查是否有需要做資料庫更新
ls ~/download/olat3/database/postgresql

17.找到檔案alter_6_1_1_to_6_2_0.sql,執行更新
sudo psql -U olat olat -f  ~/download/olat3/database/postgresql/alter_6_1_1_to_6_2_0.sql

18.將舊版程式搬到暫存區
sudo mv ~/www/olat /tmp/olat-6.1.1

19.將檔案複製到~/www/olat目錄
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat

20.設定目錄寫入權限
sudo chmod 775 ~/www/olat/static
sudo chmod 775 ~/www/olat/WEB-INF
sudo chmod 775 -R ~/data/olatdata

21.啟動Tomcat
sudo /etc/init.d/tomcat start

22.開啟瀏覽器測試網站是否可以正常顯示首頁,檢查一下~/data/olatdata/logs/olat.log有無ERROR的訊息。
如果一切正常則可以接下做,將openfire加上去
23.啟用openfire設定
sed -i -e "s/instantMessaging.enable=false/instantMessaging.enable=true/g" build.properties

24.重新編譯
ant config-all
ant build

25.關閉Tomcat
sudo /etc/init.d/tomcat stop

26.將檔案複製到目錄中
cp -rf ~/download/olat3/webapp/WEB-INF/classes/* ~/www/olat/WEB-INF/classes/.
cp -rf ~/download/olat3/webapp/WEB-INF/src/serviceconfig/* ~/www/olat/WEB-INF/src/serviceconfig/.

27.啟動Tomcat
sudo /etc/init.d/tomcat start

28.開啟瀏覽器測試網站是否可以正常顯示首頁,檢查一下~/data/olatdata/logs/olat.log有無ERROR的訊息。
29.加上jsMath
ant jsmath
ant build

30.關閉Tomcat
sudo /etc/init.d/tomcat stop

31.將檔案複製到目錄中
cp -rf ~/download/olat3/webapp/static/js/jsMath/* ~/www/olat/static/js/jsMath/.
cp -rf ~/download/olat3/webapp/WEB-INF/classes/serviceconfig/* ~/www/olat/WEB-INF/classes/serviceconfig/.
cp -rf ~/download/olat3/webapp/WEB-INF/src/serviceconfig/* ~/www/olat/WEB-INF/src/serviceconfig/.

32.啟動Tomcat
sudo /etc/init.d/tomcat start

如此就大功告成囉。
以下附上所有的shell script寫法,只要將它先複製到記事本,再依您實際環境修改一下,然後開個PuTTYPieTTY視窗貼上即可。
# get OLAT source
cd ~/download
wget http://www.olat.org/downloads/stable/OLAT-6.2.1.zip
unzip OLAT-6.2.1.zip
mv olat3 OLAT-6.1.1
mv OLAT-6.2.1-PUBLIC-* olat3
cd olat3

# config build.properties
sed -e "s/\/usr\/local\/opt\/olat\/olat3/\/home\/andowson\/download\/olat3/g" \
-e "s/\/usr\/local\/opt\/olat\/olatdata/\/home\/andowson\/data\/olatdata/g" \
-e "s/\/usr\/local\/opt\/tomcat/\/var\/tomcat6/g" \
-e "1,$$s/www.myolat.com/www.andowson.com/g" \
-e "1,$$s/myolat.com/andowson.com/g" \
-e "1,$$s/myolat/andowson/g" \
-e "s/server.modjk.enabled=false/server.modjk.enabled=true/g" \
-e "55a\server.modjk.jvmRoute=worker1" \
-e "s/defaultcharset=ISO-8859-1/defaultcharset=UTF-8/g" \
-e "s/registration.enableNotificationEmail=false/registration.enableNotificationEmail=true/g" \
-e "s/smtp.host=smtp.andowson.com/smtp.host=smtp.other.com/g" \
-e "s/smtp.user=/smtp.user=username/g" \
-e "s/smtp.pwd=/smtp.pwd=password/g" \
-e "121,143d" \
-e "1,$$s/#db/db/g" \
-e "1,$$s/net.sf.hibernate/org.hibernate/g" \
-e "s/instantMessaging.server.name=jabber.andowson.com/instantMessaging.server.name=www.andowson.com/g" \
-e "s/instantMessaging.db.name=wildfire/instantMessaging.db.name=openfire/g" \
-e "s/instantMessaging.db.user=wildfire/instantMessaging.db.user=openfire/g" \
-e "s/instantMessaging.db.pass=wildfire/instantMessaging.db.pass=openfire/g" \
-e "s/cluster.catalinaport=8006/cluster.catalinaport=8105/" \
-e "s/cluster.ajpport=8009/cluster.ajpport=8109/" build.properties.default > build.properties

# adjust the original template config files
# enable zh_CN and zh_TW on the top right menu
sed -i -e "s/<enabledLanguages>en,de,fr,it,es<\/enabledLanguages>/<enabledLanguages>en,de,fr,it,es,zh_CN,zh_TW<\/enabledLanguages>/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# change domain name in email address 
sed -i -e "1,$$s/olat-newinstallation.org/andowson.com/g" ~/download/olat3/webapp/WEB-INF/olat_config.xml.in
# fix the commnet style in XML
sed -i -e "13c\        <\!-- default session timeout -->" ~/download/olat3/webapp/WEB-INF/web.xml.in

# remove findbugs setting
sed -i -e "1351,1364d" build.xml
ant config-all
ant build

# stop Tomcat
sudo /etc/init.d/tomcat stop

# backup db
sudo -u postgres pg_dump olat > /tmp/olat.bak

# apply db upgrade script
sudo psql -U olat olat -f  ~/download/olat3/database/postgresql/alter_6_1_1_to_6_2_0.sql

# copy to the target directory
sudo mv ~/www/olat /tmp/olat-6.1.1
cp -rf ~/download/olat3/webapp ~/www/olat
cp -rf ~/download/olat3/htdocs/* ~/www/olat
sudo chmod 775 ~/www/olat/static
sudo chmod 775 ~/www/olat/WEB-INF
sudo chmod 775 -R ~/data/olatdata

# start Tomcat
sudo /etc/init.d/tomcat start

# endable OpenFire
sed -i -e "s/instantMessaging.enable=false/instantMessaging.enable=true/g" build.properties
ant config-all
ant build

# stop Tomcat
sudo /etc/init.d/tomcat stop

# copy to the target directory
cp -rf ~/download/olat3/webapp/WEB-INF/classes/* ~/www/olat/WEB-INF/classes/.
cp -rf ~/download/olat3/webapp/WEB-INF/src/serviceconfig/* ~/www/olat/WEB-INF/src/serviceconfig/.

# start Tomcat
sudo /etc/init.d/tomcat start


# enable jsMath
ant jsmath
ant build

# stop Tomcat
sudo /etc/init.d/tomcat stop

# copy to the target directory
cp -rf ~/download/olat3/webapp/static/js/jsMath/* ~/www/olat/static/js/jsMath/.
cp -rf ~/download/olat3/webapp/WEB-INF/classes/serviceconfig/* ~/www/olat/WEB-INF/classes/serviceconfig/.
cp -rf ~/download/olat3/webapp/WEB-INF/src/serviceconfig/* ~/www/olat/WEB-INF/src/serviceconfig/.

# start Tomcat
sudo /etc/init.d/tomcat start

分享經驗 累積智慧
[WWW] [MSN]
 
討論區首頁 » OLAT中文社群 OLAT Chinese Users Community
前往: