mod-wsgi

Error 2006: “MySQL server has gone away” using Python, Bottle Microframework and Apache

霸气de小男生 提交于 2019-12-04 13:54:14
问题 After accessing my web app using: - Python 2.7 - the Bottle micro framework v. 0.10.6 - Apache 2.2.22 - mod_wsgi - on Ubuntu Server 12.04 64bit; I'm receiving this error after several hours: OperationalError: (2006, 'MySQL server has gone away') I'm using MySQL - the native one included in Python. It usually happens when I don't access the server. I've tried closing all the connections, which I do, using this: cursor.close() db.close() where db is the standard MySQLdb.Connection() call. The

How can I fix Python version mismatch of Apache mod_wsgi?

前提是你 提交于 2019-12-04 12:53:46
I am getting this error: [Thu Jul 12 14:31:36 2012] [error] python_init: Python version mismatch, expected '2.6.7', found '2.6.8'. while trying to start Apache server. In a question, someone advised to rebuild mod_python for the correct version of Python. But mod_python is not supported anymore. So how can I use Python 2.7 or 2.6 with mod_wsgi and fix that error? Finally I removed mod_python modules from python.conf. And rebuilt mod_wsgi. Now it is working. Thanks. Normally minor versions don't require a rebuild, but in this case, you may need to rebuild mod_wsgi. You might need uninstall and

Django/mod_wsgi and PHP as Virtual Hosts on same Apache Server using MAMP

心不动则不痛 提交于 2019-12-04 12:52:28
UPDATE: My original question is below, but the code I posted with the question has been edited to the final working solution. I am trying to run multiple sites on my MAMP development server. Some of the sites are wordpress sites that live in the htdocs in MAMP and some of the sites are django apps that live in a folder titled djangoprojects. I have been trying to implement the solutions from these stack questions: multiple django sites with apache & mod_wsgi How do I run Django and PHP together on one Apache server? but I have not been successful. I was able to run the django site on apache

How to prevent 'IOError: failed to write data' when client closes connection to Django/WSGI app?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 11:30:19
I have an iPhone app that is using web services implemented in Python, using Django and Piston, running on an apache server through WSGI. Sometimes the app closes its connection to the server before a call is finished. When it does this it causes a: [Tue Sep 06 11:29:46 2011] [error] [client 207.35.164.99] mod_wsgi (pid=820): Exception occurred processing WSGI script 'myscript.wsgi'. [Tue Sep 06 11:29:46 2011] [error] [client 207.35.164.99] IOError: failed to write data to appear in my server's error logs. I can "fix" the problem in the app by not explicitly closing the connection, but just

No module named deploy when trying to start pyramid app with mod_wsgi

谁都会走 提交于 2019-12-04 10:51:25
trying to use mod_wsgi for the first time for my pyramid app, but I keep getting an ImportError: No module named deploy when I try to access the site in my /etc/apache2/sites-available/domain.com <VirtualHost *:80> ServerName domain.com ServerAlias www.domain.com ServerAdmin admin@domain.com DocumentRoot /data/app ErrorLog /data/app/apache_error.log WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=www-data group=www-data \ processes=2 threads=4 \ python-path=/data/app/lib/python2.6/site-packages/ WSGIScriptAlias / /data/app/pyramid.wsgi <Directory /data

I am getting “Invalid command 'WSGIScriptAlias' ” error while starting Apache

╄→尐↘猪︶ㄣ 提交于 2019-12-04 10:08:53
问题 I want to deploy my Django project to EC2 server. I installed mod_wsgi. And made configuration like in the tutorial of django. I am getting the following: Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration What is the reason? mod_wsgi is not installed correctly? LoadModule wsgi_module libexec/httpd/mod_wsgi.so LoadModule alias_module libexec/httpd/mod_alias.so WSGIScriptAlias / /usr/local/apache2/htdocs/mysite/mysite/wsgi.py

mod_wsgi error - class.__dict__ not accessible in restricted mode

给你一囗甜甜゛ 提交于 2019-12-04 09:31:14
问题 This started biting our ass on our production server really hard. We saw this occasionally (for 1 request per week). Back then we found out it is because of mod_wsgi doing some funky stuff in some configs. As we could not track the reason for the bug, we decided that it did not require instant attention. However today, on 1 of our production servers this really occurred for 10 % of all server requests; that is 10 % of all server requests failed with this very same error: mod_wsgi (pid=1718):

apache prefork/mod_wsgi spawned process count seemingly past configuration [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-04 09:11:59
in a production environment running nginx reversing back to apache mpm-prefork/mod_wsgi, im seeing 90 apache child processes, when i would expect that 40 would be the maximum, as configured below. the configuration/setup is nothing exciting: nginx is reverse proxying to apache via proxy_pass , and serving static media apache only serves dynamic requests relevant nginx config: worker_processes 15; events { worker_connections 1024; } keepalive_timeout 10; relevant apache config: KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimeout 15 <IfModule mpm_prefork_module> StartServers 20

Configuration problems with django and mod_wsgi

落爺英雄遲暮 提交于 2019-12-04 08:59:57
I've got problems on getting django to work on apache 2.2 with mod_wsgi. Django is installed and mod_wsgi too. I can even see a 404 page when accessing the path and I can login to django admin. But if I want to install the tagging module I get the following error: Traceback (most recent call last): File "setup.py", line 49, in <module> version_tuple = __import__('tagging').VERSION File "/home/jim/django-tagging/tagging/__init__.py", line 3, in <module> from tagging.managers import ModelTaggedItemManager, TagDescriptor File "/home/jim/django-tagging/tagging/managers.py", line 5, in <module>

Speeding Up the First Page Load in django

Deadly 提交于 2019-12-04 07:38:50
问题 When I update the code on my website I (naturally) restart my apache instance so that the changes will take effect. Unfortunately the first page served by each apache instance is quite slow while it loads everything into RAM for the first time (5-7 sec for this particular site). Subsequent requests only take 0.5 - 1.5 seconds so I would like to eliminate this effect for my users. Is there a better way to get everything loaded into RAM than to do a wget x times (where x is the number of apache