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


And this is wsgi_handler.py

import os
import bottle


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

  • 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

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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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