一個(gè)更省資源的掛機(jī)方案!
所以選擇了debian,以下步驟僅僅適用于debian 6 32bits系統(tǒng)!
64位的和其他系統(tǒng)自己根據(jù)實(shí)際情況修改!
提醒一點(diǎn),因?yàn)槭蔷幾g安裝,編譯過程會(huì)比較慢,這個(gè)跟VPS的性能有關(guān),時(shí)間最長(zhǎng)的我經(jīng)歷過4個(gè)小時(shí)以上!所以建議以下所有的過程都在screen里面執(zhí)行!
1.安裝相關(guān)依賴
最先apt-get update apt-get upgradeapt-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#這個(gè)版本不好 會(huì)總是崩潰 補(bǔ)充一個(gè)版本
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.啟動(dòng)VNC并設(shè)置vncserver
vi ~/.vnc/xstartup
把以下兩行內(nèi)容添加到末尾
startjwm &
firefox --display=:1
添加權(quán)限chmod +x ~/.vnc/xstartup
5.設(shè)置VNC開機(jī)啟動(dòng)
vi /etc/init.d/vncserver
將以下內(nèi)容填入
### 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
添加權(quán)限
chmod +x /etc/init.d/vncserver
使配置生效
update-rc.d vncserver defaults #debian5可以
但是6的方式不同 6會(huì)報(bào)錯(cuò)update-rc.d: using dependency based boot sequencing
#debian6的方式
先安裝 aptitude install insserv
insserv vncserver
6.添加計(jì)劃任務(wù),定時(shí)重啟vnc或者系統(tǒng),以防止firefox假死不出分
crontab -e
#每隔一小時(shí)重新啟動(dòng)vncserver
* */1 * * * /etc/init.d/cron restart
配置完后重啟 /etc/init.d/cron restart 即可生效
規(guī)則就不多說,根據(jù)自己的實(shí)際情況編寫。
規(guī)則編寫可參考以下兩篇文章
http://www.linuxde.net/2011/12/3758.html
http://hi.baidu.com/aboc/blog/item/3d469358b9f468cd9d82047d.html
7.重啟,安裝插件進(jìn)行相關(guān)設(shè)置即可!
reboot
相關(guān)設(shè)置,請(qǐng)參考
http://sunsea.im/linux-vps-vagex-automatic-money.html
本文參考:http://www.autoinstallscript.com/有修改
不斷折騰,又發(fā)現(xiàn)一種方式:
備註:推薦環(huán)境 Debian 6.0 x64
1 更新庫(kù)apt-get update
2 安裝vncserver與相關(guān)組件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并解壓到火狐補(bǔ)丁目錄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 啟動(dòng)vncserver并設(shè)定密碼vncserver
6 添加啟動(dòng)配置vi ~/.vnc/xstartup
按a編輯,并將以下文字添加到最尾端startjwm &
Ctrl+C退出編輯,并輸入:wq保存退出
7 打開VNCViewer,輸入你的IP:1并輸入密碼登陸
8 在VNC里的命令行輸入./firefox/firefox啟動(dòng)火狐
9 在網(wǎng)址欄輸入about:config,然后進(jìn)入修改firefox配置頁(yè)面
10 搜索dom.ipc.plugin字段,第一項(xiàng)改為False
11 安裝Vagex擴(kuò)展
12 開始你的Vagex掛機(jī)網(wǎng)賺之旅
又找到2方案