在Ubuntu上安装misterhouse
配置Ubuntu
????? 您將對Ubuntu的配置做某些微小更改以便遠程管理MH BOX和安裝Misterhouse正常運行所需的必要的軟件模塊。首先要進行系統升級。因為系統提供的歐洲源更新實在是太慢了!更換源是為了節省時間,盡快得將系統更新一遍。安裝完系統后這是重要的一個環節用您在操作系統安裝過程中創建的用戶在登錄。
????? 拷貝 old sources.list 文件
admin@mh_server:/# sudo cp /etc/apt/sources.list /etc/apt/sources.list.old???? 編輯old sources.list 文件
admin@mh_server:/# sudo nano /etc/apt/sources.list??? 把內容替換為下面的文本
deb http://debian.ustc.edu.cn/ubuntu/ hardy main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ hardy-backports main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ hardy-proposed main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ hardy-security main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ hardy-updates main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ hardy main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ hardy-backports main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ hardy-proposed main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ hardy-security main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ hardy-updates main multiverse restricted universe deb http://mirror.bjtu.edu.cn/Ubuntu/ hardy main restricted universe multiverse deb http://mirror.bjtu.edu.cn/Ubuntu/ hardy-backports restricted universe multiverse deb http://mirror.bjtu.edu.cn/Ubuntu/ hardy-proposed main restricted universe multiverse deb http://mirror.bjtu.edu.cn/Ubuntu/ hardy-security main restricted universe multiverse deb http://mirror.bjtu.edu.cn/Ubuntu/ hardy-updates main restricted universe multiverse deb-src http://mirror.bjtu.edu.cn/Ubuntu/ hardy main restricted universe multiverse deb-src http://mirror.bjtu.edu.cn/Ubuntu/ hardy-backports main restricted universe multiverse deb-src http://mirror.bjtu.edu.cn/Ubuntu/ hardy-proposed main restricted universe multiverse deb-src http://mirror.bjtu.edu.cn/Ubuntu/ hardy-security main restricted universe multiverse deb-src http://mirror.bjtu.edu.cn/Ubuntu/ hardy-updates main restricted universe multiverse???? 請仔細檢查上述內容,或用剪切并粘貼,保存使用 Ctrl + X 和ENTER。
???? 發出以下命令,以更改的sources.list 文件獲取更新:
admin@mh_server:/# sudo apt-get update???? 所有你按改變后的Ubuntu 服務器的地址,去尋找我們將要安裝的額外軟件包。
admin@mh_server:/# sudo apt-get upgrade????? 這將為 Ubuntu 下載任何 OS 修補程序,并帶來最新的系統。
?
設置靜態IP地址
????? 已經通過 DHCP 網絡配置您的計算機,但為了遠程訪問 MisterHouse,需要給計算機設置靜態IP地址。
????? 驗證計算機的主機名:
root@mh_server:/# sudo nano /etc/hostname???? 它應該有一行,其中包含您在安裝 Ubuntu 時你指派給該計算機的名稱。下一步,看看會告訴計算機在何處查找的域名服務器 (dns) 的文件:
root@mh_server:/# sudo nano /etc/resolv.conf????? 此文件應包含類似于以下內容:
search localdomain nameserver xx.xx.xx.xx nameserver xx.xx.xx.xx?? ?其中所示的 IP 地址匹配 (可能是您的防火墻或路由器) 您主 DNS 和次要 DNS (在我的案子之一,由我的 ISP 提供)。如果您在網絡上安裝 Ubuntu 與啟用 DHCP,它將填充此文件的正確值,你不應該更改它。
??? 下一步你將需要編輯要添加的靜態 ip 地址的"界面"文件:
root@mh_server:/# sudo nano /etc/network/interfaces?
Find the following lines
# The primary network interfaceauto eth0iface eth0 inet dhcp?
并修改它們,如下所示:
# The primary network interfaceauto eth0iface eth0 inet staticaddress [ip address for the mh server]netmask 255.255.255.0gateway [ip address of the gateway]?現在重新啟動計算機,以root身份登錄并輸入:
?
root@mh_server:/# ifconfig若要更改正確完成。它將返回類似以下內容的:
eth0 Link encap:Ethernet HWaddr 00:F0:B7:D3:11:23 inet addr:192.168.1.123 Bcast:192.168.1.255 Mask:255.255.255.0??
設置專門misterhouse的用戶目錄
????? 當你第一次安裝 Ubuntu 您設置了主用戶 (我稱為此用戶"admin")。現在你要創建運行 mh的用戶。此用戶被稱為"mh"。
????? 創建用于 misterhouse 的目錄:
root@mh_server:/# sudo mkdir /opt/misterhouse root@mh_server:/# sudo mkdir /opt/misterhouse/code root@mh_server:/# sudo mkdir /opt/misterhouse/data root@mh_server:/# sudo mkdir /opt/misterhouse/sound???? 創建”mh”用戶和組:
root@mh_server:/# sudo groupadd mh root@mh_server:/# sudo useradd -d /opt/misterhouse -c MisterHouse -g mh -p [password of your choice] mh??? Mh 用戶將需要的音頻設備和串行端口的訪問權限。通過將"mh"用戶添加到撥出組和音頻組執行此操作:
root@mh_server:/# sudo usermod -G mh,dialout,audio mh?
下載安裝必要的包
在此步驟中,您將安裝misterhouse幾個必須的模塊。
Install Perl
root@mh_server:/# sudo apt-get install perl perl-doc?Install Build Essential Package (CPAN won't work without this)
root@mh_server:/# sudo apt-get install build-essential?Install Festival (text to speech)
root@mh_server:/# sudo apt-get install festival?Install rcconf (used to set up scripts to run at boot time)
root@mh_server:/# sudo apt-get install rcconf?Install Perl Modules
root@mh_server:/# sudo apt-get install libdb3 <--- this module may no longer be in the repo, use the -dev below instead root@mh_server:/# sudo apt-get install libdb3-dev root@mh_server:/# sudo apt-get install libdb-file-lock-perl root@mh_server:/# sudo apt-get install libberkeleydb-perl root@mh_server:/# sudo apt-get install libterm-readkey-perl root@mh_server:/# sudo apt-get install libtime-hires-perl root@mh_server:/# sudo apt-get install libaudio-mixer-perl root@mh_server:/# sudo apt-get install libtext-levenshteinxs-perl root@mh_server:/# sudo apt-get install libdbi-perl?Install GD
root@mh_server:/# sudo apt-get install libgd-gd2-perl你現在已經安裝所有需要的Perl 模塊和軟件包。
?
下載安裝 Misterhouse
Misterhouse 的最新版本是 github 上的。它通常是使用 git 工具來訪問。這對初學者比較復雜。更容易的方法是直接訪問misterhouse 官網http://misterhouse.wikispaces.com/,下載zip文件到”mh”用戶的主文件夾中,注意不要存到“下載”文件夾中,因為涉及中文,后續不好處理;這樣,zip文件就存在/home/mh目錄下。直接解壓縮,形成misterhouse文件夾。
??
方法一
第一步:打開終端,在命令行里輸入sudo nautilus
第二步:輸入你的用戶的密碼
第三步:在彈出的窗口中打開需要操作的目錄
第四步:把你所需要的其他目錄中的文件進行復制,并且粘貼到當前的這個目錄中
或者:也可以在當前目錄窗口中刪掉不想要的文件
用sudo 后面接你要執行的命令
方法二:
使sudo命令,獲得臨時管理員的權限
如要復制/home/aaa.txt 到/opt目錄,執行一下命令:
sudo cp /home/aaa.txt /opt
然后會提示你輸入管理員密碼,(注意在終端輸入密碼是沒有回饋的,就是你輸入后沒有反應,不回出現****),其他命令也是一個道理
打開終端
最后形成如下的文件結構:
| /opt/misterhouse | ? | ? | ? |
| ? | mh.private.ini | ? | <- your ? custom mh settings file |
| ? | /code | ? | <- your ? code directory |
| ? | /data | ? | <- your ? data directory |
| ? | ? | /logs | <- your ? log files, lists of what MH has been up to, mostly for debugging |
| ? | /sounds | ? | <- your ? sounds dir (if you need them) |
| ? | /mh | ? | <- the ? production mh code directory - MH runs from here |
| ? | ? | /bin | <- MH ? production binaries |
| ? | ? | /code | <- MH ? production code |
| ? | ? | /data | <- MH ? production data |
| ? | ? | /docs | <- MH ? help documents |
| ? | ? | /lib | <- MH ? production libraries |
| ? | ? | /sounds | <- MH ? production sounds |
| ? | ? | /web | <- MH ? production web interface |
| ? | /mh-old | ? | <- when ? you upgrade, rename mh folder above - this folder is ignored by mh at runtime |
| ? | ? | /bin | but allows ? you to revert in case of any issues with the new version (rare) |
| ? | ? | /code | ? |
| ? | ? | /data | ? |
| ? | ? | /docs | ? |
| ? | ? | /libs | ? |
| ? | ? | /sounds | ? |
| ? | ? | web | ? |
| ? | ? | ? | ? |
?Convert Headers
存在在其他的事物中與 Misterhouse相關的腳本,將某些頭文件從 C 轉換為 Perl。mh 網站上的安裝說明讓你要調用此腳本,稱為"配置",你可以在/opt/mh/bin 目錄中發現 (假設您已經如上文所述安裝)。對 Ubuntu,此腳本無法正常工作因為它試圖將轉換后的頭放在一個不存在的目錄中。此外大部分的所需的頭文件已經以.ph 形式存在除了這些例外情況:
termios.ph
bits/termios.ph
linux/stddefs.ph (see note below)
linux/compiler.ph
Convert these files using the program h2ph:
注: 我找不到的頭文件 linux/stddefs.h 或 linux/stddefs.ph 任意位置。我沒有轉換此標頭,到目前為止看不到任何不良影響。在郵件列表中的查詢似乎表明其他用戶也沒有此文件,它已不是一個問題。
?
?Clean Up
Misterhouse自帶的一個腳本(opt/misterhouse/mh/bin/configure) 我們上面做的這些頭文件轉換。在此腳本中用 h2ph 命令遇到一些麻煩,該命令試圖將文件放在一個不存在的目錄。因此,我在上一步中手動轉換了那些沒以.ph 格式存在頭文件。在配置腳本中有一些我們想做的事情,就是清理一些不用得文件。下面是修改后的腳本:
Open an empty file called 'ubuntu_configure':
打開一個空文件,命名“ubuntu_configure”:
root@mh_server:/# sudo nano /opt/misterhouse/mh/bin/ubuntu_configureThe copy-paste the following text:
復制粘貼下面的文本
#!/bin/sh echo #Deleting Windows-only files... curdir=`pwd` cd /opt/misterhouse/mh/bin rm -f RasDial.txt rasdial.* rm -f *.bat *.exe *.EXE *.wbt rm -rf ../lib/site/Win32* rm -rf ../lib/site/auto/Win32* rm -rf ../lib/site_win* #Making scripts executable chmod +x * cd $curdir
保存文件,退出,并使其可執行文件:
然后運行它:
root@mh_server:/# sudo /opt/misterhouse/mh/bin/ubuntu_configureConfigure MisterHouse
在啟動Misterhouse前,要進行必要的配置與設置。
??Set up directories for local code
建立自己的目錄存放自己的配置文件、自定義代碼等。這樣,當升級到新版本的misterhouse,你可以簡單地替換所有文件的MH目錄下文件,而不會失去你的定制設置。
Create these directories:
復制MH配置示例文件并把它放在misterhouse目錄下。你可以定制配置文件以代替發行版本自帶的這個文件。misterhouse將首先使用bin/mh.ini中的缺省值然后是mh.private.ini文件中重寫那些參數。
?
Edit your local config file:
編輯您的本地配置文件:
root@mh_server:/# sudo nano /opt/misterhouse/mh.private.ini
At a minimum you should specify the following parameters:
至少,您應指定以下參數
code_dir = /opt/misterhouse/code
data_dir = /opt/misterhouse/data
sound_dir = /opt/misterhouse/sounds
tk =0
sound_program = aplay
voice_text = festival # Default Voice synthesis engine
Save and exit this file.
保存并退出此文件。
Move all of the test code to your local directory:
將所有的測試代碼移動到您的本地目錄
root@mh_server:/# sudo mv /opt/misterhouse/mh/code/test/* /opt/misterhouse/code?
?Change File Owner
讓用戶“mh”,可以訪問并運行misterhouse:
?
root@mh_server:/# sudo achown -R mh:mh /opt/misterhouse?
?Test Misterhouse
此時,您應該能夠測試您的安裝,以確保一切工作正常。
root@mh_server:/# su mh mh@mh_server:/# export mh_parms=/opt/misterhouse/mh.private.ini mh@mh_server:/# /opt/misterhouse/mh/bin/mh?
你可能會看到一些雜項錯誤上 Misterhouse 啟動但沒有什么致命。如果您在客戶端計算機上打開 web 瀏覽器和它指向 http:[mh_server ip 地址] //:8080 你應該看看 misterhouse 頁。一旦你感到滿意事情基本上工作的你可以停止與 Ctrl + C 在終端程序。
?
轉載于:https://www.cnblogs.com/misterhouse/p/4475553.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的在Ubuntu上安装misterhouse的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: codevs4203山区建小学
- 下一篇: ongl 表达式