Make sure to set remotehost.prd in /etc/hosts file, otherwise you are going to be trying to connect to it and not getting the right server address.

You should also temporarily set up remotehost.com as well while you are waiting for the DNS file to be propagated through the system, just make sure to change it back to normal later!


Useful link:  https://help.ubuntu.com/community/AptGet/Howto#Commands

https://help.ubuntu.com/community/AddUsersHowto

This is a really great tutorial on setting up a django/gunicorn/nginx stack.  Very thorough
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/


sudo useradd riendas -m -s /bin/bash
sudo passwd riendas 

sudo addgroup webdev
sudo adduser riendas webdev 

-----------------------------------
SUDOERS - DO THIS SO YOU CAN PROPERLY EXECUTE PYTHON AS "sudo":

https://help.ubuntu.com/community/Sudoers#Editing_the_sudoers_file

edit the /home/user/.bashrc file with the following addition:

export EDITOR="vim"
sudo -E visudo
add the following in the file:


    Defaults env_keep += "PYTHONPATH"
    Defaults editor=/usr/bin/vim"
    riendas ALL=(ALL:ALL) ALL

---------------------------------------


https://help.ubuntu.com/lts/serverguide/mysql.html
sudo apt-get install mysql-server
sudo apt-get install libmysqlclient-dev

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-14-04
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-X.Y

https://help.ubuntu.com/community/Mercurial
sudo apt-get install mercurial meld


****READ THE NOTES ON NGINX INSTALLATION******
sometimes there is a problem with installing nginx, because ubuntu by default installs the nginx-core, and what you want is
nginx-extras (or nginx-full, didn't test).  If you don't use the proper nginx install, the module you need to work with django
will not be there.

https://www.digitalocean.com/community/articles/how-to-install-nginx-on-ubuntu-12-04-lts-precise-pangolin
sudo apt-get install nginx
sudo service nginx start

sudo apt-get install bind9
sudo apt-get install dnsutils


GO CHECK OUT readme_bind for the rest!!!!!!!



you'll need to create this directory, because the new bind install doesn't
mkdir /etc/bind/zones

https://nicolas.perriault.net/code/2012/gandi-standard-ssl-certificate-nginx/

https://help.ubuntu.com/community/FilePermissions
sudo mkdir /var/www
sudo chgrp webdev /var/www
sudo chmod -R 775 /var/www

NOTE: when installing python, you wnat the python-dev so you can compile the python-mysql code
sudo apt-get install python
sudo apt-get install python-dev
sudo apt-get install python-pip

sudo apt-get install supervisor

http://virtualenvwrapper.readthedocs.org/en/latest/
sudo pip install virtualenvwrapper

NOte: this is to get PIL working properly.  You must install these
apt-get install libjpeg-dev
apt-get install zlib1g-dev
apt-get install libpng12-dev


set up ssh so you can easily log in:
http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
http://www.thegeekstuff.com/2010/04/how-to-fix-offending-key-in-sshknown_hosts-file/

NOTE: ssh-copy-id is not always available.  Go here to get it: http://stackoverflow.com/questions/15185566/usr-bin-ssh-copy-id-line-1-ucgi-command-not-found

Here are the commands from that site:

sudo curl "hg.mindrot.org/openssh/raw-file/c746d1a70cfa/contrib/ssh-copy-id" -o /usr/bin/ssh-copy-id

sudo chmod +x /usr/bin/ssh-copy-id

****UPDATE****
ssh-copy-id is now a part of the openssh-client package.  So just install it:

sudo apt-get install openssh-client




in case you have to replace an off ssh key:

--on linux--
ssh-keygen -f "/home/ronny/.ssh/known_hosts" -R dosriendas.com

--on a mac--
ssh-keygen -f "/Users/ronny/.ssh/known_hosts" -R dosriendas.com


Set up bitbucket:
https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678

At this point you probably don't have an ssh key on the gandi server (I'm assuming a clean install here) so make sure you ssh-keygen

After you've done all that, and you've registered the new ssh key with bitbucket, find the "clone" option on the repository you want and pull it:

in the case of dosriendas you'll need these files:
hg clone ssh://hg@bitbucket.org/ronnyabraham/elpotrero
hg clone ssh://hg@bitbucket.org/ronnyabraham/django_initialize_project
hg clone ssh://hg@bitbucket.org/ronnyabraham/dosriendas.prj




NOTE: keep in mind that the *.sh files are BASH files.  DO NOT USE the "sh" command to execute them!  Use "bash"!!!
NOTE: e.g.   bash command.sh

bash bootstrap.sh
python publicdirectory.py
sudo python installconfs.py

mkdir /var/www/PROJECT.DOMAIN/logs/django

GEM_HOME=$ENVDIR  (check out gunicorn.sh)
sudo apt-get install ruby
sudo apt-get install rubygems

http://honza.ca/2011/06/install-ruby-gems-into-virtualenv

NOTE: they say I should install those commands in the postactivate script.  TRY TO SET IT UP

gem install sass
gem install compass
gem install zen-grids

NOTE: also install forward from forwardhq.com

gem install forward 

http://stackoverflow.com/questions/13257431/django-mediagenerator-cant-find-sass


you have to set the compass files up for django-mediagenerator
python importsassframeworks
