說明
情境說明:目前已有網站的備份檔,包含 DB 與 HTML檔,且原網站的版本是較舊的 10.0.8。
重建步驟:
- 先以 Docker 方式佈署新的最後版 Mindtouch。
- 還原備份檔所有內容
- 確認網站正常運作
- 升級網站版本至最新版
安裝前事項
準備以下檔案:
- 舊網站資料庫備份檔
- 舊網站附件及網頁備份檔
- 舊網站的授權檔
/var/www/dekiwiki/bin/_x002F_deki/default/license.xml
以 Docker 方式佈署新網站
建立 Docker Image
git clone https://github.com/a-lang/Docker_mindtouch1014.git
cd Docker_mindtouch1014/
docker build -t alangtw/mindtouch1014_apache .
第一次啟動 container
新增啟動與停止 container 的 scripts
-v /etc/localtime:/etc/localtime:ro 與 Host 時間同步
-v /docker_vol/osslab/... Docker 的永久資料目錄
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
進入 container 系統
docker exec -it osslab /bin/bash
設定 MySQL 管理密碼
// MySQL設定管理這密碼
mysql_secure_installation
安裝新的 Mindtouch
http://server-ip-address/ , 透過網頁指引完成初始化安裝
TIPs:
- 確定 httpd 服務已啟動
- 需先設定 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: 網站名稱(NOTE:如果最後要回復就網站資料,這裡隨便填)
- Admin email: admin@localhost.localdomain
- Site Location: Taiwan
- Admin Info
- First Name: admin *重要*
- Last Name: 可不填
- Phone: 可不填
- Admin password: *重要*
- Confirm password: *重要*
- Database Configuration
- Database Host: localhost
- 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.
...
參考附檔:Installation Completed
繼續完成下述指令
cd /var/www/dekiwiki/config
cp mindtouch.host.conf /etc/dekiwiki
cp mindtouch.deki.startup.xml /etc/dekiwiki
cp LocalSettings.php /var/www/dekiwiki/
chmod 0644 /etc/dekiwiki/mindtouch*
chmod 0644 /var/www/dekiwiki/LocalSettings.php
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
參考附檔:License Activated
到此,一個新的 Mindtouch 網站已經完成。
還原舊網站的備份檔
NOTE:確認以下檔案已經存在
- DB 備份檔: /data/wikidb.sql
- 網頁附件備份目錄: /data/dekiwiki/attachments/
- 小圖示: /data/dekiwiki/favicon.ico
// 還原資料庫
mysql -u root -p wikidb < /data/wikidb.sql
// 還原網頁檔的附件目錄 attachments
cp -rp /data/dekiwiki/attachments/* /var/www/dekiwiki/attachments/
chown -R dekiwiki:apache /var/www/dekiwiki/attachments/
NOTE: 資料庫一旦還原完成,網站的管理者密碼與所有網站的參數設定都會變成舊網站的設定。
舊網站的客製化設定檔(選用)
/var/www/dekiwiki/LocalSettings.php:
...
//
$wgProfileApi = true;
$wgDefaultTimezone = '+08:00'; //GMT offset
//
$wgDefaultEditorEngine = 'FCKeditor';
$wgDefaultEditor = 'FCKeditor';
//
$wgForceCP = true;
網站小圖示:
cp /data/dekiwiki/favicon.ico /var/www/dekiwiki/
F.A.Q
舊網站資料庫還原後,重新開啟網頁出現錯誤:
HTTP Response Status Code: 500
An exception was thrown: Could not find specified column in results in MySql.Data
ANS:原因可能是舊網站是比較舊的 Mindtouch 或 Dekiwiki 版本,解決方式如下:
# cd /var/www/dekiwiki/maintenance/
# php update-db.php
Updating wikidb on localhost
Applying misc database updates...done
added 'languages' config key
Start update script
added 'files/blacklisted-disposition-mimetypes' config key
fixing recentchanges.rc_cur_id data
dropping stored procedures
adding user_seat column to users table
dropping table `linkscc`
dropping table `objectcache`
dropping table `querycache`
Done.