用Google Cloud Platform搭建***服务教程
之前FQ一直用的是***,天有不测风云,前几天发现ss服务挂了。更可怕的是ping都ping不通,多方打听,***中文社区已经炸开锅了,原因就是IP被封了。需要付费更换IP。然后到现在还是没有给我更换IP,于是就有了这篇随笔。记录自己用Google Cloud Platform搭建***服务教程的辛酸泪。
1.申请试用Google Cloud。登陆你的谷歌账户,必须使用信用卡,而且不能使用虚拟卡,招商银行、中信银行的全币种卡、浦发银行的 VISA 卡均可以通过验证。理论上 VISA 卡均可获得通过,成功后会于扣款1刀,验证卡片后会返还。GCD 现在免费赠送300刀期限是一年,也就是300刀和一年时间谁先用完就以谁为准,结束之后你不点继续使用时不会扣费的。地址:https://cloud.google.com
2.登录控制台。依次在菜单栏中点击【网络】【外部ip地址】【保留静态IP】点击右侧更改可以关联创建的实例VM对象。


3.修改防火墙,依次点击【网络】【防火墙规则】【创建防火墙规则】


3.创建计算机引擎VM实例。配置如图下。



4.搭建shadowsocks server 及自启动。使用谷歌云自带的ssh工具。

登录远端之后首先更新一下 apt-get 软件包
sudo apt-get update
然后通过 apt-get 安装 python-pip
sudo apt-get install python-pip
完成之后使用 pip 安装 shadowsocks 服务
sudo pip install shadowsocks

说明安装成功
然后我们需要创建一个 shadowsocks server 的配置文件,可以直接建在当前用户目录下
sudo vim /etc/ss-conf.json
回车之后会进入这个创建的文件,按键盘上的 insert键会进入编辑,然后把下面的内容输入进去。按ESC键会发现左下角的insert消失,shift+:这个组合键左下角出现:输入wq回车就保存退出文件。红色字体分边是端口和密码,设置成你想要的就行了
server_port 与防火墙中的端口保持一致。

{"server":"0.0.0.0","server_port":8888,"local_address":"127.0.0.1","local_port":1080,"password":"xxxxxx","timeout":600,"method":"aes-256-cfb"}
7.31日更新:上面的内容有网友反映直接复制会报错,请注意以下两点:1代码的全部内容必须为英文半角输入,2server_port与password后面的数字内容请自定义,也就是你之后在shadowsocks客户端上配置使用的端口和密码。
最后用这个配置文件启动 shadowsocks 服务
sudo ssserver -c /etc/ss-conf.json -d start
ss服务自启动实现
这一点让我尝试了很久,搜了很多教程说什么在系统的rc.local里面添加启动命令就行等等,试过很多次,各种折腾改路径都不行,最后还是参考别人步骤如下。
创建脚本 /etc/init.d/shadowsocks
sudo vim /etc/init.d/shadowsocks
进入文件后添加以下内容,方法与前面创建ss-conf.json这个文件一样,使用insert键、shif+:、wq回车保存等等
#!/bin/sh
start(){
ssserver -c /etc/shadowsocks.json -d start
}
stop(){
ssserver -c /etc/shadowsocks.json -d stop
}
case “$1” in
start)
start
;;
stop)
stop
;;
reload)
stop
start
;;
*)
echo “Usage: $0 {start|reload|stop}”
exit 1
;;
esac
然后增加这个文件的可执行权限
sudo chmod +x /etc/init.d/shadowsocks
创建文件 /etc/init/shadowsocks.conf
sudo vim /etc/init/shadowsocks.conf
内容直接复制如下
start on (runlevel [2345])stop on (runlevel [016])pre-start script
/etc/init.d/shadowsocks start
end scriptpost-stop script
/etc/init.d/shadowsocks stop
end script
执行
sudo update-rc.d shadowsocks defaults
然后就添加到开机启动中了
5.有了ss配置文件,就可以愉快的上google了。ps:ss配置文件的server填VM实例的外部IP而不是0.0.0.0。

