前期需要准备 内存512M以上vps主机,需要注册alexamster (没有注册的可以先看这篇文章注册alexamaster利用电脑挂机赚美金)
这里我用的是linux主机 centeros 6,所以需要先安装桌面系统
服务端器命令行设置
首先安装桌面
yum groupinstall “X Window System” “Desktop” -y
完成后安装vnc
yum install tigervnc-server tigervnc -y
修改vnc设置(后面添加)
vi /etc/sysconfig/vncservers
VNCSERVERS="1:root" VNCSERVERARGS[1]="-geometry 1366x768 -alwaysshared -depth 24"
设置vnc密码
vncpasswd
初始化vnc
vncserver
修改配置文件(全部替换)
vi /root/.vnc/xstartup
#!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid gre vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-session & #set starting GNOME desktop #startkde & #kde desktop #twm & #Text interface #/usr/bin/startxfce4 #exec /usr/bin/fluxbox
重启vnc
/etc/init.d/vncserver restart
设置防火墙,添加一条语句允许vnc端口
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 5901 -j ACCEPT
重启iptables使设置生效
/etc/init.d/iptables restart
设置vnc开机启动
chkconfig vncserver on
下面防止进入vnc黑屏现象
chmod 777 /root/.vnc/xstartup
本机vnc连接
以上服务器就配置完成了,本地下载一个vnc viewer
下载地址:https://www.realvnc.com/download/viewer/
选择file -> new connection , 在 vnc server 一栏中填写你的服务器地址 :5901(比如 12.13.158.58:5901 这样) ,然后输入密码就能连接了
以上服务器就配置完成了,本地下载一个vnc viewer
设置系统和firefox开始挂机
安装firefox
进入图形界面后,首先在linux系统安装firefox
选择 Applications -> System Tools -> Terminal
输入 yum install firefox -y
设置挂机页面
选择火狐的Preferences进入设置界面,选择General , Home Page栏填写你的挂机链接
设置允许弹出窗口
选择Content ,把 Block pop-up windows 前边的勾选去掉
设置不保存历史记录
选择Privacy, Firefox will 下拉框选择 Never remember history ,这里会提示重启,选择ok就可以
重启后会看到已经开始挂机了,但是这样还不行,为了防止任务意外停止,还需要设置linux系统定时重启后自动开启火狐
设置firefox开机启动
选择System -> Preferences -> Startup Applications
点击add ,在command 栏输入 /usr/bin/firefox ,其他地方随便填
最后我们设置linux自动重启
打开终端
vi /var/spool/cron/root
00 00 * * * reboot 00 01 * * * reboot 00 02 * * * reboot 00 03 * * * reboot 00 04 * * * reboot 00 05 * * * reboot 00 06 * * * reboot 00 07 * * * reboot 00 08 * * * reboot 00 09 * * * reboot 00 10 * * * reboot 00 11 * * * reboot 00 12 * * * reboot 00 13 * * * reboot 00 14 * * * reboot 00 15 * * * reboot 00 16 * * * reboot 00 17 * * * reboot 00 18 * * * reboot 00 19 * * * reboot 00 20 * * * reboot 00 21 * * * reboot 00 22 * * * reboot 00 23 * * * reboot
这里设置的是每隔一个小时系统自动重启一次,每次重启会自动开启挂机,然后就看着积分自己增长了