Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati

Versione 6 del 15/07/2012 16.43.12

Nascondi questo messaggio

BOZZA, LA PAGINA SARA' MOLTO LUNGA. PIÙ AVANTI SPEZZARLA IN SOTTOPAGINE

Introduzione

Questa pagina contiene informazioni utili per coloro che vogliono partecipare allo sviluppo e al mantenimento del codice di chiedi.ubuntu-it.org

Come si fa

I passi sono:

  • Installare OSQA sul proprio computer;
  • Ottenere il nostro codice;
  • HACK!
  • Mandaci le tue modifiche.

Prerequisiti

  • Consigliato l'uso di Ubuntu 11.10 o Ubuntu 12.04 in quanto contengono i pacchetti necessari e nella giusta versione.
  • Installare i seguenti pacchetti relativi a django, apache, database postgresql, subverson:

    sudo apt-get install python-django python-django-south python-django-openid-auth python-django-debug-toolbar python-migrate python-html5lib python-markdown python-elementtidy python-psycopg2 postgresql-9.1 libapache2-mod-wsgi subversion

Database

Configurare correttamente i permessi di postgresql.

  • Modificare il file /etc/postgresql/9.1/main/pg_hba.conf, sostituendo le ultime righe con questo

    # "local" is for Unix domain socket connections only
    host    all         all         0.0.0.0          0.0.0.0      md5
    host    all         all         ::1/128                       md5
    local   all         all                                       md5
    local   all             all                                     peer
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            md5
    # IPv6 local connections:
    host    all             all             ::1/128                 md5
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    #local   replication     postgres                                peer
    #host    replication     postgres        127.0.0.1/32            md5
    #host    replication     postgres        ::1/128                 md5
  • Assumiamo che per installare il database si usi l'utente postgres, impostare la sua password:

    sudo su postgres
    psql -d template1 -U postgres
    alter user postgres with password 'la_tua_password';
    \q
  • Creiamo il database osqa con proprietario postgres:

    createdb -O postgres osqa
    exit

Apache

Deploy

Deploy

  • Scaricare il nostro branch in sviluppo:

    bzr branch lp:~ubuntu-it-ask/ubuntu-it-ask/dev
  • Copiarlo in /var/www/osqa (la cartella DEVE chiamarsi osqa)
  • Rinominare osqa.wsgi.dist in osqa.wsgi, quindi cambiare i path:

    sys.path.append('/var/www')
    sys.path.append('/var/www/osqa')
  • modificare settings_local.py affinché rifletta la reale configurazione della propria macchina. A titolo di esempio:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'osqa',
            'USER': 'postgresql',
            'PASSWORD': 'la_password_dell'utente_postgres',
            'HOST': '',
            'PORT': '',
        }
    }
    
    APP_URL = 'http://localhost'
    
    OSQA_DEFAULT_SKIN = 'light'
  • Popolare il database (comandi da dare in /var/www/osqa):

    sudo python manage.py syncdb --all (dire no alla richiesta di creare un super utente)
    sudo python manage.py migrate forum --fake
  • Generare le ultime traduzioni (sempre da /var/www/osqa):

    cp locale/it/LC_MESSAGES/it.po locale/it/LC_MESSAGES/django.po 
    msgfmt locale/it/LC_MESSAGES/django.po -o locale/it/LC_MESSAGES/django.mo
    sudo python manage.py makemessages -l it

Permessi

sudo chown -R www-data:www-data /var/www/osqa
sudo chmod -R g+w /var/www/osqa/forum/upfiles
sudo chmod -R g+w /var/www/osqa/log

Prova

Riavviare apache e postgres, per sicurezza per l'ultima volta e andare su http://localhost. Dovrebbe funzionare.


CategoryComunita