How to run poweredsites in local

Here is the steps to run poweredsites project in a local ubuntu

Python2.6 ENV

Please run commands in this section to make sure all libs are ready:

# install git to sync tornado source code, and build tools etc
sudo apt-get install git-core gcc make build-essential

# python basic tools
sudo apt-get install python-setuptools python2.6-dev

# third party libs 
sudo apt-get install python-pycurl python-mysqldb

sudo easy_install -U pymongo markdown beautifulsoup
                webhelpers formencode routes decorator

# tornado
git clone git://
# And go to tornado folder run
sudo python install


  • Please refer to How to setup MySQL and How to setup MongoDB to setup MySQL and MongoDB

  • add database poweredsites and user:felinx password:felinx to mysql and mongodb,of course, you can use your username and password, then change the project configuration.

  • import the schema in the repository to your mysql (poweredsites/conf/schema.sql)

Modify local Hosts

Mapping some subdomains to local machine, you can add more for testing:

sudo nano /etc/hosts

# /etc/hosts


Proxy requests to localhost:8888(Apache or Nginx as your wish) Here is a Nginx exmaple, please refer to How to setup Nginx to setup nginx. The default port 80 will be conflict with apache2 if you already install apache2. If so, stop your apache2 or change apache2 listened port to another one.


Yes, I hardcode something :(, I will refine that later.

  • put a symbol link or copy poweredsites/poweredsites/poweredsites.conf to /mnt/ebs/conf/sites/poweredsites.conf

  • Sync project root to /mnt/ebs/sites/poweredsites, then the layout of those files will like below.


Run the app:

# setup mongodb index at the first time
python /mnt/ebs/sites/poweredsites/poweredsites/ --setup_db=1

# Run this one in normal, or run the upper one always.
python /mnt/ebs/sites/poweredsites/poweredsites/

# for short
cd /mnt/ebs/sites/poweredsites/poweredsites/

Then the app will be run at port 8888, type in your browser to play with it. Use CONTROL + C to Quit the app.

Well done, congratulations, Have fun!

Felinx Lee   August 14, 2010
Comments blog comments powered by Disqus