UBUNTU下架设及使用GAPPProxy

作者:令狐葱   来源:令狐葱@关注互联网

一、服务器的架设


1. 必须要有个Google帐号并申请了Google app engine,地址为http://appengine.google.com/(注:申请要手机号的)
2. 下载并安装Python,可以使用新立得。
3. 下载并解压安装Google App Engine 的开发包,地址为http://code.google.com/appengine/downloads.html(我安装在/home/dennis/google_appengine)。
4. 去http://code.google.com/p/gappproxy/ 中下载fetchserver-1.0.0beta-fix.tar.gz这个文件,并解压到Google App Engine SDK安装目录里(即/home/dennis/google_appengine)。
5. 把fetchserver中的app.yaml用编辑器打开,修改内容如下:
第一行的部分填你的application帐号,比如你的AppEngine地址是aaa.appspot.com,那就是application帐号就是aaa
6. 终端运行下面的命令,上传文件。输入:appcfg.py update fetchserver
然后它会提示你输入google帐户和密码
dennis@dennis-laptop:~$ cd google_appengine/
dennis@dennis-laptop:~/google_appengine$ python appcfg.py update fetchserver
appcfg.py:41: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  os.path.join(DIR_PATH, 'lib', 'antlr3'),
Scanning files on local disk.
Initiating update.
Email: jiguofei@gmail.com
Password for jiguofei@gmail.com:
Cloning 3 application files.
Deploying new version.
Checking if new version is ready to serve.
Will check again in 1 seconds.
Checking if new version is ready to serve.
Will check again in 2 seconds.
Checking if new version is ready to serve.
Closing update: new version is ready to start serving.
即说明已经成功了。

二、本地设置

1. 下载网址上的完整源码包,把里面的localproxy解压出来放在任意文件夹内,比如localproxy
2. 用文本编辑器编辑文件夹中的proxy.conf,里面有三行fetch_server = …….的,随便改一行为http://abcde.appspot.com/fetch.py并且去年本行前面的#就可以保存了。
3. 用cd命令进入localproxy然后运行python proxy.py即可,如果看到以下四行,说明成功:
dennis@dennis-laptop:~/gappproxy-1.0.0beta/localproxy$ proxy.py
--------------------------------------------
HTTP Enabled : YES
HTTPS Enabled: YES
Direct Fetch : YES
Local Proxy  :
Fetch Server : http://linghucong.appspot.com/fetch.py
--------------------------------------------
4. 设置浏览器的本地代理,就是把代理IP设置成为127.0.0.1,端口设为8000。当然也可以使用autoproxy。
5. 如果图方便可以在桌面建立一个launcher,Type类型选application in terminal,命令Command写上python /file_folder/localproxy/proxy.py。(其中file_folder是localproxy目录的路径)

没有评论: