# setup-base-centos.sh
yum -y install gcc
yum -y install python-setuptools
yum -y install mc
yum -y install subversion
yum -y install python-devel # needed for:sqlite, PIL
yum -y install postgresql postgresql-server
# for ilike lower etc. on russian (see: http://habrahabr.ru/blogs/postgresql/55620/)
su postgres
initdb --locale=ru_RU.utf8 /var/lib/pgsql/data
# можем проверить командой
#psql -c "show lc_ctype"
# должно быть ru_RU.utf8
# on autostart
# http://www.cyberciti.biz/faq/howto-fedora-linux-install-postgresql-server/
chkconfig postgresql on
# start
service postgresql start
# create user for postgre
# su - postgres
# createuser -P -s -e username;
# Modify /var/lib/pgsql/data/pg_hba.conf to require password authentication for local connections:
# (for firstvds.ru hosting is /var/lib/pgsql/data/pg_hba.conf)
# Comment or remove any existing lines at the end of the file, then append this:
# local all all password
# restart service:
service postgresql restart
# create database:
createdb --encoding=UTF-8 --username=user_name --password db_name
# sqlite
yum -y install sqlite-devel
easy_install pysqlite
# setup PIL
easy_install --find-links http://www.pythonware.com/products/pil/ Imaging # if not work "from PIL import *" rename dir to "PIL"
# alt setup PIL
yum -y install python-imaging
# setup EPIL (http://fedoraproject.org/wiki/EPEL) for psycopg2
# fine howto: http://damntechnology.blogspot.com/2008/01/django-with-postgresql-on-centosrhel-5.html
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm
yum -y install postgresql-python python-psycopg2 # for use psycopg2 specify in config: postgresql_psycopg2
###
# setup django and related
###
svn co http://code.djangoproject.com/svn/django/trunk /usr/local/src/apps/django-trunk
cd /usr/local/src/apps/django-trunk
python setup.py intall
# as variant use:
# ln -s /usr/local/src/apps/django-trunk/django /usr/lib/python2.4/site-packages/django
# but this - problem with SELinux context ("ImportError: No module named django" under apache)
# See also about apache and SELinux:
# http://www.nabble.com/%22ImportError:-No-module-named-django%22-persists...-td14857086.html
# http://www.packtpub.com/article/selinux-secured-web-hosting-python-based-web-applications
svn co http://django-evolution.googlecode.com/svn/trunk/ /usr/local/src/apps/django-evolution
ln -s /usr/local/src/apps/django-evolution/django_evolution /usr/lib/python2.4/site-packages/django_evolution
easy_install django-dbtemplates
svn co http://django-filebrowser.googlecode.com/svn/trunk/filebrowser/ /usr/local/src/apps/filebrowser
ln -s /usr/local/src/apps/filebrowser /usr/lib/python2.4/site-packages/filebrowser
###
# check out project from flash
###
svn co file:///media/disk/Projects/svn/django_root/trunk /home/web-root
ln -s /home/web-root/shared/showcase /usr/lib/python2.4/site-packages/showcase
ln -s /home/web-root/shared/snippets /usr/lib/python2.4/site-packages/snippets #todo: remove snippets
###
# Set SELinux context for you django/python project directory
# if you plan create your projects in /home/sites
###
chcon -R -t httpd_user_content_t /home/sites
chcon -R -t httpd_user_content_t /home/apps
# hints
# show releases: rpm -q centos-release (rpm -q python)
# erase (uninstall) package: rpm -e package-name (rpm -e python-2.4.3-21.el5)
Подписаться на:
Комментарии к сообщению (Atom)
Комментариев нет:
Отправить комментарий