Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently I've been trying to run a website on Ubuntu using Apache2, but I've encountered a problem. The website is named Indivo, and has Python files.

I've set up system according to instructions, but when running Apache:

$ sudo service apache2 restart

I get this line and the site doesn't start:

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName 
... waiting [Wed Aug 04 13:12:01 2010] [warn] module wsgi_module is already loaded, skipping
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

The Apache config file (in /etc/apache2/sites-enabled/default) is like this:

<VirtualHost *:8000>
  ServerAdmin ehsan@indivo.dal.ca
  ServerName www.indivo.dal.ca
  DocumentRoot /usr/indivo_server
  Alias /static/ /usr/indivo_server/static/
  EnableMMAP On
  EnableSendfile On
  LogLevel warn
  <Directory /usr/indivo_server>
     Order deny,allow
     Allow from all
  </Directory>

  WSGIDaemonProcess indivo user=ehsan group=ehsan processes=1 maximum-requests=500 threads=10
  WSGIScriptAlias / /usr/indivo_server/django.wsgi
  WSGIPassAuthorization On
</VirtualHost>

<VirtualHost *:80>
  ServerAdmin ehsan@indivo.dal.ca
  ServerName www.indivo.dal.ca
  DocumentRoot /usr/indivo_ui_server
  Alias /static/ /usr/indivo_ui_server/ui/static/
  EnableMMAP On
  EnableSendfile On
  LogLevel warn
  <Directory /usr/indivo_ui_server>
   Order deny,allow
   Allow from all
  </Directory>

  WSGIDaemonProcess indivo_ui user=ehsan group=ehsan processes=1 maximum-requests=500 threads=10
  WSGIScriptAlias / /usr/indivo_ui_server/django.wsgi
  WSGIPassAuthorization On
</VirtualHost>

Do you have any ideas about this issue?

Thank you
Ehsan

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The error:

module wsgi_module is already loaded

is because you have LoadModule line for wsgi_module more than once, or the snippet file it is in is being included twice somehow.

Your configuration is also wrong in other ways as well.

First off you are missing a WSGIProcessGroup directive to go with WSGIDaemonProcess directive. If you do not have WSGIProcessGroup the WSGI application will still run in embedded mode and will not be delegated to the daemon process. Ensure you read the official documentation as to why you are having socket permission issues:

http://code.google.com/p/modwsgi/wiki/ConfigurationIssues

Second, don't use 'processes=1', just leave the option off as it defaults to one process and using 'processes' option for any value technically flags to WSGI application that it is a multi process application when in your case it likely isn't as you aren't load balancing across multiple Apache server instances with same application.

Finally, setting maximum-requests is generally not recommended unless you have a good reason and understand why you are doing it. If you have added it because you saw someone else's configuration had it and not because you know you actually need it, then take it out.

BTW, it is presumed you have NameVirtualHost set appropriately so your VirtualHost's actually work properly.

As for the domain name resolution, if your sites work, can usually be ignored.

Note that known of the errors you quote should stop Apache from starting. Suggest you run:

sudo /usr/sbin/apachectl -t

and see what further error messages are given for when Apache validates your configuration and post full output as addition to your question.

The full official documentation for mod_wsgi can be found at:

http://www.modwsgi.org

Ensure you read it.

share|improve this answer
    
Hi Graham, thank you for your answer. I've read the documentation and learned a lot. The result for syntax is: [warn] module wsgi_module is already loaded, skipping apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Syntax OK Do you think the apache probably works fine and it may be the problem with the website itself, so it doesn't load? –  Ehsan Aug 5 '10 at 15:17
    
[warn] module wsgi_module is already loaded, skipping apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName Syntax OK –  Ehsan Aug 5 '10 at 15:18
    
Have you tried a simple hello world WSGI application as described in quick configuration guide for mod_wsgi to see if that works. As I said, those errors messages do not indicate that Apache was unable to actually start and so it should be able to handle requests. I cat see anything in your posts to suggest whether you have actually tried making requests. –  Graham Dumpleton Aug 5 '10 at 22:47
    
This problem doesn't seem to be from Apache. I am trying to solve it with other configuration. Thank you Graham. –  Ehsan Aug 9 '10 at 17:40

What do you get when you run

hostname --fqdn

Check that you have an appropriate name in /etc/hosts such as www.indivo.dal.ca

Your apache conf file looks right to me, what does django.wsgi look like?

share|improve this answer
    
Hi, thanks for answer. the command gives me Reza, so I think I should rename the server name. But I was not able to locate django.wsgi! –  Ehsan Aug 5 '10 at 14:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.