Internal Server Error while running mod_wsgi application

345 views
Skip to first unread message

krishnan m

unread,
Aug 31, 2010, 10:13:47 AM8/31/10
to mod...@googlegroups.com
Hi all,
         I am very new to this mod_wsgi framework,i have tried a sample hello world application and that too cause erros.The steps i have done as follows:

1) I have installed mod_wsgi using synaptic pakage manager.-successfully installed.
2) Then i create my application in the name samplewsgi and place it in /var/www
3) My application code
 <code>
       import sys
       sys.path.append('/var/www/samplewsgi')
       from samplewsgi import app as application
      then followed by hello world program.
</code>

4)My Apache Configuration file in /etc/apache2/sites-available/default
   
<snip>
   I have added the path to my .wsgi file
   WSGIScriptAlias
   <Directory /var/www/samplewsgi >
    
   </Directory>
5)After restarting apache ,i went to browser and see http://localhost
  i see

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost 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.

what may be the reasons?

please give ur valuable suggestions.I am in need of that.How to overcome this problem?or i have missed any steps.










--
Work with Passion will always yields Success

Graham Dumpleton

unread,
Aug 31, 2010, 10:52:19 PM8/31/10
to mod...@googlegroups.com

You need to look in the Apache error log files to find the actual
details of the error. This may be a Python traceback, or an error from
Apache or mod_wsgi. Post the whole section generated at the time of
the request, please don't post just a bit that you think is relevant
as you may not include important details.

At a guess though, I would say it is because you need:

sys.path.append('/var/www')

instead of:

sys.path.append('/var/www/samplewsgi')

Although am at a loss as you why you have:

sys.path.append('/var/www/samplewsgi')
from samplewsgi import app as application

in the first place.

Have you tried with the hello world program at:

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

Graham

Reply all
Reply to author
Forward
0 new messages