0

Desired Behaviour

Allow Bottle routes to handle requests for images in the format:

<img src="/gridfs/img/my_image.jpg">

On the server, this is being handled by a Bottle route and returning the image as expected:

@route('/gridfs/img/<filename>')
def server_gridfs_img(filename):
    # get the image
    # return it

Current Behaviour

In a local environment however, with mod_wsgi set up, I am getting the error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80

What I've Tried

This is my local mod_wsgi configuration:

WSGIPythonHome /var/www/html/ENV
WSGIPythonPath /var/www/html:/var/www/html/ENV/lib/python2.7/site-packages:/var/www/html/wsgi
<VirtualHost *:80>

# for all content in static folder - css, js, img, fonts
Alias /static/ /var/www/html/wsgi/static/

# for rockmongo administration
Alias /rockmongo /var/www/html/rockmongo

<Directory /var/www/html/rockmongo>
Order deny,allow
Allow from all
</Directory>

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    WSGIScriptAlias / /var/www/html/wsgi/application

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

This is my /var/www/html/wsgi/application:

from mybottleapp import application

Directory

enter image description here

Question

The rest of the routes in my application seem to be being honored.

It doesn't seem that Bottle is handling the requests for images like /gridfs/img/my_image.jpg though.

How can I make that happen?

UPDATE

Looked at Apache error log and saw this:

CorruptGridFile: no chunk #1

I am troubleshooting that now...

user1063287
  • 10,265
  • 25
  • 122
  • 218

1 Answers1

0

I posted the solution to the updated situation mentioned above here:

How to mongodump from OpenShift and mongorestore locally on MongoDB 2.4.9?

The data corruption was caused from exporting and importing with RockMongo - apparently sometimes there can be issues with this approach and larger data sets.

Community
  • 1
  • 1
user1063287
  • 10,265
  • 25
  • 122
  • 218