首先在Ubuntu desktop,安装easy_install-2.4

1.wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz 下载setuptools#md5=7df2a529a074f613b509fb44feefe74e 2. tar -xf setuptools-0.6c11.tar.gz 3. cd setuptools-0.6c11/ 4. sudo python2.6 setup.py install 这样easy_install-2.4就可以用了.
We are trying to enlist new users quickly, but this can create significant backlog. If you want to be part of the beta program as fast as possible, see I need a beta invite right now!.
With your invitation code in hand, go to http://www.dotcloud.com/ to signup and create your account.
Next you need to install the DotCloud CLI (command-line interface) on your local computer. The CLI will be used to interact with, and control the DotCloud service from your computer. Because DotCloud code relies on many features which are not present in older versions of Python, check first (running “python -V”) and confirm you have Python 2.6. DotCloud will probably work as well with Python 2.7 and above, but not yet with Python 3 (that’s ongoing work, however). If you have an older 2.X version, you should upgrade it (or install a newer Python alongside). If you have Python 3, make sure you also have Python 2.X until we make sure that the CLI is compatible with that.
You should then be able to install the CLI. Thanks to PyPI, this is as simple as:
$ sudo easy_install dotcloud
Searching for dotcloud
Reading http://pypi.python.org/simple/dotcloud/
Reading http://www.dotcloud.com
Best match: dotcloud 0.1.2
Downloading http://...
[some pages of easy_install doing its usual job]
Finished processing dependencies for dotcloud

