Install Django centos redhat

To install Django on Centos or Redhat

echo "Installing httpd and httpd-devel"
yum -q -y --enablerepo=ius install httpd httpd-devel > /dev/null 2>&1
chkconfig httpd on
sed -i 's/Listen 80/Listen 8080/g' /etc/httpd/conf/httpd.conf
service varnish start
service httpd start		

To Install Python 2.7.2 on redhat or centos
echo "Install Python 2.7.2"
mkdir -p /usr/local/src/python.2.7.2.install
cd /usr/local/src/python.2.7.2.install
wget "http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-linux-x86_64.tar.gz"
tar xzvf ActivePython-2.7.2.5-linux-x86_64.tar.gz
cd ActivePython-2.7.2.5-linux-x86_64
./install.sh -I /opt/ActivePython-2.7

echo "Install mod_wsgi"
wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
tar -zxvf mod_wsgi-3.3.tar.gz
cd mod_wsgi-3.3
./configure --enable-shared --prefix=/opt/mod_wsgi-3.3 --with-python=/opt/ActivePython-2.7/bin/python
make
make install

echo "Installing memcached"
yum -y --enablerepo=ius install memcached
sed -i 's/1024/20480/g' /etc/sysconfig/memcached
sed -i 's/64/1024/g' /etc/sysconfig/memcached
service memcached restart

echo "Installing Django"
export PATHOLD=$PATH
export PATH=/opt/ActivePython-2.7/bin:/root/.local/bin:$PATH
pypm -g install django
pypm -g install mysql-python
pypm -g install python-memcached 1.48
export PATH=$PATHOLD

Leave a Reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>