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.

I am currently trying to run a simple BottlePY site on Apache2 but am getting an Internal Server Error.

Here is the config file for the site

<VirtualHost *:80>
    ServerAdmin removed@removed.com
    ServerName removed.org
    DocumentRoot /sites/bottlepy

    # WSGI Settings
    WSGIScriptAlias / /sites/bottlepy/wsgi_handler.py
    WSGIDaemonProcess bottlepy user=sreustle group=general processes=1 threads=10
    WSGIProcessGroup bottlepy

    # Static Directories
    Alias /static /sites/bottlepy/static/
    <Location "/static">
            SetHandler None
    </Location>

</VirtualHost>

And this is wsgi_handler.py

import os
import bottle

os.chdir(os.path.dirname(__file__))
sys.path.append(os.path.dirname(__file__))

application = bottle.default_app()

It could be a few things going wrong, but I'm not sure how to debug apache. Could I get some suggestions on how to debug this? Thanks a lot!

Edit: Here is a screenshot of the bottom of my error log. http://i.imgur.com/3CH3V.png

Edit: Added updated wsgi_handler

share|improve this question
    
Is there anything in /var/log/apache2/error.log? –  Paul Tomblin Aug 6 '10 at 0:01
    
You could take a 'black-box' approach and comment everything out. Then start uncommenting things one at a time until you figure out what causes the problem. Once you figure out what causes the problem, try and research that. –  Zoredache Aug 6 '10 at 0:03
    
Error logs: i.imgur.com/3CH3V.png wsgi_handler.py having trouble importing the bottle.py file in same dir. –  Shane Reustle Aug 6 '10 at 0:05

2 Answers 2

up vote 0 down vote accepted

The bottle package is not installed in the Python 2.6.5 installation that mod_wsgi is compiled against and which it is using.

Where did you install 'bottle'?

You either need to install it in Python 2.6.5 system wide site-packages directory, or ensure that any local Python packages directory or your own is setup in mod_wsgi configuration or your WSGI script file.

See the mod_wsgi documentation for further information:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

share|improve this answer

Check the Apache error log - I think it's in /etc/apache2/logs/error.log or /var/www/error.log on ubuntu by default but I'm not sure. That should tell you what's going on.

share|improve this answer

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.