$ dotcloud
Warning: /home/brite/.dotcloud/dotcloud.conf does not exist.  (这里的brite是我的ubuntu桌面下的默认用户)
(Enter your api key (You can find it at http://www.dotcloud.com/account/settings): ...


$ dotcloud create brite  (这里的brite是我随便取的一个名字,是application namespace的名字,它不一定要跟我的ubuntu桌面下的默认用户名相同)
Created "brite"
$ dotcloud deploy -t php brite.test (这里的test名称可以随便命名)
Created "brite.test"

访问http://test.brite.dotcloud.com/,shows me the phpinfo page which is installed by default on new PHP services.

运行:$ dotcloud info brite.test  会显示已运行的服务。


Pushing your code to the service(上传你的代码到服务器)You don’t edit your code directly on the server: you edit a local copy, and when you’re ready, you push it to the service. 
Let’s see that in action through a simple example.

Create a directory to hold our app:


$ mkdir myapp
$ cd myapp

Create a trivial hello.php file in this “myapp” directory:
<?php
echo "hello";
?>

Push the code to our service (remember to use your deployment and service names here): ~/myapp$ dotcloud push brite.test . (注意这行的后面要空格还要添加一个点) The push command will upload your code to the service, and perform some additional build steps. 然后访问http://test.brite.dotcloud.com/hello.php,你会看到浏览器显示hello. 登录ssh session: $ dotcloud ssh brite.test 登录ssh后, ~$ ls build.log  code  current  revisions  rsync-1307348837.25 (这里的current目录就是网站的根目录) ~$ cd current ~/current$ ls hello.php ~/current$ nano phpinfo.php 输入以下内容并保存之: <?php phpinfo(); ?> ~/current$ ls hello.php  phpinfo.php 然后访问http://test.brite.dotcloud.com/phpinfo.php,即可看到我空间的php信息。 Configure a database service Let’s see how we use a MySQL database. Deploy a MySQL service:
~/myapp$ dotcloud deploy -t mysql brite.db
Created "brite.db"

Use “dotcloud info” to retrieve its parameters:
~/myapp$ dotcloud info brite.db

会显示密码等信息:
db name为mysql
db user为root
db password为所显示的密码
db host为db.brite.dotcloud.com:6915

然后访问http://wordpress.org/latest.zip,下载wp blog app.在本地解压latest.zip,本地会出现一个wordpress目录。
把wordpress目录中的wp-config-sample.php重命名为wp-config.php 然后按照上面给你的信息填
define(‘DB_NAME’, ‘mysql’);
define(‘DB_USER’, ‘root’);
define(‘DB_PASSWORD’, ‘password_here’);
define(‘DB_HOST’, ‘db.brite.dotcloud.com:6915′);
db host的端口号按显示给你的填。 注意不要把给你的ssh那栏的端口号填进去, 填mysql那栏的.

然后打开终端,cd进去这个wordpress目录,
~/home/你的ubuntu的用户名/wordpress$ dotcloud push brite.test . (注意这行的后面要空格还要添加一个点.这一行就是上传命令。
上传的时候会覆盖以前上传的所有文件,我以前上传的文件http://test.brite.dotcloud.com/phpinfo.php和
http://test.brite.dotcloud.com/hello.php 均被覆盖,无法访问了。所以wp-config.php要在本地修改好,才上传wp程序。
可能上传会失败,请多试几次。
如果显示:
php-fpm stopped;
php-fpm started;
connection to test.brite.dotcloud.com closed.
 则表明上传成功。然后访问http://test.brite.dotcloud.com,就会显示wp的最后安装步骤。我已完成了这最后一步,我的wp blog: 
http://test.brite.dotcloud.com可以访问了。我用ssh登录空间:
$ dotcloud ssh brite.test
~$ cd current
~/current$
然后我在current目录下新建了hi.php和info.php文件,你可以访问它们:http://test.brite.dotcloud.com/hi.php和
http://test.brite.dotcloud.com/info.php

How do I use my own domain name with DotCloud?

Assuming you have setup your application on myapp.www, just do the following:
$ dotcloud alias add myapp.www www.my-own-domain.com
To use your domain name on another application, you have to remove it first:
$ dotcloud alias remove myapp.www www.my-own-domain.com
$ dotcloud alias dd myapp.new www.my-own-domain.com
You can use multiple domain names on the same application, and you can also bind a whole wildcard if you like:
$ dotcloud alias add myapp.www *.my-own-domain.com
Note that you will have to setup a DNS CNAME after that (the command will tell you which CNAME you need to update).
Note:
You cannot use a “naked domain” (i.e. an address without an host part, like my-own-domain.com). See why on our forum.

How can I use SSL with DotCloud?

If your application is setup to run on myapp.www, DotCloud can provide you with a SSL frontend on https://myapp.ssl.dotcloud.com/ free of charge, with a bona fide certificate. To bind your application to a SSL frontend, do the following:
$ dotcloud alias add myapp.www myapp.ssl.dotcloud.com
Note that you can use <something>.ssl.dotcloud.com only if your application is deployed on <something>.<whatever>. If you want to have SSL on your own domain name, you will have to go for one of our paying offers – since we will need to dedicate a load balancer instance to your application (since SSL requires at least one IP address per domain, or more accurately, per certificate).

How can I setup a crontab?

You can do it manually (using “dotcloud ssh” then “crontab”), or automatically through a postinstall script. For an example, see Scheduling automated backups of your database. (from http://docs.dotcloud.com/faq/)
from http://docs.dotcloud.com/tutorials/firststeps
  1. Install dotcloud sudo easy_install dotcloud
  2. Create your applicationname “brite” dotcloud create brite
  3. See the list of available services dotcloud deploy -h
  4. Deploy your service named “ramen.www” dotcloud deploy --type python ramen.www
  5. List your applications dotcloud list
  6. Push your code on the service “ramen.www” dotcloud push ramen.www ~/work/ramen/www
  7. Run a remote command dotcloud run ramen.www -- ls -l
  8. Open an ssh session dotcloud ssh brite.test
  9. Inspect the logs (Ctrl+C to stop) dotcloud logs brite.test
  10. Read the docs, starting with the detailed tutorial
--------------------------------------------------------------------- Q:如何申请Dotcloud? A:到官方申请 在页面上点jion our beta 然后输你的邮箱即可 Q:遇到问题 怎么联系官方 A:可以在twitter上问他们 https://twitter.com/dot_cloud 还可以试着发邮件http://www.dotcloud.com/contact Q:无法访问建立的程序 A:如果步骤有错的话 试着重来 dotcloud destroy yourapp Q:绑定域名要收费么 怎么绑定 A:免费 方法文中有 不过由于某墙 此方法不行 ping一下网址 A记录指向得到的IP 比如我绑定了www.rdyf.info 下面开始正文 表妹喜欢看电影 以前答应给她做个电影站 正巧今天收到DotCloud的邀请 顺手搭了个wordpress 讲下搭建过程吧 不明白的看他们wiki就好了 http://docs.dotcloud.com/static/tutorials/ 环境为ubuntu10.10 首先要生成SSH key 在终端下输 ssh-keygen 生成之后 cat .ssh/id_rsa.pub 查看 ssh-rsa… 那一长串儿就是SSH key了 在setting里填进去 然后add public key 添加ssh key完成后就可以部署了 首先安装dotcloud python版本要求最低2.6 一般都符合的 可以python -v查看 sudo apt-get install python-pip sudo pip install dotcloud 创建一个app (你可以输dotcloud查看还有哪些命令) dotcloud creat ihacku 接下来会要填你的api 在setting里 粘贴过去就行 wordpress需要php和mysql dotcloud deploy -t php ihacku.wordpress dotcloud deploy -t mysql ihacku.mysql 然后我们下载wordpress。 需要手动配置配置文件 要不然下次push的时候配置文件会被覆盖掉 先看下mysql信息 dotcloud info ihacku.mysql 会显示密码等 把wp-config-sample.php重命名为wp-config.php 然后按照上面给你的信息填 define(‘DB_NAME’, ‘mysql’); define(‘DB_USER’, ‘root’); define(‘DB_PASSWORD’, ‘password_here’); define(‘DB_HOST’, ‘mysql.ihacku.dotcloud.com:1480′); 端口号按显示给你的填 注意不要把给你的ssh那栏的端口号填进去 填mysql那栏的 curl https://api.wordpress.org/secret-key/1.1/salt/ 或者直接访问上面的地址也一样 把得到的信息替换配置文件里的对应部分 要使用永久链接的话 在wordpress目录底下新建个nginx.conf 输入以下代码 try_files $uri $uri/ /index.php; 接下来我们就可以部署了 这里有个覆盖的问题具体参见官方的做法: http://docs.dotcloud.com/static/tutorials/wordpress/#add- dotcloud-specific-files 我就不贴了 推荐看下 要不然文件没了可别怪我 dotcloud push ihacku.wordpress wordpress ok 搞定 wordpress.ihacku.dotcloud.com 这地址太长了 本来想自己绑定个域名来着 dotcloud alias add ihacku.wordpress ALIAS 然后叫你cname到gateway.dotcloud.com 杯具的发现丫的居然享受了ghs.google.com的待遇… dotcloud搭建在Amazon EC2上 与GAE相比的话就是支持广泛(你看首页的图标就知道了,可以随意搭配)可不只是简单的 搭个博客,你想怎么来就怎么来。 不过部署过程稍微复杂了点 用过heroku的同学应该顺手一点。跑wp感觉还算流畅 由于还处在beta阶段定价什么的还没确定。  我的账户显示的是free plan。 感兴趣的同学可以看faq了解更多 http://docs.dotcloud.com/static/faq/ 这里http://blog.maxiang.net/dotclound-documentation/还有更多有关dotcloud的资料.
演示地址: http://test.brite.dotcloud.com/