快速上传到rackspace cdn 工具安装,2步即可完成:
1.安装git
CentOS的yum源中没有git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘。
确保已安装了依赖的包
yum install curl
yum install curl-devel
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel
下载最新的git包
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-2011-11-30 #你的目录可能不是这个
autoconf
./configure
make
sudo make install
检查下安装的版本
git --version
相关链接:http://www.ccvita.com/370.html
2.安装工具
yum
install
-y python-devel python-setuptools git-core
cd
~
git clone https:
//github
.com
/cloudnull/turbolift
.git
cd
turbolift/
python setup.py
install
上面这一行我运行的时候遇到了2个错误,在报错处理里面可以解决!
turbolift 使用
turbolift -u $USER -a $API --os-auth-url https:
//identity
.api.rackspacecloud.com
/v2
.0 -r DFW upload -s
/var/www/vhosts/site
.com
/images
-c site_images
如果turbolift 无效,可以去/usr/local/你的python的文件夹/bin 下面看是否有turbolift 有的话,可以使用python turbolift -u $USER -a $API --os-auth-url https:
//identity
.api.rackspacecloud.com
/v2
.0 -r DFW upload -s
/var/www/vhosts/site
.com
/images
-c site_images
老外相关链接:
https://community.rackspace.com/products/f/25/t/911
https://github.com/cloudnull/turbolift/wiki/Install-Embed-Ubuntu
https://github.com/cloudnull/turbolift
哎,从中午到晚上了,终于看到成功的界面了!!无语!!
最后发现 https://community.rackspace.com/products/f/18/t/852 swift 这个使用起来更方便。
报错处理
1.python版本过低,python版本需要在2.5-3.0之间,升级教程如下:
查看系统当前python版本
2: [root@wangyuelou ~]# python
1:
3: Python 2.4.3 (#1, May 5 2011, 16:39:10)
4: [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
5: Type "help", "copyright", "credits" or "license" for more information.
6: >;>>
7: [root@wangyuelou ~]#
下载新版本的python
1: [root@wangyuelou ~]# wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
解压缩 以及编译
1: [root@wangyuelou ~]# tar xvf Python-2.7.2.tar.bz2
2: [root@wangyuelou Python-2.7.2]# ./configure --prefix=/usr/local/python27
3: [root@wangyuelou Python-2.7.2]# make
4: [root@wangyuelou Python-2.7.2]# make install
5: [root@wangyuelou Python-2.7.2]# ls /usr/local/python27/ -al
6: total 28
7: drwxr-xr-x 6 root root 4096 Jul 14 00:21 .
8: drwxr-xr-x 20 root root 4096 Jul 14 00:17 ..
9: drwxr-xr-x 2 root root 4096 Jul 14 00:21 bin
10: drwxr-xr-x 3 root root 4096 Jul 14 00:21 include
11: drwxr-xr-x 4 root root 4096 Jul 14 00:21 lib
12: drwxr-xr-x 3 root root 4096 Jul 14 00:21 share
覆盖原来的python链接
1: [root@wangyuelou Python-2.7.2]# mv /usr/bin/python /usr/bin/python_old
2: [root@wangyuelou Python-2.7.2]# ln -s /usr/local/python27/bin/python /usr/bin/
3: [root@wangyuelou Python-2.7.2]# python
4: Python 2.7.2 (default, Jul 14 2011, 00:20:14)
5: [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
6: Type "help", "copyright", "credits" or "license" for more information.
7: >>>
此处已经可以正常使用python2.7了
但是因为yum是使用的2.4的版本来用的,所以 还需要修改一下
1: [root@wangyuelou ~]# yum
2: There was a problem importing one of the Python modules
3: required to run yum. The error leading to this problem was:
4:
5: No module named yum
6:
7: Please install a package which provides this module, or
8: verify that the module is installed correctly.
9:
10: It's possible that the above module doesn't match the
11: current version of Python, which is:
12: 2.7.2 (default, Jul 14 2011, 00:20:14)
13: [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
14:
15: If you cannot solve this problem yourself, please go to
16: the yum faq at:
17: http://wiki.linux.duke.edu/YumFaq
18:
19:
20: [root@wangyuelou Python-2.7.2]# vim /usr/bin/yum
21:
22: #!/usr/bin/python #修改此处为2.4的位置
23: [root@wangyuelou ~]# vim /usr/bin/yum
24:
25: #!/usr/bin/python2.4
26: [root@wangyuelou ~]# yum
27: Loaded plugins: fastestmirror
28: You need to give some command
29: usage: yum [options] COMMAND
30:
31: List of Commands:
32:
33: check-update Check for available package updates
34: clean Remove cached data
35: deplist List a package's dependencies
36: downgrade downgrade a package
37: erase Remove a package or packages from your system
38: groupinfo Display details about a package group
39: groupinstall Install the packages in a group on your system
40: grouplist List available package groups
41: groupremove Remove the packages in a group from your system
42: help Display a helpful usage message
43: info Display details about a package or group of packages
44: install Install a package or packages on your system
45: list List a package or groups of packages
46: localinstall Install a local RPM
yum 又可以使用了
2. No module named setuptools,提示没有setuptools 这个模块,安装教程如下:
Linux下setuptools的安装过程。下载https://bitbucket.org/pypa/setuptools/get/default.tar.gz#egg=setuptools-dev,若此链接失效可以去他们官网去下载:https://pypi.python.org/pypi/setuptools#downloads,然后解压tar xzvf 包名,然后用到解压的文件下面,用命令进行安装python setup.py 安装一下,这样setuptools就安装好了!
终于好了,周末的一两个小时就这么过去了,实践的点点滴滴,希望能帮到大家!
---恢复内容结束---