0

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

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19
  • Is there anything in /var/log/apache2/error.log? – Paul Tomblin Aug 06 '10 at 00: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 06 '10 at 00:03
  • Error logs: http://i.imgur.com/3CH3V.png wsgi_handler.py having trouble importing the bottle.py file in same dir. – Shane Reustle Aug 06 '10 at 00:05

2 Answers2

0

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.

James L
  • 6,025
  • 1
  • 22
  • 26
0

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

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19