分享

1105版小毛驴安装后常用修正汇总

 故园 2012-03-10

1105版小毛驴安装后常用修正汇总

首先声明,不过是安装过程的常见修正,基本都是它山之玉。就整理验证了一下,谈不上什么原创。放这就图个大家方便,别说我抄的什么的啊。
一:改系统ip地址
1105版初始地址为192.168.3.250,可以通过ifconfig命令查看。
修改方法为编辑/etc/network/interfaces文件,地址待修改部分如下:
address 10.0.1.8
netmask 255.255.255.0
gateway 10.0.1.2
用vi改为自己的指定地址就好,这样设的地址是静态的,要注意不要和现有客户机地址冲突。
毛驴机可能都很小巧,大家可能会拿它在几个相对固定的地方使用。那么为方便计,可以设为动态获取,然后设置路由的DHCP让它为小毛驴的MAC分配固定地址,免得每次换地方就改IP。
二:修改roo的密码
指令为:passwd ,改root密码为passwd root
然后输2次新密码就好,默认密码简单且坛子里都知道,改改吧。
三:更改DNS地址
用vi修改/etc/resolv.conf文件,把nameserver改为本地的DNS服务器地址,否则网络访问可能会很慢。
四:修改软件源
用Uname –a指令可以看到这么一行版本提示:
Linux nas 2.6.37.3 #11 SMP Thu May 12 17:19:17 CST 2011 i686 GNU/Linux
用lsb_release –a可以看到下面的操作系统描叙:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 9.04
Release:        9.04
Codename:       jaunty
可见系统有点老了,用163的源和官方源都无法保证软件安装正确。找了一圈,一个比较可靠的软件源为http://old-releases./ubuntu/
用vi修改/etc/apt/sources.list ,把里面内容清空,改为如下:
    deb http://old-releases./ubuntu jaunty main restricted universe multiverse
deb http://old-releases./ubuntu jaunty-security main restricted universe multiverse
deb http://old-releases./ubuntu jaunty-updates main restricted universe multiverse
deb http://old-releases./ubuntu jaunty-proposed main restricted universe multiverse
deb http://old-releases./ubuntu jaunty-backports main restricted universe multiverse
deb-src http://old-releases./ubuntu jaunty main restricted universe multiverse
deb-src http://old-releases./ubuntu jaunty-security main restricted universe multiverse
deb-src http://old-releases./ubuntu jaunty-updates main restricted universe multiverse
deb-src http://old-releases./ubuntu jaunty-proposed main restricted universe multiverse
deb-src http://old-releases./ubuntu jaunty-backports main restricted universe multiverse
然后apt-get update 更新一下软件列表,否则会出现几乎找不到软件的情况。
五:安装编译和调试环境
版主老大把系统精简得稍多了些,要装个什么软件要编译的话基本无法成功,调整如下。
安装软件编译工具链 apt-get install gcc g++ autoconf automake make
安装核心编译工具链 apt-get install kernel-package libncurses5 libncurses5-dev build-essential  fakeroot
六:修正磁盘信息显示错误
用vi修改 /opt/www/disk.php 文件,找到if($info["system"])continue;这一句加上个!号。
变成if(!$info["system"])continue;
同样修改该目录下的home.php文件,找同样的地方同样的修改。
七:安装花生壳动态域名软件
这个就参照它官方的帮助好了http://service.oray.com/question/116.html ,除了它的第1步其它照做就好。为防它以后页面变动就贴这了,不过特别申明这段引用自花生壳官方,贴在这只是图个方便。
以下引用开始:
安装和使用花生壳(linux)
一、安装说明(以CentOS 5为例)
1、安装必要的开发包
[root@localhost ~]# yum install gcc gcc-c++ autoconf automake
2、下载phddns-2.0.2.16556.tar.gz到某一个目录
[root@localhost ~]# wget http://download.oray.com/peanuthull/phddns-2.0.2.16556.tar.gz
3、解压所有文件
[root@localhost ~]# tar zxvf phddns-2.0.2.16556.tar.gz
4、进入目录并编译
[root@localhost ~]# cd phddns-2.0.2.16556
[root@localhost phddns-2.0.2.16556]# aclocal
[root@localhost phddns-2.0.2.16556]# autoconf
[root@localhost phddns-2.0.2.16556]# automake
[root@localhost phddns-2.0.2.16556]# ./configure
[root@localhost phddns-2.0.2.16556]# make
[root@localhost phddns-2.0.2.16556]# cd src
[root@localhost src]# ls -l phddns
-rwxr-xr-x 1 root root 80968 Aug 2 11:18 phddns
5、执行编译好的程序并配置(默认使用/etc/phlinux.conf,如果不存在这个文件则自动进入交互配置)
[root@localhost src]# ./phddns
输入服务器地址,如无特殊情况可使用默认值
Enter server address(press ENTER use phlinux3.oray.net):
输入您的Oray账号名称
Enter your Oray account:
对应的Oray账号密码
Password:
选择帮定的网卡,如无特殊,默认即可
Network interface(s):
eth0:192.168.141.18
lo:127.0.0.1
Choose one(default eth0):
选择日志保存到哪个文件
Log to use(default /var/log/phddns.log):
保存配置文件,选择yes则直接保存到/etc/phlinux.conf,输入other可以指定文件
Save to configuration file (/etc/phlinux.conf)?(yes/no/other):
接下来程序将已交互模式开始运行
192.168.141.18
NIC bind success
OnStatusChanged okConnecting
OnStatusChanged okDomainListed
OnDomainRegistered skyvense22.gicp.net
OnStatusChanged okDomainsRegistered
UserType: 0
看到上面这些就表示登录成功,这个时候可以按ctrl+c先退出程序
6、将phddns拷贝到你希望的位置
[root@localhost src]# cp phddns /usr/bin/
7、以后台模式启动花生壳并检查运行情况
[root@localhost ~]# /usr/bin/phddns -c /etc/phlinux.conf -d
phlinux started as daemon!
[root@localhost ~]# tail /var/log/phddns.log
2011/08/02 11:28:58.256| ExecuteUpdate OK, BeginKeepAlive!
2011/08/02 11:29:59.354| SendKeepAlive() 8208
2011/08/02 11:30:00.355| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:30:00.356| Keepalive response received, client ip: 116.231.123.96
2011/08/02 11:31:00.447| SendKeepAlive() 8208
2011/08/02 11:31:01.450| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:31:01.450| Keepalive response received, client ip: 116.231.123.96
8、退出花生壳
查看进程ID
[root@localhost ~]# ps -A | grep phddns
13731 ? 00:00:00 phlinux
让后台进程退出
[root@localhost ~]# kill -9 13731
9、将花生壳加到系统启动时运行
[root@localhost ~]# vi /etc/rc.local
在文件的末尾加上一行:/usr/bin/phddns -c /etc/phlinux.conf -d
二、花生壳Linux版本命令行参数说明
[root@localhost ~]# /usr/bin/phlinux -h
Peanuthull Linux-core 2.0 by oray.com, copyright 2011
Peanuthull Linux-core Help
--first-run
-f, run for the first time
用于首次启动时配置参数
--interact
-i, run as interactive mode
program will request for necessary parameters.
this mode will automatically enabled at first running,
or your configuration file has been lost.
启动交互模式
--daemon
-d, run as a daemon
program will quit after put itself to background,
and continue running even you logout,
you can use kill -9 <PID> to terminate.
后台模式
--config
-c, run with configuration file
program will run with the file
指定使用哪一个配置文件
--user
-u, run as the user
program will run as the user
以指定用户启动后台进程
--help
-h, print this screen.
Please visit http://www.oray.com/ for detail.
三、常见问题
如何手动修改登陆的用户名及密码?
您可以直接编辑/etc/phlinux.conf文件,对登陆用户名及密码进行修改。
花生壳日志保存路径
/var/log/phddns.log
为什么花生壳无法登陆?
花生壳使用的通信端口是TCP:6060和UDP:6060(方向:OUT),请确认防火墙没有把这几个通信端口封掉。
如何查看花生壳当前运行状态?
查看日志:
[root@localhost ~]# tail /var/log/phddns.log
2011/08/02 11:28:58.256| ExecuteUpdate OK, BeginKeepAlive!
2011/08/02 11:29:59.354| SendKeepAlive() 8208
2011/08/02 11:30:00.355| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:30:00.356| Keepalive response received, client ip: 116.231.123.96
2011/08/02 11:31:00.447| SendKeepAlive() 8208
2011/08/02 11:31:01.450| RecvKeepaliveResponse() Data comes, OPCODE:8272
2011/08/02 11:31:01.450| Keepalive response received, client ip: 116.231.123.96
如何在其他平台(非X86)编译运行?
交叉编译mips cpu版本方法:
1、安装交叉工具并配置环境
........
2、配置参数
./configure --host=i386-linux --target=mipsel-linux --build=mipsel-linux CXX=mipsel-linux-gcc CC=mipsel-linux-gcc LD=mipsel-linux-ld
3、make
4、最后静态链接下
mipsel-linux-gcc -g -O2 -o phlinux -s main.o phupdate.o PHGlobal.o PHSocket.o md5.o log.o generate.o coder.o blowfish.o bitstream.o base64.o ConvertUTF.o CCmdParser.o PhClient.o PhUpdater.o /opt/openwrt/mipsel-linux/lib/librt.a /opt/openwrt/mipsel-linux/lib/libstdc++.a //opt/openwrt/mipsel-linux/lib/libc.a
5、压缩下(好放到路由器的小空间)
upx -o phlinux2 phlinux
以上引用结束
八:修改web管理页的端口
    为规避电信对80号端口的封锁,默认的管理页面端口被设为8080,不得不输入全格式的http://地址:端口 进行访问,有的环境没有封锁还是改为80口直接域名访问方便多了。改/etc/apache2/httpd.conf 文件的监听口和虚拟主机选项,看看apache的配置资料就好。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多