在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
然后会提示你输入管理员密码,(注意在终端输入密码是没有回馈的,就是你输入后没有反应,不回出现****),其他命令也是一个道理


打开终端

root@mh_server:/# cd /opt/misterhouse
root@mh_server:/# sudo apt-get install unzip
root@mh_server:/# sudo unzip misterhouse-v2.200.zip
root@mh_server:/# sudo mv misterhouse-master mh
root@mh_server:/# sudo rm misterhouse-v2.200.zip


最后形成如下的文件结构:

/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:

root@mh_server:/# cd /usr/include
root@mh_server:/# h2ph termios.h
root@mh_server:/# h2ph bits/termios.h
root@mh_server:/# h2ph linux/compiler.h


注: 我找不到的头文件 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_configure

The 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 chmod +x /opt/misterhouse/mh/bin/ubuntu_configure

然后运行它:

root@mh_server:/# sudo /opt/misterhouse/mh/bin/ubuntu_configure

Configure MisterHouse

在启动Misterhouse前,要进行必要的配置与设置。
 ‍Set up directories for local code

建立自己的目录存放自己的配置文件、自定义代码等。这样,当升级到新版本的misterhouse,你可以简单地替换所有文件的MH目录下文件,而不会失去你的定制设置。
Create these directories:

root@mh_server:/# sudo mkdir /opt/misterhouse/code
root@mh_server:/# sudo mkdir /opt/misterhouse/data
root@mh_server:/# sudo mkdir /opt/misterhouse/sounds


复制MH配置示例文件并把它放在misterhouse目录下。你可以定制配置文件以代替发行版本自带的这个文件。misterhouse将首先使用bin/mh.ini中的缺省值然后是mh.private.ini文件中重写那些参数。

root@mh_server:/#sudo cp/opt/misterhouse/mh/bin/mh.example.ini /opt/misterhouse/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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/574607.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java+路径拦截实现_SpringBoot实现拦截器

首先&#xff0c;你的项目要能跑起来&#xff0c;且基于springboot的boot的拦截器不用配置web.xml&#xff0c;按照特定名字书写(后缀注解)&#xff0c;它会自动识别(位置随便放&#xff0c;只要在代码目录下就可以)1.拦截器 SessionInterceptor.javapackage com.hfanss.blog.u…

Codeforces 524C Idempotent functions

题目链接&#xff1a;http://codeforces.com/problemset/problem/542/C 题目大意&#xff1a;给定一种运算f&#xff0c;对于输入的数组来说&#xff0c;一步操作&#xff0c;f(x) a[x]&#xff0c;两步操作&#xff0c;f^2(x) a[a[x]]....倘若每次进行k步操作之后&#xff0…

c 获取mysql安装路径_linux查看mysql安装路径

Linux下查看mysql、apache是否安装,并卸载。指令 ps -ef|grep mysql 得出结果root 17659 1 0 2011 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir/var/lib/mysql --socket/var/lib/mysql/mysql.sock --log-error/var/log/mysqld.log --pid-file/var/run/mysqld/mysqld.p…

微信JS-SDK

<div class"lbox_close wxapi_form"><h3 id"menu-basic">基础接口</h3><span class"desc">判断当前客户端是否支持指定JS接口</span><button class"btn btn_primary" id"checkJsApi">c…

java exif 语言编码_Java读取图片EXIF信息的代码

Java读取图片EXIF信息的代码本文实例讲述了Java读取图片EXIF信息的方法。分享给大家供大家参考。具体分析如下&#xff1a;首先介绍一下什么是EXIF&#xff0c;EXIF是Exchangeable Image File的缩写&#xff0c;这是一种专门为数码相机照片设定的格式。这种格式可以用来记录数字…

Java和pathion_Spring配置中的classpath:与classpath*:的区别

概念解释及使用场景&#xff1a;classpath是指WEB-INF文件夹下的classes目录。通常我们一般使用这种写法实在web.xml中&#xff0c;比如spring加载bean的上下文时&#xff0c;如下&#xff1a;contextConfigLocationclasspath*:/spring-context-*.xmlorg.springframework.web.c…

PHP单引号 ' ',没有任何意义,对所引内容不经任何处理直接拿过来

单引号 没有任何意义&#xff0c;对单引号内部内容不经任何处理直接拿过来。转载于:https://www.cnblogs.com/npk19195global/p/4490758.html

UILabel 宽高自适应

在iOS中&#xff0c;经常遇到需要根据字符串的内容动态指定UILabel&#xff0c;UITextView,UITableViewCell等的高度的情况&#xff0c;这个时候就需要动态的计算字符串内容的高度&#xff0c;下面是计算的方法&#xff1a; /** method 获取指定宽度情况ixa&#xff0c;字符串…

php debug build no,php – 尝试安装xdebug:找不到配置文件

