mod-wsgi

Django with mod_wsgi returns 403 error

荒凉一梦 提交于 2019-11-29 15:21:03
I am trying to use Django with Apache (and mod_wsgi). With the default Django webserver everything was going well, but now I get 403 (access forbidden) error when trying to load the page. I searched previous posts here and read official docs but the solutions there weren't helpful. Here are the lines from my httpd.conf: WSGIScriptAlias / /home/karlis/django/apache/django.wsgi <Directory /home/karlis/django/apache> Order allow,deny Allow from all </Directory> Alias /media/ /home/karlis/django/media <Directory /home/karlis/django/media> Order deny,allow Allow from all </Directory> Permissions

Installing mod_wsgi module for apache

一笑奈何 提交于 2019-11-29 15:20:57
问题 WHEN I WAS INSTALLING WSGI MODULE FOR APACHE i Downloaded module from http://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so Rename to mod_wsgi.so Copy to C:\Program Files\Apache Software Foundation\Apache2.2\modules edit 'httpd.conf' in C:\Program Files\Apache Software Foundation\Apache2.2\conf Add line 'LoadModule wsgi_module modules/mod_wsgi.so' in the module loading section of httpd.conf restart Apache Apache cannot be restarted The error in errorlog is:

pip install mod_wsgi, How to Set MOD_WSGI_APACHE_ROOTDIR environment?

孤者浪人 提交于 2019-11-29 14:52:00
问题 I am trying to install mod_wsgi in Windows 10. The command pip install mod_wsgi is giving me error, RuntimeError: No Apache installation can be found. Set the MOD_WSGI_APACHE_ROOTDIR environment to its location. My Apache dir is F:\Apache24\ . My question is, how to setup MOD_WSGI_APACHE_ROOTDIR environment ? Thanks, Sambhav 回答1: Referring to the docs at http://modwsgi.readthedocs.io/en/develop/release-notes/version-4.5.12.html should help you. In Short: By default the installation looks for

django print information on production server

寵の児 提交于 2019-11-29 14:43:42
问题 I have some prints on my application for debug purpose. On the production server where these printed information goes? on apache log? I am using apache/mod_wsgi . Thanks. 回答1: use logging I like to log to file at times so I use the following in my settings.py import logging logging.basicConfig( level = logging.INFO, format = '%(asctime)s %(levelname)s %(message)s', filename = '/tmp/djangoLog.log',) and where I want logging: import logging logging.info("Making the alpha-ldap connection"); then

Django + mod_wsgi. Set OS environment variable from Apache's SetEnv

戏子无情 提交于 2019-11-29 13:39:47
I need to split Django's development and production settings. I decided that if USKOVTASK_PROD variable is set, then app should use production settings. I read this article and tried to do it. My snippets: /etc/apache2/sites-enabled/uskovtask.conf: <VirtualHost *:80> ServerName uskovtask.*.com ServerAlias uskovtask.*.com DocumentRoot /mnt/ebs/uskovtask Alias /static /mnt/ebs/uskovtask/static/ <Directory /mnt/ebs/uskovtask/static> Require all granted </Directory> #WSGIPythonPath /mnt/ebs/uskovtask WSGIDaemonProcess uskovtask.*.com python-path=/mnt/ebs/uskovtask:/usr/lib/python2.7/site-packages

Activating the Flask debugger when running under mod_wsgi

泄露秘密 提交于 2019-11-29 13:34:57
How can I activate the Flask debugger when running under mod_wsgi? I have DEBUG , PROPAGATE_EXCEPTION and PRESERVE_CONTEXT_ON_EXCEPTION set to True , but still the debugger doesn't appear on exceptions. As described in the Flask documentation at: http://flask.pocoo.org/docs/quickstart/#debug-mode use: app.debug = True Under mod_wsgi you aren't doing the app.run() though. Ensure you are setting 'app.debug' at global scope and not in a conditional section where checking whether __name__ is __main__. You may use interactive debugger provided by werkzeug: from werkzeug.debug import

Django Webfaction 'Timeout when reading response headers from daemon process'

喜你入骨 提交于 2019-11-29 11:48:39
问题 My Django app on my production server hosted on Webfaction was working fine until I just tried to restart it after pushing a change to the settings.py file. I ran apache2/bin/restart as usual. Then I tried to access my app on my browser, and I got a 504 Gateway timeout. I looked into the mod_wsgi logs and saw this: [Thu Nov 03 23:46:53.605625 2016] [wsgi:error] [pid 8027:tid 139641332168448] [client 127.0.0.1:34570] Timeout when reading response headers from daemon process 'myapp' : /home/<me

switch python version on uwsgi

半世苍凉 提交于 2019-11-29 10:59:22
I am running a django app with nginx and uwsgi. It was was working ok but suddenly I do not know what I changed that the app stop working. The problem resides in that python version from uWsgi is 2.4.3 which is the default version in Linux CentOs and I have installed django, webpy and other python distributions in version 2.7.3 (will upgrade sooner) I also tried creating a symbolic link from python 2.7 path to just "python" in usr/bin and did not work. How can I make uWsgi use python2.7.3(/usr/local/bin/) instead of 2.4.3? Django ini: socket = 127.0.0.1:3031 master = true processes = 4 env =

Multiple django sites on Apache / Windows / mod_wsgi - problem with win32

无人久伴 提交于 2019-11-29 10:26:48
I have two django sites that use the same database and share some of the code. The main parent site is an extranet for staff and contractors, while the second site exposes some of the data to a few of our partners. I have managed to set up sites to work but found that if I launched Apache and went into the main site, then the partner site wouldn't work, returning an "Internal Server Error". If I restarted and went into the partner site, then the main site wouldn't work. So I guess they are conflicting over resources. The server log (see bottom) shows that it is a problem with the win32/lib

How to reload new update in Django project with Apache, mod_wsgi?

蹲街弑〆低调 提交于 2019-11-29 09:45:41
I am making a project using the Django framework. I have hosted a test server with Apache+mod_wsgi. When I change some lines of code, I upload the file and test it in a browser. But the new changes are not shown unless I reload/restart ( /etc/init.d/apache2 reload ). Is there any other way to reload/refresh new changes besides reloading Apache? Yes, touch your wsgi configuration file. For me, my server restart script is as simple as touch /srv/grove_project/conf/apache/django.wsgi . Build it into your server management scripts and it's a nice graceful restart. For more info and when this