好久好久以前,原本的服务器下线维护,用家里闲置的机器临时顶上一段时间。后来就一直拖着,最后整整拖了四个月,直到几天前才有空把服务器弄好,现在所有网站已经运行在原来的服务器上,家里所有设备全面实现了无线化,少了那么多m88体育网线碍眼,屋子里看着也舒服多了。

服务器原本是一台小Net-top,机身很小巧,没什么扩展性。好在无线网卡是m-pcie接口,才让我也能折腾一回。

打开机箱,里面乱七八糟:

我这人对使用的所有电脑系统都有洁癖,不能容忍莫名其妙的自动任务。前两天迁移服务器,遇到一个小问题,就属于这类。

装完系统,配置好web服务和awstats统计工具以后,系统经常提示收到内部邮件。用mail命令打开,发现是awstats自动更新时发出的。这个就很诡异,我还没建立cron条目来更新统计信息呢,而且貌似这个默认的更新间隔只有10分钟,对于m88体育网站那一点点微不足道的流量来说,这个间隔无疑是太短了。可是通过crontab命令查询,发现不管是我自己的账户还是root,都没有定义任何cron任务,于是google了一下,找到答案。

原来,在awstats安装时,默认在/etc/cron.d目录下生成了一个名为awstats的文件,其内容是:

原来的服务器需要下线做性能维护,所以用家里的旧配件拼出一台机器,暂时顶上几天。其实这套老配置的性能比原来的服务器还强很多:

处理器:Core2 Duo e8400
内存:4G DDR2
显卡:ATI HD4670

之所以不继续用这套配置,是耗电太多的原因。这台机器功耗100瓦左右,所以全年电费大概就是100欧元,是原来atom系统的三倍以上。所以还是把原来的m88体育系统更新优化一下,让它继续发挥余热比较划算。

为了在新机器上把所有网站都搭起来,前后花了好几天的功夫。

第一步是装系统。这个很简单,usb安装debian wheezy,十几分钟的事情。

ipv6是个听上去很牛,实际上却没啥用的玩意,每次装完系统都要把它禁掉。Ubuntu下面禁用ipv6很简单,在/etc/sysctl.conf里加上几行:

#Disable IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

启用新的配置:

sudo sysctl -p

Apparently, it's not installed by default with jdk. In fact, there is a link to the zip but the file itself isn't downloaded. So, simple solution:

sudo apt-get install openjdk-6-source

I wrote a utility script to do some automatic moving and copying stuff, put it in a directory, exported the dir in $PATH with bashrc and it worked well with my normal user. But when I tried to sudo the script, it couldn't be found. Copy bashrc for root didn't work better. Finally google helped me out: it's the secure_path stuff on my way.

In fact, when we sudo a command, the system makes a env_reset first. So all our settings in bashrc are lost, including customized $PATH. So the solution is to modify /etc/sudoers, either we completely disable the secure_path reset:

第1页 共3页