[indivohealth] setup Indivo with mod_wsgi and virtualenv

55 views
Skip to first unread message

jesus david ceron bravo

unread,
Aug 21, 2015, 10:56:42 PM8/21/15
to indivohealth
Hello

I am trying to setup indivo with apache (mod_wsgi) and virtualenv, but I get this:

in the browser:
Forbidden
You don't have permission to access /login on this server. 
Apache/2.4.7 (Ubuntu) Server at localhost Port 8002

in the apache log:
[authz_core:error] [pid 1247:tid 139830973359872] [client 127.0.0.1:58263] AH01630: client denied by server configuration: /home/david/indivo/indivo_ui_server/ui/wsgi.py


The /indivo_ui_server/ui/wsgi.py file contains:
_______________________________________________________________________
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ui.settings")

# Add the site-packages of the chosen virtualenv to work withIntroducir código aquí...
site.addsitedir('/home/david/.virtualenvs/indivo_env/local/lib/python2.7/site-packages/')

# Add the app's directory to the PYTHONPATH
sys.path.append('/home/david/indivo/indivo_ui_server')
sys.path.append('/home/david/indivo/indivo_ui_server/ui')

# Activate your virtual env
activate_env=os.path.expanduser("/home/david/.virtualenvs/indivo_env/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

# Apply WSGI middleware here.
_______________________________________________________________________________

The /indivo_server/django.wsgi file contains:

_______________________________________________________________________________
import os
import sys
from django.core.handlers.wsgi import WSGIHandler

sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)) + '/../')

# For production servers
#sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)) + '/../../')

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'


# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('/home/david/.virtualenvs/indivo_env/local/lib/python2.7/site-packages/')

# Add the app's directory to the PYTHONPATH
sys.path.append('/home/david/indivo/indivo_server')
#sys.path.append('/home/django_projects/MyProject/myproject')

# Activate your virtual env
activate_env=os.path.expanduser("/home/david/.virtualenvs/indivo_env/bin/activate_this.py")
execfile(activate_env, dict(__file__=activate_env))

class AdjEnvironMiddleware:

  def __init__(self, application):
    self.application = application

  def __call__(self, environ, start_response):
    environ['RAW_PATH_INFO'] = environ['PATH_INFO']

    def _start_response(status, headers):
      return start_response(status, headers)

    return self.application(environ, _start_response)

application = AdjEnvironMiddleware(WSGIHandler())

______________________________________________________________________________

and the apache default file contains:

___________________________________________

<VirtualHost *:8001>
        ServerAdmin YOU@localhost
        ServerName localhost
        DocumentRoot /home/david/indivo/indivo_server
        Alias /static/ /home/david/indivo/indivo_server/static/
        EnableMMAP On
        EnableSendfile On
        LogLevel warn

        <Directory /home/david/indivo/indivo_server>
                Order deny,allow
                Allow from all
        </Directory>

WSGIApplicationGroup %{GLOBAL}
        WSGIScriptAlias / /home/david/indivo/indivo_server/django.wsgi
        WSGIPassAuthorization On
</VirtualHost>

<VirtualHost *:8002>
        ServerAdmin YOU@localhost
        ServerName localhost
        DocumentRoot /home/david/indivo/indivo_ui_server
        Alias /static/ /home/david/indivo/indivo_ui_server/ui/static/
        EnableMMAP On
        EnableSendfile On
        LogLevel warn

        <Directory /home/david/indivo/indivo_ui_server>
         Order deny,allow
         Allow from all
        </Directory>

        WSGIDaemonProcess indivo_ui user=www-data group=www-data processes=1 maximum-requests=500 threads=10
        WSGIScriptAlias / /home/david/indivo/indivo_ui_server/ui/wsgi.py
        WSGIPassAuthorization On
</VirtualHost>
Message has been deleted

Maria Evangelia Chatzimina

unread,
Sep 23, 2015, 10:25:39 AM9/23/15
to indivo...@chip.org, indivohealth
Hello,
 I also had problems with apache 2.4 so try apache 2.2.  But I see that you have permission problems. 
Check If everything in folder indivo are accessible from www-data or whatever you apache uses.

Maria
--
Computational Medicine Laboratory (CML)
Institute of Computer Science (ICS) 
Foundation for Research and Technology - Hellas (FORTH)
N. Plastira 100 Vassilika Vouton, GR-700 13 Heraklion, Crete, Greece


Vijay Kannan

unread,
Jan 20, 2016, 8:20:22 AM1/20/16
to indivohealth, indivo...@chip.org
Hello,

After lot of hurdles I was able to manage to install UI server and server on ubuntu  on same machine.

few questions please some one help me.

UI server. [ url to check http://indivo.smartrx.in:8002 ]

1 . after default login jsmith / password.example there was not much I can do i.e. I am not able to click plus icon on right nor left icons 
2. Is there any settings I am missing 
3. How do we add PHA record


On indivo server : [ url http://indivo.smartrx.in:8001 ]

1.  what I am supposed to do with that url ? 
2. as you can see there was error i.e. which URL I have to visit for login not sure

Please help me I am struck on these for last 3 days.

Matthias Rother

unread,
May 22, 2017, 3:19:48 PM5/22/17
to indivohealth, indivo...@chip.org
Hey Vijay,

long time ago you posted that.
You get any reply ? I stuck at the same problem...

Greetings
Reply all
Reply to author
Forward
0 new messages