![]() This configuration will run /usr/local/bin/thumbor (i.e. ![]() Using your favorite text editor (vim and nano come pre-installed on Ubuntu or you can install another editor), add the following configuration to rvice. cd /lib/systemd/systemĪs superuser, create a rvice file. This directory contains the service files for systemd. ![]() Navigate to the /lib/systemd/system directory. This is much more reliable than relying on user intervention to start Thumbor. If the VM is restarted, the Thumbor process will automatically restart as well. You will be configuring systemd to automatically start Thumbor on VM boot. systemd makes it easy to configure when services (processes) run. Systemd is the "system and service manager" for Linux operating systems. This step is important for production sites, but optional if you're just playing around with Thumbor. This step explains how to make sure that the Thumbor process keeps running, even after the VM has been restarted. In particular, you may be interested in setting up a Thumbor configuration file. The Optimize images with Thumbor article has more information on using the Thumbor API. You can replace the image in the URL string (i.e., ) with any other image (e.g., ) and Thumbor will resize that image too. Thumbor has taken the image hero.jpg and size specified in the URL string and served the result. You should see an image that is 100 pixels wide by 100 pixels tall. Thumbor uses HTTP by default but can be configured to use HTTPS. Try it out by visiting the following URL: Note that this URL uses HTTP. Thumbor is now accessible and ready for use. Note that for Google Cloud you need to first assign a static IP address to your VM and then allow an external HTTP connection. Here's more information on how to do this for: Google Cloud, AWS, and Azure. However, this probably won't work for you (yet) because cloud providers usually require that you explicitly open firewall ports before they will accept incoming traffic. If your VM's IP address is 12.123.12.122, then you would access Thumbor from the web browser at $IMAGE. Open Firewall Port #īy default, Thumbor runs on port 8888. ![]() Debug logging is optional but can be helpful when you're getting started. If you've successfully installed Thumbor, this should work: thumbor -help Run Thumbor # If you choose to use virtualenv, note that Thumbor requires Python 2.7 and will not work with newer versions of pip (e.g., these instructions use pip 8.1.1). If you are installing Thumbor in a standalone environment, virtualenv is not necessary. For the sake of simplicity, these instructions do not use virtualenv. Note: Many Python developers use virtualenv to manage their packages. Sudo apt-get install -y libjpeg-dev libpng-dev libwebp-dev webp Install Thumbor # Sudo apt-get install -y python-opencv libopencv-dev # image format packages Sudo apt-get install -y libcurl4-openssl-dev libssl-dev # computer vision packages Thumbor's documentation does not explicitly mention these dependencies, but Thumbor will not install successfully without them. Install pip, the package manager for Python. Update and upgrade Ubuntu's already-installed packages: sudo apt-get update -y & sudo apt-get upgrade -y This post assumes that you know how to create a Ubuntu 16.04 LTS VM on a cloud platform like Google Cloud, AWS, or Azure and how to use command line tools to set up the VM. If dependencies download quickly, the installation can be completed in 5 to 10 minutes. Although easy to use, Thumbor is notoriously difficult to install but these instructions simplify the process. Creating a VM might sound like more work than installing Thumbor on your local machine, but the minutes that you take to create a VM will probably save you hours or days of frustration trying to get Thumbor to properly install on your local machine. Ubuntu 16.04 is a very common image and these instructions are intended to work on any cloud provider. You'll be installing Thumbor on a VM running Ubuntu 16.04. Once installed, you'll be able to use Thumbor as an API for transforming your images. This guide explains how to install Thumbor on your own server. It's suitable for production use Wikipedia and Square both use Thumbor. Unlike most image CDNs, Thumbor is open-source and can be used for free to resize, compress, and transform images. Image CDNs make it easy to dynamically optimize the aesthetics and performance of your images.
0 Comments
Leave a Reply. |