[前提] 本机已安装Android SDK和nodejs 未安装Android SDK和nodejs,分别参考下文:
1.《[ubuntu server 16.04下的安装脚本] 7.一键安装 android sdk》
2.《[ubuntu server 16.04下的安装脚本] 9.一键安装 nodejs》
1.Ubuntu16.04一键安装STF脚本:
#!/bin/bash
#sudo npm install -g node-gyp
#安装RethinkBD
#source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | tee /etc/apt/sources.list.d/rethinkdb.list | wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y rethinkdb
sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf
sudo service rethinkdb stop
#安装graphicsmagick
sudo apt-get install -y graphicsmagick
sudo apt-get install -y libzmq3-dev
sudo apt-get install -y libprotobuf-dev
#------------------------------------------------------------------------
#安装protobuf-all
#wget https://github.com/google/protobuf/releases/download/v3.5.1/protobuf-all-3.5.1.tar.gz
wget https://coding.net/u/jamesz2011/p/STF-install/git/raw/master/protobuf-all-3.5.1.tar.gz
tar -zxvf protobuf-all-3.5.1.tar.gz
cd protobuf-3.5.1/
./configure --prefix=/usr/local/protobuf-3.5.1
make
sudo make install
sudo ln -s /usr/local/protobuf-3.5.1/bin/protoc /usr/local/bin/protoc
protoc --version
#set environment
#export PATH=$PATH:/usr/local/protobuf-3.5.1/bin/
#export PKG_CONFIG_PATH=/usr/local/protobuf-3.5.1/lib/pkgconfig/
export PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/"
if ! grep PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/" /etc/profile
then
echo PKG_CONFIG_PATH="/usr/local/protobuf-3.5.1/lib/pkgconfig/" | sudo tee -a /etc/profile
echo "export PKG_CONFIG_PATH" | sudo tee -a /etc/profile
echo "PATH=$PATH:/usr/local/protobuf-3.5.1/bin/" | sudo tee -a /etc/profile
echo "export PATH" | sudo tee -a /etc/profile
fi
source /etc/profile
#安装yasm
sudo apt-get install -y yasm
#安装pkg-config
sudo apt-get install -y pkg-config
#安装g++
sudo apt-get install -y g++
#安装node-gyp
sudo npm install -g node-gyp --unsafe-perm
#安装zmq
sudo npm install -g zmq --unsafe-perm
#安装jpeg-turbo
sudo npm install -g jpeg-turbo --unsafe-perm
#安装stf
sudo npm install -g stf --unsafe-perm
sudo ln -s /opt/node-v8.9.3-linux-x64/bin/stf /usr/local/bin/stf
[PS] install_stf_stable.sh脚本地址
2..启动STF的方法:
2.1 使用命令启动:
service rethinkdb stop
rethinkdb --bind all --cache-size 8192 --http-port 8075
stf local --public-ip 192.168.1.13 --allow-remote
2.2 一键启动STF脚本【linux后台启动】:
#! /bin/bash
#[Note]使用本shell脚本的前提:关闭rethinkdb的开机自启动
#关闭rethinkdb的开机自启动 >> # sudo sysv-rc-conf
#this shell is used for start STF
echo "--------# this shell is used for start STF #-------------"
echo "--------# step1: service rethinkdb stop#-------------"
service rethinkdb stop
echo "--------# step2: rethinkdb允许所有ip访问,并设置port为8075 #-------------"
#rethinkdb --bind all --cache-size 8192 --http-port 8075
rethinkdb --bind all --http-port 8075 &
echo "--------# step3: 允许远程访问STF #-------------"
stf local --public-ip 192.168.1.13 --allow-remote &
echo "--------# 启动成功 #-------------"