用Google Cloud Platform搭建***服务教程的更多相关文章
- 使用Google Cloud Platform构建机器学习项目-宠物识别
宠物识别我们使用到了tensorflow object-detection API (https://github.com/tensorflow/models/tree/master/researc ...
- 使用Gardener在Google Cloud Platform上创建Kubernetes集群
Gardener是一个开源项目,github地址: https://github.com/gardener/gardener/ 使用Gardener,我们可以在几分钟之内在GCP, AWS, Azur ...
- 如何取消 Google Cloud Platform 试用 & 关闭 GCP 帐号 & 删除信用卡 & 取消订阅
如何取消 Google Cloud Platform 试用 & 关闭 GCP 帐号 & 删除信用卡 & 取消订阅 关闭您的 Google Cloud Platform 帐号 s ...
- Google Cloud Platform 续
Google Cloud Platform 创建新实例 地区:australia-southeast1-a 机器类型:1个vCPU n1-standard-1 系统:Ubuntu 16.04 LTS ...
- 对Google cloud platform 做了点研究
Google也推出了云计算基础服务, 加上微软Azure,亚马逊AWS, 都齐活了. 下面是研究了一下对其的一个初步了解. 计算: Compute Engine IaaS平台,提供VM,操作灵 ...
- Google Cloud Platform
一个离我们很遥远,很遥远的公司.作为全球三大公有云厂商之一,在国内根本听不到他的声音.其实吧,听到了也没用,因为在国内没法用!AWS还在纠结的落地过程中挣扎,GCP基本上就当不存在吧. 抛开这些乌烟瘴 ...
- Google Cloud服务免费申请试用以及使用教程
简介 Google Cloud Platform lets you build and host applications and websites, store data, and analyze ...
- google cloud storage products
https://cloud.google.com/products/storage/ BigTable Cloud Bigtable 是 Google 面向大数据领域的 NoSQL 数据库服务.它也是 ...
- 基于Spring Cloud的微服务入门教程
(本教程的原地址发布在本人的简书上:http://www.jianshu.com/p/947d57d042e7,若各位看官有什么问题或不同看法请在这里或简书留言,谢谢!) 本人也是前段时间才开始接触S ...
随机推荐
- [luoguP1440] 求m区间内的最小值(单调队列 || 线段树)
传送门 这种水题没必要搞线段树了,单调队列就行啊. ——代码 #include <cstdio> ; , t = ; int a[MAXN], q[MAXN]; int main() { ...
- [K/3Cloud] 单据转换插件执行顺序
1.下推事件及顺序 //初始化变量 OnInitVariable(InitVariableEventArgs e) //解析字段映射关系,并构建查询参数.这里可以加入你想要的额外的字段 OnQuery ...
- POJ1422 Air Raid
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8006 Accepted: 4803 Description Consi ...
- python基础之-字符串
字符模块:strstr.strip():去掉字符串前后空格str.lstrip():去掉字符串左侧空格str.rstrip():去掉字符串右侧空格str.encode():将字符串编码为二进制str. ...
- 如何查看sqlalchemy执行的原始sql语句?
SQLAlchemy打开SQL语句方法如下,echo=true将开启该功能: engine = create_engine("<db_rul>", echo=True) ...
- [Algorithms] Determine if a string is a palindrome
A palindrome is a string that reads the same forward and backward, for example, radar, toot, and mad ...
- Spring_2_Spring中lazy-init和scope属性
1)springTest类: public class springTest { @Test public void instanceSpring() { AbstractApplicationCon ...
- mac终端配置Android ADB命令
不得不说mac是一款开发利器,不仅可以开发ios,而且对于Android开发也是不错的选择,下面我就对mac配置adb命令,进行简要的说明.下面我将一下mac环境下的配置步骤:1.在自己的目录(hom ...
- javascript下的json 序列化及反序列化
1.序列化 将json对象转为字符串: JSON.stringify(jsonObj) 2.反序列化 var jsonObj = eval("(" + jsonstring + & ...
- 【bzoj4604】The kth maximum number
暴力 #include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> ...