Setup Development Box - nmercer/rbotit GitHub Wiki

Setup Development Box:

This Guide Covers:

  • Setting up Apache to serve only django/python files.
  • Setting up Nginx to serve static files and run on port 80.
  • Setting up a complete development environment for rbotit.

Complete Production Guide Coming Soon!

Step Zero:

Requirements:

  • Ubuntu 12.04 LTS

Step One:

Update Ubuntu and install some basic libs:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential python-dev python-pip git-core 

Step Two:

Install my espeak_py module that converts text to MP3's:

sudo apt-get install espeak
sudo apt-get install lame
cd ~
mkdir git
cd git
git clone https://github.com/nmercer/espeak_py.git
cd espeak_py
sudo python setup.py install

Step Three:

Install MySQL. When prompted enter password for root. I use PASSWORD for the sake of this tutorial.

sudo apt-get install mysql-server
sudo apt-get install libmysqlclient-dev
sudo pip install MySQL-python

Step Four:

Install and setup rbotit:

sudo pip install Django
cd ~/git/
git clone https://github.com/nmercer/rbotit.git
cd rbotit
vim rbotit/settings.py

Insert THIS code into settings.py, make sure to change instances of USERNAME to your username. Save and close that file when complete. You can use whatever editor you prefer.

cd ~/git/rbotit/
python manage.py sql home
python manage.py syncdb
mkdir static
python manage.py collectstatic
mkdir static/sound/
chmod 777 static/sound/

Step Five:

Install and setup Apache:

sudo apt-get install apache2 apache2-threaded-dev libapache2-mod-wsgi
cd /etc/apache2/
sudo vim apache2.conf

Insert THIS into apache2.conf. Save and quit.

sudo vim httpd.conf

Insert THIS into httpd.conf. Change USERNAME to your username. Save and quit.

sudo /etc/init.d/apache2 restart

Step Six:

Install and setup nginx:

sudo apt-get install nginx
cd /etc/nginx/
sudo vim sites-available/default

Insert THIS into your default nginx site. Change USERNAME to username. Save and quit.

sudo vim proxy.conf

Insert THIS into proxy.conf. Save and quit.

sudo /etc/init.d/nginx restart

Step Seven:

Hopefully everything worked! Point to your development box ip or if running locally go to http://localhost/ Don't forget to develop and contribute cool new features!