阿里云安裝Learning Locker
近期,在阿里云ECs上安裝了Learning Locker系統(tǒng),其間的整個安裝過程并非一帆風順,在此將其進行整理和記錄。
一、基本環(huán)境
硬件:雙核,4G,60G硬盤的虛擬主機
軟件:因為以前用CentOS成功安裝過,所以這次一開始使用的是CentOS7。不過由于當前官方首推Ubunutu,所以就更換成Ubuntu 20。
二、軟件介紹
Learning Locker是一個開源的學習行為數(shù)據(jù)記錄數(shù)據(jù)庫,官方網(wǎng)站是:learninglocker.net。大致介紹如下:
Learning Locker is a conformant open source Learning Record Store (LRS) started in 2013 by HT2 Labs (now Learning Pool); a type of data repository designed to store learning activity statements generated by xAPI (Tin Can) compliant learning activities. This website provides technical documentation for Learning Locker, for anything else please see the main website.
三、安裝方法
安裝方法有兩種:一是借助官方提供的安裝腳本(http://docs.learninglocker.net/guides-installing/),二是手工定制安裝(http://docs.learninglocker.net/guides-custom-installation/)。由于安裝所需的安裝包比較多,而且有些安裝包還需要指定初始用戶配置,所以最安全、最快捷的方式就是第一種。
四、安裝過程
(一)登錄服務器,切換成root身份,然后執(zhí)行:
curl -o- -L https://raw.githubusercontent.com/LearningLocker/deploy/master/deployll.sh > deployll.sh && bash deployll.sh
或者
wget -qO deployll.shhttps://raw.githubusercontent.com/LearningLocker/deploy/master/deployll.sh&& bash deployll.sh
此時,會在當前目錄下執(zhí)行deployll.sh這個安裝腳本文件。
(二)在安裝過程中,首先要安裝一系列軟件包,此時選擇y或默認使用回車即可確認。一路回車下來,會發(fā)現(xiàn)在有些軟件包哪里將由于下載慢而導致putty連接超時而中斷。因此,需要設置putty的connection設置里的(0 to turn off)的值為30。以及服務端SSH配置里加入:ServerAliveInterval=30。
(三)接下來,就會遭遇到一個技術問題:deployll.sh: line 740: nodejs: command not found。詳細信息如下:
deployll.sh: line 269: netstat: command not found [LL] We require a path to install to and a path to symlink to. The reason for this is that the script can be re-run in order to update cleanly. The path we'll ask you for is a base path for the releases to be installed to so if you select the default of: /usr/local/learninglocker/releases then we will create a sub-directory under here for every release and symlink the latest install to the final install path (which the nginx config points at. This is so that roll-backs can be done easier and we can perform a complete install before finally switching the nginx config over which'll minimise downtime on upgrades [LL] What base directory do you want to install to? (Press 'enter' for the default of /usr/local/learninglocker/releases) [LL] Directory '/usr/local/learninglocker/releases' doesn't exist - should we create it? [y|n] (Press enter for default of 'y') [LL] What path should the release be symlinked to? (Press enter for the default of /usr/local/learninglocker/current) [LL] I need a user to install the code under - what user would you like me to use? (press enter for the default of 'learninglocker') [LL] User 'learninglocker' doesn't exist - do you want me to create them? [y|n] (enter for default of 'y') [LL] Creating user 'learninglocker'....done! [LL] MongoDB isn't installed - do you want to install it? [y|n] (press 'enter' for default of 'y') [LL] Redis isn't installed - do you want to install it? [y|n] (press 'enter' for default of 'y') [LL] Learning Locker ideally works best with ClamAV (anti virus software) installed but it is not an absolute requirement. Do you want to install it? [y|n] (press 'enter' for the default of 'y') [LL] Installing node version: 10.x deployll.sh: line 740: nodejs: command not found [LL] Something went wrong in installing/updating nodejs. This is likely a fault in your apt config. Can't continue #
國內對此討論很少,國外也不多,最終在Github的Learning Locker的論壇上找到一個:“https://github.com/LearningLocker/learninglocker/issues/1564”。里面涉及到可能的解決方法,以及在解決問題過程中出現(xiàn)的新問題,實際上看上去著實麻煩。但我這里還算幸運,此時需要編輯腳本文件代碼。用vi編輯deployll.sh,定位到740行,可以看到附近有幾處“nodejs --version”。問題就在于:“if-statement assumes nodejs executable to be named nodejs - latest installed version v10.23.0 has only executable node”。所以,需要將第一處無法識別的nodejs --version換成node --version即可。
(四)然后,繼續(xù)做下來又會遇到一個“難問題”——“ fatal: unable to access ‘https://github.com/...’”,即Github無法訪問。解決的方法有很多種,比如:https://blog.csdn.net/weixin_45317091/article/details/113409909。我是ping了Github,確認沒有連接后,選擇添加IP到hosts文件中解決的。
整個操作過程與下述文章基本相同,便不再贅述了:https://blog.csdn.net/u013302168/article/details/120572007。
(五)接下來,就能順利渡過難關,安裝完畢: