mod-wsgi

apache2 and mod wsgi : Target WSGI script cannot be loaded as Python module

只谈情不闲聊 提交于 2019-12-05 04:31:39
I am trying to install mod_wsgi on apache2, on ubuntu. So I install libapache2-mod-wsgi package, I activate him with a2enmod. I got a web site (languageAnalyz), that I am trying to use with mod_wsgi. When I call localhost/languageAnalyz, I got an error 500. In apache2 log, I can see this : [Sun Aug 25 11:28:21 2013] [error] [client 127.0.0.1] mod_wsgi (pid=4993): Target WSGI script '/var/www/languageAnalyz/test-wsgi.py' cannot be loaded as Python module. [Sun Aug 25 11:28:21 2013] [error] [client 127.0.0.1] mod_wsgi (pid=4993): SystemExit exception raised by WSGI script '/var/www

Deploying Django on Apache2 with mod_wsgi - Correct location for Django project?

邮差的信 提交于 2019-12-05 03:23:01
问题 I am trying to deploy my first Django project on my webserver. I am both new to server configuration and Django so I have a hard time finding my errors. In most tutorials I have seen online, the Django project on the production server is created in /var/www/myproject - however, the Django documentation recommends putting the code outside of /var/www/ for security reasons (see: https://docs.djangoproject.com/en/1.9/intro/tutorial01/). So, I put my Django project in a subdirectory of my home

Variable will be instantiated more than once

陌路散爱 提交于 2019-12-05 02:43:39
问题 I got something unusual when developing a small web server using Python2.7+Apache+mod_wsgi . The main usage of this server is: Receiving regular requests from another server(server A), and put the request body into DB. Using some background threads to parse the request body in DB and send the parsed information to a third server(server B). Apache is configured as Windows 'winnt' MPM mode. Code of dispatch.py, which is the entry point, is like below: from urlparse import parse_qs pool =

Have to Restart Apache When Using Django On Apache with mod_wsgi

怎甘沉沦 提交于 2019-12-05 00:55:44
I'm creating a web app with Django. Since I'm very familiar with Apache I setup my development environment to have Django run through Apache using mod_wsgi. The only annoyance I have with this is that I have to restart Apache everytime I change my code. Is there a way around this? mod_wsgi is great for production but I think the included server is better for development. Anyway you should read this about automatic reloading of source code. I feel like this is really just one of those things most people deal with. It's really not that big of a deal. I made a bash script to make this as easy as

Django - End of script output before headers

一个人想着一个人 提交于 2019-12-05 00:46:54
Basic hello.wsgi works fine. Other django application also works perfect with absolutely the same virtualenv version. mod_wsgi hangs for ~10 min (!!!), and i see nothing can point me a problem (loglevel debug): [Tue Mar 25 23:11:08.878578 2014] [:info] [pid 4719:tid 140720591648640] mod_wsgi (pid=4719): Attach interpreter ''. [Tue Mar 25 23:11:08.879171 2014] [:info] [pid 4717:tid 140720591648640] mod_wsgi (pid=4717): Attach interpreter ''. [Tue Mar 25 23:11:10.891348 2014] [authz_core:debug] [pid 4730:tid 140720477226752] mod_authz_core.c(802): [client 127.0.0.1:40844] AH01626: authorization

django file upload: [Errno 13] Permission denied: '/static'

一曲冷凌霜 提交于 2019-12-04 22:24:37
问题 I am trying to upload several files in django. On my local maching where I use the djangos build in server everything works fine but on my productivity server I get this error: [Errno 13] Permission denied: '/static' There are many questions about this issue but nothing I found worked for me. In my case it has nothing to do with file permissions. I found out that the problem is that django want save the files in the root folder of my filesystem and not in the root folder of my website. If I

Adding Socket.IO to existing Django/WSGI project

一笑奈何 提交于 2019-12-04 20:31:51
This guy seems to be trying to do the same thing but the answer to his question isn't clear enough. I'm not all that familiar with setting up socket servers so I'm still a bit lost here. Has anyone accomplished this before? How do you spin up the socket server and keep it running? I wanted to comment on his post and ask him if he had success but I don't have enough reputation yet. My final solution to this was using the built-in runserver_socketio command for the manage.py script, running on 0.0.0.0:9000 . I'm using Ubuntu so I made an upstart config to keep it alive. Seems to be working just

session issue with django+apache+mod_wsgi

三世轮回 提交于 2019-12-04 20:28:38
I've written a django application, and put it on a CentOS server. It is definitely okay when I use django development web server. Such as I start it by "python ./manage.py runserver", and access that server from browser on another computer. I can sign in one time, and access all the pages without issues. However when I run it with apache+mod_wsgi, I just found I have to login with user and password time by time. I think maybe there is some problem with the session middleware, so, how can I find the root cause and fix it? There are a couple of different options for this. In order of likelyhood

WSGIPythonPath is not working

北战南征 提交于 2019-12-04 19:01:40
问题 I am deploying my web.py application on Apache2 with mod_wsgi. Here is my virt_host file, WSGIPythonPath /home/ubuntu/plotwatt/libplotwatt:/home/ubuntu/plotwatt/pwstage/src <VirtualHost *:20108> ServerAdmin gslabrails.dev.plotwatt.com DocumentRoot /var/www WSGIScriptAlias / /var/www/currentcost/server.py WSGIDaemonProcess currentcost user=ubuntu group=ubuntu processes=5 threads=3 WSGIProcessGroup currentcost WSGIApplicationGroup %{GLOBAL} AddType text/html .py <Directory /var/www/currentcost/

Setting Python Path in Windows XAMPP using WSGI

三世轮回 提交于 2019-12-04 16:53:24
I'm setting up a development version of a live server on Webfaction, running Django apps in a virtual Apache server environment (running without any errors) on my local machine - XP, running XAMPP Lite with Python 2.6 - which I can commit changes from via Git. XAMPP is up and running OK with Python, and the server starts perfectly with WSGI module loaded. The problem is when I set my Python paths, they are set half in 'nix format (with /), and half in Windows (with backslashes). Here's the local machine Apache error, showing the corrupted python paths: [Fri Oct 08 14:52:53 2010] [error]