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>