說明
情境說明:目前已有網站的備份檔,包含 DB 與 HTML檔,且原網站的版本是較舊的 10.0.8。
重建步驟:
- 先以 Docker 方式佈署與原網站同版本的系統。
- 還原備份檔所有內容
- 確認網站正常運作
- 升級網站版本至最新版
安裝前事項
準備以下檔案:
- 舊網站資料庫備份檔
- 舊網站附件及網頁備份檔
- 舊網站的授權檔
/var/www/dekiwiki/bin/_x002F_deki/default/license.xml - 舊網站主設定檔
/etc/dekiwiki/mindtouch.deki.startup.xml
/etc/dekiwiki/mindtouch.host.conf
以 Docker 方式佈署新網站
第一次啟動 container
新增啟動與停止 container 的 scripts
run.sh:
reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)Callstack:
at User:Alang/IT_專案工作/Mindtouch_(Dekiwiki)/使用_Docker_安裝_Mindtouch
MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException: reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown.
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptVar expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptVar.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Evaluate (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state, Boolean evaluateProperties) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptAccess.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptCall expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptCall.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptSequence expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptSequence.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptReturnScope expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
stop.sh:
reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)Callstack:
at User:Alang/IT_專案工作/Mindtouch_(Dekiwiki)/使用_Docker_安裝_Mindtouch
MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException: reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown.
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptVar expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptVar.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Evaluate (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state, Boolean evaluateProperties) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptAccess.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptCall expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptCall.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptSequence expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptSequence.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptReturnScope expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
debug.sh:
reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown. (click for details)Callstack:
at User:Alang/IT_專案工作/Mindtouch_(Dekiwiki)/使用_Docker_安裝_Mindtouch
MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException: reference to undefined name 'syntax' Exception of type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' was thrown.
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptVar expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptVar.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Evaluate (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state, Boolean evaluateProperties) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptAccess expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptAccess.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptCall expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptCall.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptSequence expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Expr.DekiScriptSequence.VisitWith[DekiScriptExpressionEvaluationState,Range] (IDekiScriptExpressionVisitor`2 visitor, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
at MindTouch.Deki.Script.Compiler.DekiScriptExpressionEvaluation.Visit (MindTouch.Deki.Script.Expr.DekiScriptReturnScope expr, DekiScriptExpressionEvaluationState state) [0x00000] in <filename unknown>:0
設定權限
chmod 0755 run.sh stop.sh debug.sh
啟動 container
./debug.sh
Ctrl + c
./run.sh
設定 MySQL 管理密碼
// MySQL設定管理這密碼
mysql_secure_installation
透過網頁指引完成初始化安裝
TIPs:
- 需先設定 MySQL 管理密碼
- 確認 mono 安裝目錄 /opt/mono-2.10.8/bin/mono
- 出現訊息: Mono was not found in your path. Please specify the path to mono in the Advanced Configuration section. , 可以忽略它。
Web Installation:
- Choose Install Type : Mindtouch Core
- Site Info
- Site Name: 網站名稱
- Admin email: admin@localhost.localdomain
- Site Location: Taiwan
- Admin Info
- First Name: admin *重要*
- Last Name: 可不填
- Phone: 可不填
- Admin password: *重要*
- Confirm password: *重要*
- Database Configuration
- Database Host: 127.0.0.1
- Database name: wikidb
- Database user: wikiuser
- Existing MySQL Credentials
- Superuser name: root
- Superuser password: *重要*
- Advanced Configuration
- Mono: /opt/mono-2.10.8/bin/mono
- 其餘項目不用變動
- Tell us a little about you
- Number of people in your organization: 隨便
- Department:隨便
- How do you plan on using Mindtouch: 隨便
- INSTALL MINDTOUCH: 按下後開始進行安裝,請耐心等候。
安裝程序完成時,頁面會顯示
Your Install Is Almost Complete!
Your MindTouch license could not be generated. Please follow the steps below to retrieve your license.
...
繼續依指示完成下述指令
cd /var/www/dekiwiki/config
mkdir /etc/dekiwiki
cp -p mindtouch.host.conf /etc/dekiwiki
cp -p mindtouch.deki.startup.xml /etc/dekiwiki
cp -p LocalSettings.php /var/www/dekiwiki/
rm mindtouch.host.conf
rm mindtouch.deki.startup.xml
rm LocalSettings.php
/etc/init.d/dekiwiki stop
/etc/init.d/dekiwiki start
安裝完成。
開啟網站首頁,並以管理員帳號登入。
TIPs:
第一次登入管理控制台,顯示網站尚未啟動授權,以致無法正常運作。上傳授權檔 license.xml 並啟動網站。
啟動服務時,如無法立即出現網頁,需等待數分鐘。
啟動授權作業時,需等待數分鐘直到網頁顯示
License Type: Mindtouch Core Perpetual licemse
到此,一個新的 Mindtouch 網站已經完成。
還原舊網站的備份檔
NOTE:確認以下檔案已經存在
- DB 備份檔: /data/wikidb.sql
- 網頁備份檔: /data/dekiwiki/
// 還原資料庫
mysql -u root -p wikidb < /data/wikidb.sql
// 還原網頁檔的附件目錄 attachments
cp -r /data/dekiwiki/attachments/* /var/www/dekiwiki/attachments/
chown -R dekiwiki:apache /var/www/dekiwiki/attachments/
TIPs:
資料庫一旦還原完成,網站的管理者密碼就變成舊網站的設定。
調整以下幾個設定檔案
將 APIKEY 與 dbuser, dbpass, dbname
- /etc/dekiwiki/mindtouch.host.conf
- /etc/dekiwiki/mindtouch.deki.startup.xml
- /var/www/dekiwiki/LocalSettings.php
F.A.Q
網頁出現錯誤
Site settings could not be loaded
We were unable to locate the API to request site settings. Please see below for debugging information. If this is a new install, try refreshing - the API is simply taking its time loading up!
HTTP Response Status Code: 0
Empty reply from server
ANS: