发现dreamhost上没办法直接跑twip,所以打起了birdnest的主意,虽然dh自带的python版本只有2.3.5,不过很容易就可以diy出birdnest需要的环境

- ssh连接上主机
- 安装python 2.6.2
mkdir opt
mkdir downloads
cd downloads
wget http://python.org/ftp/python/2.6.2/Python-2.6.2.tgz
tar xvzf Python-2.6.2.tgz
cd Python-2.6.2
./configure --prefix=$HOME/opt/ --enable-unicode=ucs4
make
make install - 修改.bash_profile加入export PATH=$HOME/opt/bin/:$PATH
- 验证python版本
source .bash_profile
python --version - 安装simplejson模块
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
sh setuptools-0.6c9-py2.6.egg
easy_install simplejson - checkout birdnest代码并试运行
svn checkout http://birdnest.googlecode.com/svn/branches/stable
python code.py 主机IP地址:端口号
尝试用支持自定义api proxy的twitter客户端连接,地址设为
http://IP地址:端口号/api
验证ok后ctrl+c结束 - detach进程
screen
python code.py 主机IP地址:端口号
ctrl+a ctrl+d
参见: 自建birdnest Twitter API proxy, Custom Python installation for Django on Dreamhost
0 comments:
Post a Comment