On 16 July 2010 00:18, ashy <[email protected]> wrote: > Hi All, > > I have got the error log > > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line > 241, in __call__ > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] response = > self.get_response(request) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/core/handlers/base.py", line > 73, in get_response > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] response = > middleware_method(request) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/contrib/sessions/ > middleware.py", line 10, in process_request > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] engine = > import_module(settings.SESSION_ENGINE) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, > in import_module > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] > __import__(name) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/contrib/sessions/backends/ > db.py", line 2, in <module> > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] from > django.contrib.sessions.models import Session > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/contrib/sessions/models.py", > line 4, in <module> > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] from > django.db import models > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/db/__init__.py", line 41, in > <module> > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] backend = > load_backend(settings.DATABASE_ENGINE) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/db/__init__.py", line 17, in > load_backend > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] return > import_module('.base', 'django.db.backends.%s' % backend_name) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, > in import_module > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] > __import__(name) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] File "/usr/ > local/lib/python2.6/dist-packages/django/db/backends/mysql/base.py", > line 13, in <module> > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] raise > ImproperlyConfigured("Error loading MySQLdb module: %s" % e) > [Thu Jul 15 08:40:43 2010] [error] [client 10.1.2.3] > ImproperlyConfigured: Error loading MySQLdb module: No module named > MySQLdb > > I have commented out lines like > #import MySQLdb > but still getting the same error.
It would appear that mod_wsgi is using /usr/local/lib/python2.6 installation. If you have in fact installed MySQLdb Python wrappers, then that isn't where they are installed and instead they are installed against system wide Python installation under /usr/lib instead. You need to installed MySQLdb Python wrappers for your Python 2.6 installation under /usr/local instead. Graham > thanks > ashy > > > On Jul 15, 5:27 pm, Graham Dumpleton <[email protected]> > wrote: >> Go look in the Apache error logs for the exact details. Also look at >> my talk slides and the actual video for why that sort of error can >> occur, matching the error from logs with what my talk explains. >> >> http://blog.dscpl.com.au/2010/06/sydney-pycon-modwsgi-talk-slides.html >> >> Graham >> >> On Thursday, July 15, 2010, ashy <[email protected]> wrote: >> > Hi, >> >> > sorry, I wasn't using sudo. I server starts without error now. >> > But hittinghttp://testdev.comis giving me internal server error >> >> > Internal Server Error >> >> > The server encountered an internal error or misconfiguration and was >> > unable to complete your request. >> >> > Please contact the server administrator, [no address given] and inform >> > them of the time the error occurred, and anything you might have done >> > that may have caused the error. >> >> > More information about this error may be available in the server error >> > log. >> > Apache/2.2.11 (Ubuntu) DAV/2 SVN/1.5.4 PHP/5.2.6-3ubuntu4.5 with >> > Suhosin-Patch mod_wsgi/2.3 Python/2.6.2 Server at plsdev.snstech.com >> > Port 80 >> >> > Where am I going wrong? >> >> > thanks >> > ashy >> >> > On Jul 15, 5:09 pm, "[email protected]" <[email protected]> wrote: >> >> On Jul 15, 2010, at 7:59 AM, ashy wrote: >> >> >> > Hi All, >> >> >> > I am having problems configuring mod_wsgi >> >> >> > The contents of my sites-available/default >> >> >> > <VirtualHost *:80> >> >> > ServerName testdev.com >> >> > ServerAdmin webmas...@localhost >> >> >> > DocumentRoot /var/www >> >> > <Directory /> >> >> > Options FollowSymLinks >> >> > AllowOverride None >> >> > </Directory> >> >> > <Directory /var/www/> >> >> > Options Indexes FollowSymLinks MultiViews >> >> > AllowOverride None >> >> > Order allow,deny >> >> > allow from all >> >> > </Directory> >> >> >> > WSGIScriptAlias / /home/bzala/djangoprojects/testdev/apache/ >> >> > django.wsgi >> >> >> > <Directory /home/bzala/djangoprojects/testdev> >> >> > Order deny,allow >> >> > Allow from all >> >> > </Directory> >> >> >> > ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ >> >> > <Directory "/usr/lib/cgi-bin"> >> >> > AllowOverride None >> >> > Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch >> >> > Order allow,deny >> >> > Allow from all >> >> > </Directory> >> >> >> > ErrorLog /var/log/apache2/error.log >> >> > #ErrorLog /home/bzala/error.log >> >> >> > # Possible values include: debug, info, notice, warn, error, >> >> > crit, >> >> > # alert, emerg. >> >> > LogLevel warn >> >> >> > CustomLog /var/log/apache2/access.log combined >> >> >> > Alias /doc/ "/usr/share/doc/" >> >> > <Directory "/usr/share/doc/"> >> >> > Options Indexes MultiViews FollowSymLinks >> >> > AllowOverride None >> >> > Order deny,allow >> >> > Deny from all >> >> > Allow from 127.0.0.0/255.0.0.0 ::1/128 >> >> > </Directory> >> >> >> > </VirtualHost> >> >> >> > The contents of the wsgi file >> >> >> > import os, sys >> >> > sys.path.append('/home/bzala/djangoprojects') >> >> > sys.path.append('/home/bzala/djangoprojects/testdev') >> >> > os.environ['DJANGO_SETTINGS_MODULE'] = 'testdev.settings' >> >> > import django.core.handlers.wsgi >> >> > application = django.core.handlers.wsgi.WSGIHandler() >> >> >> > The error that appears when trying to restart the apache server >> >> >> > (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 >> >> > no listening sockets available, shutting down >> >> > Unable to open logs >> >> >> > Can anybody help me debugging this. >> >> >> You're not getting to mod_wsgi; you're having trouble configuring Apache >> >> ;-). >> >> >> Are you starting Apache with sudo? If not, you won't get out of the gate. >> >> >> If it's not sudo, are you accidentally running another webserver (like >> >> another apache instance or nginx) that's binding all the servable >> >> addresses? >> >> What happens if you go tohttp://ip.add.re.ssusingyour ip address? Is >> >> there a default page there? >> >> >> Also, as an aside, putting all your configuration into the default kind >> >> of misses the whole point of that fancy directory structure. It's set >> >> up that way to let you enable and disable sites easily (a2dissite >> >> a2ensite on ubuntu), you should probably use it that way. It'll also >> >> help you narrow down the actual problem. >> >> >> S >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "modwsgi" group. >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group >> > athttp://groups.google.com/group/modwsgi?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
