弄了几次,都不行,与上面红色代码不同,我的那几个数字每次都不同,如下:现在很多大家都是用Dr.com上网。而学校又没有提供linux版。或者是老有版本,新的用不了。所以要自己编译。
首要因素是你要安装 build-essential
如果你没有安装过,请利用下面的命令安装
sudo apt-get install build-essential
当然你可以用“新立得”,我就很喜欢新立得!
你需要做的第二件事就是安装libssl-dev,这个包包括了drcom需要用到的用于认证加密的md5函数,它需要一个md5.h的头文件,而这
个文件在libssl-dev中有,另外libssl-dev还包括了其他好多的用于加密的头文件哦。
第三,你需要安装对应内核版本的头文件,这个用 uname -r命令可以得到关于你机器的信息,比如我的:
uname -r
2.6.12-10-686
这是我的内核版本,我用的是Intel P4的CPU,所以我安装的是这个内核,ubuntu默认安装的是 2.6.12-9-386,当你第一次系统更新
时就会安装 2.6.12-10-386,然后一般人都会根据自己的CPU类型选择合适的内核版本,AMD用户会选择 2.6.12-10-k7;
另外你得到信息的方法就是查看/proc/version文件,这里有你机器的一般信息,包括编译内核采用的gcc版本,这也是呆会要用的。
cat /proc/version
比如我的信息显示为:
Linux version 2.6.12-10-686 (buildd@rothera) (gcc version 3.4.5 20050809 (prerelease) (Ubuntu 3.4.4-6ubuntu8)) #1
Mon Jan 16 17:58:04 UTC 2006
它不但告诉了我内核版本还告诉了我gcc的版本是3.4.5,因为你编译新的内核模块时要用到和编译内核同样版本的gcc版本。
那么就在你的“新立得”里面搜索“linux-headers”找到你需要版本的linux头文件
Linux-header-file-{yourversion},比如我的就安装linux-header-2.6.12-10-686
虽然你刚才已经安装了编译的环境build-essential,但是安装的gcc版本是更新的4.0版本,它在用来编译内核模块时是不合适的。
在你的“新立得”搜索gcc,安装gcc3.4,至此你就建立了一个可以编译drcomsuite的环境了,按照前面的方法编译安装。
一、要从能上网的机上下载drcom的源代码,(libdrcom、drcomsuite)以下给出地址:
http://jaist.dl.sourceforge.net/sourcef ... -2.tar.bz2
http://jaist.dl.sourceforge.net/sourcef ... 3.2.tar.gz
二、解压包:以下操作大部分需要超级用户的权限,所以如果你当前是普通用户请用“su”切换到“root“用户
#tar jxvf libdrcom-0.0-20050423-2.tar.bz2
#tar jxvf drcomsuite-0.1.12.tar.bz2
三、安装libdrcom
#cd libdrcom-0.0-20050423-2/
#more INSTALL "查看安装说明
#make
#make install
安装libdrcom一般是没什么问题的,关键是安装后面的那部分
四、安装drcomsuite
安装之前你要确定在以下目录中有Linux内核的头文件或源代码存在,查看方法如下:
#uname -r "如我的就显示"2.6.20-15-server"
#ls /usr/src "那么这里就会有" linux-headers-2.6.20-15-server"或者是"linux"等等目录。注意这版本号一定要
跟上面那命令显示的版本号相对应,要不然可能导致后面的安装失败,或者是drcom程序崩溃。
#cd drcomsuite-0.1.12/
#more INSTALL "可以看到这可以编译生成针对于不同内核版本的drcom,比较新的Linux发行版都是2.6以后的版本了
,这也就是为什么从网络中心下载的客户端使用不了的原因,如果你的系统是2.6以后的版本,那就使用命令的默认参数就行了
#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’声明是常量,要想进行下去,必须要其对进行修改:(可以编
译通过后再改回原样)
#vi /usr/src/你的内核头文件目录/include/net/inet_common.h
找到以下两句,然后删除“const”,保全再从新编译过一次。
extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;
#make "好了,没有出错了吧
#make install
五、配置drcom.conf文件
顺利安装好drcom只是成功的一半,后面还有好戏看呢……在安装的时候已经复制了配置文件样式“drcom.conf.new"到“/etc/“目
录下了。我们需要做的就是:
#mv /etc/drcom.conf.new /etc/drcom.conf
#vi /etc/drcom.conf "会看到以下内容
……
……
# Username and password
# A blank password is considered valid.
username=填入你的帐号名
password=填入帐号密码
# Interface information
# mac is the MAC address of the nic we use to connect
# to the server.
# Example:
# mac=1a:2b:3c:4d:5e:6f
# If left blank it will default to 00:00:00:00:00:00
mac=填入你网卡的物理地址 #不清楚的在终端以root用户输入“ifconfig“查看
# nicn is the nth nic. This is the real data that's
# passed to the server, 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 left blank.
nic0=填入你本机的IP #一般都是单网卡用户,后面的空白
nic1=
nic2=
nic3=
# dnsp(rimary) and dnss(econdary).
dnsp=219.222.191.9 #主dns,这是我们学校的
dnss=202.96.128.86 #次dns,这是我们学校的,一定要填,不填程序会出错,如果没有次dns,填一个合法的ip地址
# dhcp server address. Windows XP uses 255.255.255.255
# and Windows 2000 uses 0.0.0.0
# If left blank it defaults to 255.255.255.255
dhcp= #一般都不是由dhcp指配的ip,所以这里也留空
# Connection information
# If the network supports it, and serverip is set
# to 1.1.1.1, then the gateway will help us find
# the real server (beex said this was the 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 would need eth10), which
# corresponds to the inet address of the
# interface.
hostip=
servip=192.168.252.9 #输入你用drcom时打开浏览器被自动引导如提示你登陆的那个地址就可以了,这个是我们学校的登陆地址,
其他的留空默认
hostport=
servport=
# Miscellaneous Machine Information
# We don't need to be honest about these.
# For example, Windows XP has a version number
# of 5.1 and a build number of 2600.
# All are optional, if left blank, then:
# + hostname defaults to "localhost"
# + winver defaults to 5.1
# + winbuild defaults to 2600
# + servicepack defaults to "Service Pack 2"
#后面的四项是用来假冒windows xp主机的,可以不填
hostname=
winver=
winbuild=
servicepack=
六、测试运行
#drcomcd "启动drcom的守护进程,如果运行成功会提示如下信息:
1177613153 DEBUG drcomc: Creating socket...
#drcomc login "如果显示 Login succeeded,就表示已经连接了,恭喜你。
但是我却在运行drcomcd的时候出现了以下错误:
1177621481 DEBUG drcomcd: Redirecting stderr to /var/log/drcomcd...
*** stack smashing detected ***: drcomcd terminated
忽略 (core dumped)
查看/var/log/drcomcd
1177621481 DEBUG drcomcd: Checking for running instance of drcomcd...
ps -e | grep `basename drcomcd` | grep -v ^\ *15248\
然后查看源代码drcomcd.c(在/……/drcomsuite-0.1.12/drcomcd/目录下),发现原来drcomcd在启动的时候会检查是否有drcomcd正
在运行,在以下语句中出现了错误:
sprintf(s, "ps -e | grep `basename %s` | grep -v ^\\ *%d\\ ", name, pid);
把他改为下面的语句就可以通过:
sprintf(s, "ps -e | grep `basename %s` | grep -v ^\\ %d\\ ", name, pid);
如果修改后,编译能通过,而且drcomcd能运行,但是运行drcomc login 时连接不上的话,那就干脆把上面那语句用/*……*/注释掉
它,没多大影响的。(我测试的时候就出现了这种情况)
修改后重新做步骤四:
#cd drcomsuite-0.1.12/
#make clean "删除上次编译生成的文件
#make
#make install
重新测试后成功了……终于可以在Linux下上网拉。嘻嘻^_^
补充说明:第一次登录必须首先要$su到root用户运行守护进程#drcomcd(因为要动态加载模块drcom),运行#drcomc login登录和
#drcomc logout注销,然后才可以返回普通用户使用系统。要退出守护进程又必须$su到root用户执行#killall drcomcd撤销进程。
但是在ubuntu下就很方便的实现,不清楚查看一下sudo就知道了。
以上我师兄的可以。我的不可以/
那就。。。。。
再装个drcom-1.3.5
下载地址http://sourceforge.net/projects/drcom-client
#tar zxvf drcom-1.3.5.tar.gz
#cd drcom-1.3.5
#make
#make install.
gedit /etc/drcom.conf
根据上面说明填写/
#drcomd
#drcomc login
注销
#drcomc logout
1190528361 DEBUG drcomcd: Checking for running instance of drcomcd...
ps -e | grep `basename drcomcd` | grep -v ^\ *6964\
1190893132 DEBUG drcomcd: Checking for running instance of drcomcd...
ps -e | grep `basename drcomcd` | grep -v ^\ *5997\
唉,没有办法……只有等待高手,由于中途课程紧和暑假,所以很久没有上论坛,暂时把U搁在一边,今天又上论坛,又找到一篇帖子:cookierolls终于把学校的流氓Dr.com给装上去了about59937.html&sid=033b652aa6e5a717c14909f65c1c0155
没有想到,这次居然可以了,在此谢谢cookierolls的好帖子……不过我用的是drcom-1.3.7……心情激动……再次谢谢朋友们……用了几天,问了师兄。也搞了好久。用了好多方法不行。
别说那么多了。分享一下吧。大学的同学们。
首要因素是你要安装 build-essential
如果你没有安装过,请利用下面的命令安装
sudo apt-get install build-essential
当然你可以用“新立得”,我就很喜欢新立得!
你需要做的第二件事就是安装libssl-dev,这个包包括了drcom需要用到的用于认证加密的md5函数,它需要一个md5.h的头文件,而这个文件在libssl-dev中有,另外libssl-dev还包括了其他好多的用于加密的头文件哦。
第三,你需要安装对应内核版本的头文件,这个用 uname -r命令可以得到关于你机器的信息,比如我的:
uname -r
2.6.12-10-686
这是我的内核版本,我用的是Intel P4的CPU,所以我安装的是这个内核,ubuntu默认安装的是 2.6.12-9-386,当你第一次系统更新时就会安装 2.6.12-10-386,然后一般人都会根据自己的CPU类型选择合适的内核版本,AMD用户会选择 2.6.12-10-k7;
另外你得到信息的方法就是查看/proc/version文件,这里有你机器的一般信息,包括编译内核采用的gcc版本,这也是呆会要用的。
cat /proc/version
比如我的信息显示为:
Linux version 2.6.12-10-686 (buildd@rothera) (gcc version 3.4.5 20050809 (prerelease) (Ubuntu 3.4.4-6ubuntu8)) #1 Mon Jan 16 17:58:04 UTC 2006
它不但告诉了我内核版本还告诉了我gcc的版本是3.4.5,因为你编译新的内核模块时要用到和编译内核同样版本的gcc版本。
一、要从能上网的机上下载drcom的源代码,(libdrcom、drcomsuite)以下给出地址:
http://jaist.dl.sourceforge.net/sourcef ... -2.tar.bz2
http://jaist.dl.sourceforge.net/sourcef ... 3.2.tar.gz
二、解压包:以下操作大部分需要超级用户的权限,所以如果你当前是普通用户请用“su”切换到“root“用户
#tar jxvf libdrcom-0.0-20050423-2.tar.bz2
#tar jxvf drcomsuite-0.1.12.tar.bz2
三、安装libdrcom
#cd libdrcom-0.0-20050423-2/
#more INSTALL "查看安装说明
#make
#make install
安装libdrcom一般是没什么问题的,关键是安装后面的那部分
四、安装drcomsuite
安装之前你要确定在以下目录中有Linux内核的头文件或源代码存在,查看方法如下:
#uname -r "如我的就显示"2.6.20-15-server"
#ls /usr/src "那么这里就会有" linux-headers-2.6.20-15-server"或者是"linux"等等目录。注意这版本号一定要跟上面那命令显示的版本号相对应,要不然可能导致后面的安装失败,或者是drcom程序崩溃。
#cd drcomsuite-0.1.12/
#more INSTALL "可以看到这可以编译生成针对于不同内核版本的drcom,比较新的Linux发行版都是2.6以后的版本了,这也就是为什么从网络中心下载的客户端使用不了的原因,如果你的系统是2.6以后的版本,那就使用命令的默认参数就行了
#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’声明是常量,要想进行下去,必须要其对进行修改:(可以编译通过后再改回原样)
#vi /usr/src/你的内核头文件目录/include/net/inet_common.h
找到以下两句,然后删除“const”,保全再从新编译过一次。
extern const struct proto_ops inet_stream_ops;
extern const struct proto_ops inet_dgram_ops;
#make "好了,没有出错了吧
#make install
五、配置drcom.conf文件
顺利安装好drcom只是成功的一半,后面还有好戏看呢……在安装的时候已经复制了配置文件样式“drcom.conf.new"到“/etc/“目录下了。我们需要做的就是:
#mv /etc/drcom.conf.new /etc/drcom.conf
#vi /etc/drcom.conf "会看到以下内容
……
……
# Username and password
# A blank password is considered valid.
username=填入你的帐号名
password=填入帐号密码
# Interface information
# mac is the MAC address of the nic we use to connect
# to the server.
# Example:
# mac=1a:2b:3c:4d:5e:6f
# If left blank it will default to 00:00:00:00:00:00
mac=填入你网卡的物理地址 #不清楚的在终端以root用户输入“ifconfig“查看
# nicn is the nth nic. This is the real data that's
# passed to the server, 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 left blank.
nic0=填入你本机的IP #一般都是单网卡用户,后面的空白
nic1=
nic2=
nic3=
# dnsp(rimary) and dnss(econdary).
dnsp=219.222.191.9 #主dns,这是我们学校的
dnss=202.96.128.86 #次dns,这是我们学校的,一定要填,不填程序会出错,如果没有次dns,填一个合法的ip地址
# dhcp server address. Windows XP uses 255.255.255.255
# and Windows 2000 uses 0.0.0.0
# If left blank it defaults to 255.255.255.255
dhcp= #一般都不是由dhcp指配的ip,所以这里也留空
# Connection information
# If the network supports it, and serverip is set
# to 1.1.1.1, then the gateway will help us find
# the real server (beex said this was the 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 would need eth10 Razz), which
# corresponds to the inet address of the
# interface.
hostip=
servip=192.168.252.9 #输入你用drcom时打开浏览器被自动引导如提示你登陆的那个地址就可以了,这个是我们学校的登陆地址,其他的留空默认
hostport=
servport=
# Miscellaneous Machine Information
# We don't need to be honest about these.
# For example, Windows XP has a version number
# of 5.1 and a build number of 2600.
# All are optional, if left blank, then:
# + hostname defaults to "localhost"
# + winver defaults to 5.1
# + winbuild defaults to 2600
# + servicepack defaults to "Service Pack 2"
#后面的四项是用来假冒windows xp主机的,可以不填
hostname=
winver=
winbuild=
servicepack=
六、测试运行
#drcomcd "启动drcom的守护进程,如果运行成功会提示如下信息:
1177613153 DEBUG drcomc: Creating socket...
#drcomc login "如果显示 Login succeeded,就表示已经连接了,恭喜你。
如果这样不行的话就再装个drcom-1.3.5。我师兄的这样就行了。
下载地址: http://sourceforge.net/projects/drcom-client
[安装。
tar zxvf drcom-1.3.5.tar.gz
cd drcom-1.3.5
make
make install
完
gedit /etc/drcom.conf
username=rli1_03 #用户名
password=******* # 你的密码
mac=00:0F:B0:63:1C:D9 #mac地址,可以通过运行ifconfig命令查得
nic0=10.5.63.254 # 你的ip地址
nic1=
nic2=
nic3=
dnsp=202.113.32.6 # DNS
dnss=202.106.196.115 # 次DNS
dhcp=
hostip=
servip=192.168.100.251 #用drcom时打开浏览器被自动引导如提示你登陆的那个地址
hostport=
servport=
hostname=
winver=
winbuild=
servicepack=
7.呵呵,现在就可以上网了
登录:
sudo drcomd
sudo drcomc login
如果出现以下信息,说明登录成功:
lee@lee-ubuntu:~/dowload/drcom$ sudo drcomc login
Login succeeded
退出:比以前 kill drcomc 好多了那~~呵呵
lee@lee-ubuntu:~/dowload/drcom$ sudo drcomc logout
Logout succeeded