Commit 95cb62e5 authored by Giuseppe Terrasi's avatar Giuseppe Terrasi

new readme

parent 149c2a2d
...@@ -2,37 +2,48 @@ ...@@ -2,37 +2,48 @@
CHANGE_THIS_PATH is equal to new third level domain url or folder that containing it CHANGE_THIS_PATH is equal to new third level domain url or folder that containing it
= Virtualenv = = Dependencies =
Follow this step: See RT #19985
1) apt-get install python-setuptools python-dev build-essential
2) easy_install virtualenv
3) cd srv/CHANGE_THIS_PATH
4) mkdir env
5) virtualenv –python=/usr/bin/python2.6 --no-site-packages env/
6) sudo env/bin/easy_install django==1.3 South==0.7.5 Sphinx==1.0 django-openid-auth==0.2 django-debug-toolbar \\
django-migrator==0.3 html5lib markdown elementtidy sphinxsearch psycopg2
= Database = = Database =
"osqa" user and a "osqa" database. postgres-9.1 is ok. We need:
* user 'ubuntu-it-chiedi'
= Apache = * db 'ubuntu-it-chiedi'
See 00-apache_site_avaible_rules file.
= Deploy = = Deploy =
1) Put bzr lp:ubuntu-it-ask into /srv/CHANGE_THIS_PATH/www/osqa/ and apply changes in osqa.wsgi and settings_local.py in order to reflect \\ 1) svn co http://svn.osqa.net/svnroot/osqa/trunk
the correct url and path. 2) Put svn into /srv/CHANGE_THIS_PATH/www/osqa/ (important: don't rename the osqa folder)
3) rename osqa.wsgi.dist into osqa.wsgi, then change path into this.
4) rename settings_local.py.dist in settings_local.py and apply some changes:
a) change db settings **
b) change the app url
c) timezone in Europe/Rome
d) languages in IT
e) DJANGO_VERSION = 1.3
f) DISABLED_MODULES add 'mysqlfulltxt', 'localauth'
g) CACHE_BACKEND = 'memcached://<server-address>:<port>/ with the correct path.
5) python manage.py syncdb --all (no create super user)
6) python manage.py migrate forum --fake
7) cp -R locale l it
8) python manage.py makemessages -l it
** Note: an example of settings_local.py with right database settings (line 27): http://bazaar.launchpad.net/~ubuntu-it-ask/ubuntu-it-ask/trunk/view/head:/settings_local.py
2) python manage.py syncdb --all (no create super user)
3) python manage.py migrate forum --fake
4) python manage.py makemessages -a (or "-l it" is sufficient)
= Permission = = Permission =
sudo chown -R www-data:www-data osqa sudo chown -R www-data:www-data osqa
sudo chmod -R g+w /srv/CHANGE_THIS_PATH/www/osqa/forum/upfiles sudo chmod -R g+w /srv/CHANGE_THIS_PATH/www/osqa/forum/upfiles
sudo chmod -R g+w /srv/CHANGE_THIS_PATH/www/osqa/log sudo chmod -R g+w /srv/CHANGE_THIS_PATH/www/osqa/log
= Other =
We can perform other changes, if needed, using bzr with no access on
calcium in the next step.
= End =
Now OSQA should be up and running.
#!/src/CHANGE_THE_PATH/env python
ALLDIRS = ['/srv/CHANGE_THE_PATH/env/lib/python2.6/site-packages']
import os
import sys
import site
sys.path.append('/srv/CHANGE_THE_PATH/www')
sys.path.append('/srv/CHANGE_THE_PATH/www/osqa')
activate_this = '/srv/CHANGE_THE_PATH/env/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
prev_sys_path = list(sys.path)
for directory in ALLDIRS:
site.addsitedir(directory)
new_sys_path = []
for item in list(sys.path):
if item not in prev_sys_path:
new_sys_path.append(item)
sys.path.remove(item)
sys.path[:0] = new_sys_path
os.environ['DJANGO_SETTINGS_MODULE'] = 'osqa.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment