Wednesday, October 15, 2008

Dr.COM under Ubuntu 8.04 Destop Version.

1, 安装“build-essential”:“sudoapt-get install build-essential” 。

2.安装“libssl-dev”:“sudoapt-get install libssl-dev”。

3.安装“gcc-3.4”:“sudoapt-get install gcc-3.4”。

4. 安装对应内核版本的头文件,在“新立得软件包管理器”中搜索"linux-headers"就行了,至于要选择哪一个,用cat/proc /version得到类似“Linuxversion 2.6.20-16-generic (root@terranova) (gcc version 4.1.2 (Ubuntu4.1.2-0ubuntu4)) #2 SMP Sun Sep 23 19:50:39 UTC2007”,其中2.6.20-16-generic为内核版本,

5.分别安装libdrcom、drcomsuite、drcom-1.3.7,http://sourceforge.net/project/showfiles.php?group_id=128089下载。

5.1)安装libdrcom:

用超级用户将文件“libdrcom-0.0-20050423-2.tar.bz2”e解压至/home/Username/下(即Root目录)。
$cdlibdrcom-0.0-20050423-2/
$sudo make
$sudo make install

5.2)安装drcomsuite:
安装之前要确定已经安装了Linux内核的头文件。

$ls/usr/src命令查看得到与
“linux-headers-2.6.20-15linux-headers-2.6.20-16
linux-headers-2.6.20-15-genericlinux-headers-2.6.20-16-generic”
类似的结果。版本号对应后,将“drcomsuite-0.1.12.tar.bz2”解压至Root目录,执行

$cd drcomsuite-0.1.12/
$sudo make

make过程中出现以下错误:
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:在函数 ‘init_proto’中:
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:306:错误: 向只读变量‘inet_stream_ops’赋值
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:309:错误: 向只读变量‘inet_dgram_ops’赋值
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:在函数 ‘cleanup_proto’中:
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:322:错误: 向只读变量‘inet_dgram_ops’赋值
/……/Drcom/drcomsuite-0.1.12/module/Linux/2.6.x/proto.c:323:错误: 向只读变量‘inet_stream_ops’赋值
说明了内核头文件中‘inet_stream_ops’和‘inet_dgram_ops’声明是常量,必须对其进行修改,执行

$sudogedit /usr/src/内核头文件名(2个,每个一次)/include/net/inet_common.h

找到以下两句:
externconst struct proto_ops inet_stream_ops;
extern const structproto_ops inet_dgram_ops;

删除其中的“const”,保存。

然后再次cd到drcomsuite-0.1.12,即

$cddrcomsuite-0.1.12/
$sudo make
$sudo make install

5.3)配置drcom.conf文件:
$sudomv /etc/drcom.conf.new /etc/drcom.conf
$sudo gedit/etc/drcom.conf

看到以下内容
#Username and password
# A blank password is consideredvalid.

username=帐号
password=密码

#Interface information
# mac is the MAC address of the nic we useto connect
# to the server.
# Example:
#mac=1a:2b:3c:4d:5e:6f
# If left blank it will default to00:00:00:00:00:00

mac=网卡物理地址,可以在终端输入”ifconfig| grep HWaddr”查看

#nicn is the nth nic. This is the real data that's
# passed to theserver, and thus I suggest you only
# fill in the first nic.
#Example:
# nic0=192.168.0.1
# nic1=
# nic2=
# nic3=
#Only nic0 is mandatory; the others should normally
# be leftblank.

nic0=填入IP地址

nic1=
nic2=
nic3=
#dnsp(rimary) and dnss(econdary).

dnsp=填入首选DNS
dnss=填入备用DNS

#dhcp server address. Windows XP uses 255.255.255.255
# and Windows2000 uses 0.0.0.0
# If left blank it defaults to255.255.255.255
dhcp=
# Connection information
# If thenetwork supports it, and serverip is set
# to 1.1.1.1, then thegateway will help us find
# the real server (beex said this wasthe reason
# why we had to upgrade, but I don't see the
#practical reason why)
# All are optional, if left blank, then:
#+ hostip defaults to nic0
# + servip defaults to 1.1.1.1
# +hostport defaults to 61440 (0xf000)
# + servport defaults to 61440(0xf000)
# Note: hostip can be given one of the special values
#eth0, eth1, eth2, ... eth9 (I don't think
# regular users wouldneed eth10 Razz), which
# corresponds to the inet address of the
#interface.
hostip=

servip=填入校服务器地址址,即未登录前自动引导到的那个地址。其他的都留空,保持默认値

hostport=
servport=
#Miscellaneous Machine Information
# We don't need to be honestabout these.
# For example, Windows XP has a version number
#of 5.1 and a build number of 2600.
# All are optional, if leftblank, then:
# + hostname defaults to "localhost"
# +winver defaults to 5.1
# + winbuild defaults to 2600
# +servicepack defaults to "Service Pack2"
hostname=
winver=
winbuild=
servicepack=

5.4)安装drcom-1.4.7:
将“drcom-1.4.7.tar.gz”解压至Root目录下,执行
$cddrcom-1.4.7
$sudo make
$sudo make install
$sudo gedit/etc/drcom.conf

讲下列数据填好后粘贴至/etc/drcom.conf:
username=帐号名
password=帐号密码

device=eth0
mac=网卡物理地址
nic0=IP地址
nic1=
nic2=
nic3=
dnsp=首选DNS
dnss=备用DNS
dhcp=
hostip=
servip=校服务器地址

hostport=
servport=
hostname=
winver=
winbuild=
servicepack=
保存退出。

6.配置本机IP等信息

1.Manualnetwork configuration

1.1Wired Connection

StaticIP Address: 59.74.70.**
SubnetMask: 255.255.255.0
GatewayAddress: 59.74.70.1

1.2DNS

DNSServers: 218.195.24.1

1.3Hosts

Localhost:218.195.24.131
Laptop:59.74.70.**

7.登录:
$sudodrcomd
$sudo drcomc login
注销执行
$sudo drcomc logout
如果在运行sudodrcomc login 时出现:
cannot create socket to server,则执行
$sudokillall drcomd即可。

No comments: