Debian最小资源

Posted on 2013-08-20 22:56 H2O 阅读(253) 评论(0)  编辑  收藏

一个更省资源的挂机方案!
所以选择了debian,以下步骤仅仅适用于debian 6 32bits系统!
64位的和其他系统自己根据实际情况修改!
提醒一点,因为是编译安装,编译过程会比较慢,这个跟VPS的性能有关,时间最长的我经历过4个小时以上!所以建议以下所有的过程都在screen里面执行!

1.安装相关依赖
最先apt-get update apt-get upgrade
apt-get -q -y --force-yes install vnc4server xterm jwm mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm bzip2 libidl-dev zip

2.下载firefox 3.6.28的源码包,解压并编译安装。
wget http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6/source/firefox-3.6.source.tar.bz2#这个版本不好 会总是崩溃 补充一个版本
http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6.28/linux-i686/zh-CN/firefox-3.6.28.tar.bz2

bzip2 -d firefox-3.6.28.source.tar.bz2
tar -xvf firefox-3.6.28.source.tar
cd mozilla-*
./configure --enable-application=browser && make && make install

3.下载flash插件并安装
wget http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.297/install_flash_player_11_linux.i386.tar.gz

tar xvzf install_flash_player_10_linux.tar.gz
mkdir -p ~/.mozilla/plugins/
cp libflashplayer.so ~/.mozilla/plugins/

4.启动VNC并设置
vncserver
vi ~/.vnc/xstartup

把以下两行内容添加到末尾

startjwm &
firefox --display=:1

添加权限
chmod +x ~/.vnc/xstartup

5.设置VNC开机启动

vi /etc/init.d/vncserver

将以下内容填入

### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
PATH="$PATH:/usr/X11R6/bin/"
# The Username:Group that will run VNC
export USER="root"
#${RUNAS}
# The display that VNC will use
DISPLAY="1"
# Color depth (between 8 and 32)
DEPTH="16"
# The Desktop geometry to use.
#GEOMETRY="x"
GEOMETRY="800x600"
#You Can Choice GEOMETRY="1024x768" && GEOMETRY="1280x1024"
# The name that the VNC Desktop will have.
NAME="Vncserver"
OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
. /lib/lsb/init-functions
case "$1" in
start)
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
esac
exit 0

添加权限

chmod +x /etc/init.d/vncserver

使配置生效

update-rc.d vncserver defaults  #debian5可以
但是6的方式不同 6会报错update-rc.d: using dependency based boot sequencing
#debian6的方式 
先安装 aptitude install insserv
insserv vncserver


6.添加计划任务,定时重启vnc或者系统,以防止firefox假死不出分

crontab -e
#每隔一小时重新启动vncserver
* */1 * * * /etc/init.d/cron restart

配置完后重启 /etc/init.d/cron restart 即可生效

规则就不多说,根据自己的实际情况编写。

规则编写可参考以下两篇文章

http://www.linuxde.net/2011/12/3758.html

http://hi.baidu.com/aboc/blog/item/3d469358b9f468cd9d82047d.html

7.重启,安装插件进行相关设置即可!

reboot

相关设置,请参考
http://sunsea.im/linux-vps-vagex-automatic-money.html

本文参考:http://www.autoinstallscript.com/有修改


不断折腾,又发现一种方式:
備註:推薦環境 Debian 6.0 x64
1 更新库
apt-get update
2 安装vncserver与相关组件
apt-get -q -y --force-yes install vnc4server xterm jwm mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm bzip2 libidl-dev zip ia32-libs-gtk
3 下载火狐并解压 wget http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/14.0.1/linux-i686/en-US/firefox-14.0.1.tar.bz2
tar jxvf firefox-14.0.1.tar.bz2

4 下载Flash并解压到火狐补丁目录
wget http://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.251/install_flash_player_11_linux_i386.tar.gz
tar zxvf install_flash_player_11_linux_i386.tar.gz
mkdir -p ~/.mozilla/plugins/
cp libflashplayer.so ~/.mozilla/plugins/

5 启动vncserver并设定密码
vncserver
6 添加启动配置
vi ~/.vnc/xstartup
按a编辑,并将以下文字添加到最尾端
startjwm &
Ctrl+C退出编辑,并输入:wq保存退出
7 打开VNCViewer,输入你的IP:1并输入密码登陆
8 在VNC里的命令行输入./firefox/firefox启动火狐
9 在网址栏输入about:config,然后进入修改firefox配置页面
10 搜索dom.ipc.plugin字段,第一项改为False
11 安装Vagex扩展
12 开始你的Vagex挂机网赚之旅

又找到2方案

http://code.google.com/p/vagex-debian/
http://code.google.com/p/cnvagex/

 


只有注册用户登录后才能发表评论。


网站导航:
 

posts - 0, comments - 21, trackbacks - 0, articles - 101

Copyright © H2O