Dreams of Thought

Are dreams thoughts… or are thoughts dreams..

RSS Feed

Monthly Archives: August 2012

Installing Jetty on CentOS


Step 1 : Enable the jpackage repo Download the jpackage.repo file to your /etc/yum.repos.d/ directory.
# cd /etc/yum.repos.d/
# wget http://jpackage.org/jpackage50.repo

Step 2 : Install the jetty package you want
# yum search jetty
will show you a list of jetty packages you want to install. At the time of writing you get 2 options - jetty 5 and jetty 6. We installed jetty 6.
# yum install jetty6

Filed under Linux
Aug 29, 2012

Django 1.4 on CentOS 5.8


The default python version (2.4.3) on Centos 5.8 is not supported for Django 1.4 . Here's how to get Django 1.4 running on Centos 5.8 . Steps here are probably useful for future/different versions.

Step 1 : Enable EPEL

EPEL has newer version of Python available in it's repo. The first step is to enable it. The command you need to enable the EPEL repo is :
# rpm -ivh http://mirror.chpc.utah.edu/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
Once you install the package you've enabled EPEL.

Step 2 : Install Python 2.6 and easy_install

#yum install python26-distribute
This will install python 2.6 and easy_install

Step 3 : Install pip

#easy_install-2.6 pip
Now that you've pip installed, we can get started on install virtualenv and virtualenvwrapper.

Step 4 : virtualenv and virtualenvwrapper

#pip install virtualenvwrapper
will install virtualenvwrapper and virtualenv. Now you need to add some lines to your .bashrc
export WORKON_HOME=~/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python26
source /usr/bin/virtualenvwrapper.sh

(Make sure to create the ~/.virtualenvs directory if it isn't already created.)
Now activate the changes to your bashrc by doing
#source ~/.bashrc

Step 5 : Create a virtual environment for your Django project

You can do this by running
# mkvirtualenv my-env
Once you run this you will automatically switch to the new virtualenv. Your shell prompt will be prefixed with (my-venv)

Step 6 : Install Django

Change to the directory you want to install Django in. Then run :
(my-venv)#pip install Django


1. Installing MySQL-python :

First install
#yum install mysql-devel
and then install MySQL-python (my-venv)#pip install MySQL-python

2. Installing Gunicorn

(my-venv)#pip install gunicorn

3. requirements.txt

It's often easier to just have a list of pip packages to install for a particular project in a file. Conventionally, it's named requirements.txt
(my-venv)#pip install -r requirements.txt
will install all the packages given in the requirements.txt
(my-venv)#pip freeze
Will show you a list of packages installed by pip currently. Something like this :

You can take this list directly and put it into the requirements.txt
(my-env)# pip freeze > requirements.txt

Filed under django, Linux
Aug 24, 2012