Clone this wiki locally
QuickThumbs is an image gallery that generates it’s self automatically based on
files on your drive – there is no database to maintain.
QuickThumbs is implemented as an HttpModule. This allows us to
intercept requests for directory listings and images and override them with our
pretty gallery pages.
In apache we use
SetHandler Mono in a
to tell apache to forward all requests to mono (More information).
Mono then sees that we have specified an HttpHandler (in web.config) and pushes
the request off to it.
QuickThumbs is an ASP.NET 1.x application. The ASP.NET 2.0 API is not used.
QuickThumbs with Apache/mod_mono
- Install dependencies
$ sudo apt-get install libmagick9 libexif12
- Get the code
makefrom inside the
$ cd quickthumbs $ cd src $ makeThe compiled files will be placed in the web directory.
$ sudo apt-get install mono-xspStick some images in the ‘web’ directory and run ‘xsp’ from within there.
$ cd ../web $ xsp Listening on port: 8080 Listening on address: 0.0.0.0 Root directory: /home/eric/sources/quickthumbs—mainline/web Hit Return to stop the server.Then point your browser to http://127.0.0.1:8080 and make sure all looks good before moving on to setting up apache.
- Set up your apache website
/var/www/mysite/images/. Be sure to include any dot/hidden files.
$ cp -a ../web/* /var/www/mysite/images/You will need to fix permissions (Replace
www-datawith whatever user your webserver runs as):
$ sudo chown www-data /var/www/mysite/images/bin/dataYou now need to configure this directory as a mono application root. The man page for xsp explains how to do this, but in a nutshell, there are two ways to do this. You can either add a line to your apache configuration:
MonoApplications "/images/photos:/var/www/mysite/images/Or, preferably, create a .webapp file in the appropriate directory. In Ubuntu, this directory is
/etc/mono-server/. For example, I have the following in
Eric’s QuickThumbs Gallery /images /var/www/eric.extremeboredom.net/images eric.extremeboredom.netAgain, the xsp man page and the URLs above explain all this in detail.
$ man xspOnce everything is configured, restart apache and browse to the directory using your web browser.
$ sudo /etc/init.d/apache2 restartNote that it might take a while to load each directory the first time because it has to generate thumbnails and gather metadata.
Here are some general suggestions to troubleshoot problems with QuickThumbs:
Make sure that the user your webserver runs as has write-access to the
$ cd /var/www/eric.extremeboredom.net/images/
$ sudo chown -R www-data bin/
(Replace www-data with the username apache runs as on your system.)
Enable QuickThumbs Debugging
You can add &debug=yes to the end of a URL to have QuickThumbs display the
debug log at the bottom of the page.
Enabling Mono Debugging
You can add the following line to your apache configuration to have apache
execute mono in debug mode.
With this enabled, in the event of an error mono will be able to show the line
number that it occurred on in the error output, which makes it much easier to
debug. Please always do this before contacting me.
You will need to restart apache after modifying the configuration.