我按照这些说明下载xdebug&#xff1a;http://xdebug.org/wizard.php.向导的输出是这样的&#xff1a;SummaryXdebug installed: noServer API: Apache 2.0 HandlerWindows: noZend Server: noPHP Version: 5.4.17Zend API nr: 220100525PHP API nr: 20100525Debug Build: noTh…

自动自发

<自动自发> 第1章 序言 你属于哪种人&#xff1f; 我们经常会听到这些熟悉的话语&#xff1a; “现在是午餐时间&#xff0c;请您3点以后再打过来吧。” “那根本就不是我负责的工作。” “我现在很忙。” “那是汉曼的工作。” “我不知道该怎样帮助你。” “你去图书馆…

php修改js内容,js怎样修改html元素的内容?HTML DOM实现修改内容

js怎样修改html元素的内容&#xff1f;本章就给大家介绍在js中利用HTML DOM是怎样修改html元素内容的。有一定的参考价值&#xff0c;有需要的朋友可以参考一下&#xff0c;希望对你们有所帮助。首先我们要了解HTML DOM是什么&#xff1f;HTML DOM的作用是什么&#xff1f;HTML…

java中的删除函数的使用方法,如何用Java删除文件

本文概述有两种删除Java文件的方法&#xff1a;使用File.delete()方法使用File.deleteOnExit()方法Java File.delete()方法在Java中, 我们可以使用File类的File.delete()方法删除文件。 delete()方法删除由抽象路径名表示的文件或目录。如果路径名是目录, 则该目录必须为空才能…

windows操作笔记

使用服务或其他windows应用的过程中&#xff0c;可能会遇到莫名其妙的错误&#xff0c;这时候从控制面板中&#xff0c;找到管理工具&#xff0c;打开事件查看器&#xff0c;或者通过计算机管理&#xff0c;找到日志中的记录&#xff0c;如果是代码错误&#xff0c;会给出提示信…

php smarty模板配置,Smarty模板简单配置与使用方法示例

这篇文章主要介绍了Smarty模板简单配置与使用方法,涉及Smarty模板的基本配置与缓存文件的相关使用技巧,需要的朋友可以参考下本文实例讲述了Smarty模板简单配置与使用方法。分享给大家供大家参考&#xff0c;具体如下&#xff1a;在Smarty目录中建立templates,templates_c,conf…

C#开发微信门户及应用(28)--微信“摇一摇·周边”功能的使用和接口的实现

C#开发微信门户及应用(28)--微信“摇一摇周边”功能的使用和接口的实现 原文:C#开发微信门户及应用(28)--微信“摇一摇周边”功能的使用和接口的实现”摇一摇周边“是微信提供的一种新的基于位置的连接方式。用户通过“摇一摇”的“周边”页卡&#xff0c;可以与线下商户进行互…

php控制器实现自动映射,PHP实现路由映射到指定控制器

自定义路由的功能&#xff0c;指定到pathinfo的url上,再次升级之前的脚本SimpleLoader.phpclass SimpleLoader{public static function run($rulesarray()){header("content-type:text/html;charsetutf-8");self::register();self::commandLine();self::router($rule…

【计算几何】点在多边形内部

问题描述&#xff1a;已知点P(x,y)和多边形Poly&#xff0c;判断点P(x,y)是否在多边形内部。 基本方法&#xff1a;射线法 以点P为端点&#xff0c;向左方作射线L&#xff0c;由于多边形是有界的&#xff0c;所以射线L的左端一定在多边形外部&#xff0c;考虑沿着L从无究远处开…

php框架费尔康,GitHub - majixian/study-phalcon: phalcon(费尔康)框架学习笔记

phalcon(费尔康)框架学习笔记以实例程序invo为例(invo程序放在网站根目录下的invo文件夹里&#xff0c;推荐php版本>5.4)环境不支持伪静态网址时的配置第一步&#xff1a;在app\config\config.ini文件中的[application]节点内修改baseUri参数值为/invo/index.php/或/invo/in…

php查找空白行,如何从PHP文本中删除空白行?

小编典典// New line is required to split non-blank linespreg_replace("/(^[\r\n]*|[\r\n])[\s\t]*[\r\n]/", "\n", $string);上面的正则表达式说&#xff1a;/(^[\r\n]*|[\r\n])[\s\t]*[\r\n]/1st Capturing group (^[\r\n]*|[\r\n])1st Alternative: …

Hungary(匈牙利算法)——二分图最大匹配

在复习匈牙利算法的时候&#xff0c;发现这么一篇介绍匈牙利算法的文章&#xff0c;非常通俗易懂&#xff0c;所以就借鉴过来了。 复杂度&#xff1a;邻接矩阵&#xff1a;O&#xff08;v^3&#xff09;邻接表&#xff1a;O&#xff08;V*E&#xff09; 附上链接&#xff1a;趣…