Simple open source Libravatar compatible avatar image server written in PHP.
- Delivers images for email addresses and OpenIDs
- Very easy to setup.
- No graphics processing is done on the server, keeping the CPU load low. All avatar images get pre-generated for a set of sizes
- If no image at the user requested size is found, the next larger image gets returned.
- Supports the
mmfallback image (mystery man)
Adjust the config file to your needs
(optional) Create a default image and put it into the raw folder, name it
Setup your web server and set the document root to the
www/directory. Make sure you allow the
.htaccessfile and have
Add DNS entries for
_avatars-sec._tcp. A bind config file excerpt would look like this:
_avatars._tcp.example.org. IN SRV 0 0 80 avatars.example.org _avatars-sec._tcp.example.org. IN SRV 0 0 443 avatars.example.org
This makes the avatar server
avatars.example.orgresponsible for the domain
example.org, on ports 80 (HTTP) and 443 (HTTPS).
It is possible to use an existing domain as avatar server.
avatar.php into its document root dir and copy the rewrite rule
.htaccess into the domain's
.htaccess file if one exists.
If not, copy the whole
After that, you have to point the
$cfgFile path at the beginning of
avatar.php file to the correct location.
Put images in
raw/folder. Name has to be email address + image file extension, for example
email@example.com. Surrogator supports
For OpenIDs, use the url-encoded URL + extension as filename, for example replace
%2F. The filename for
php surrogator.php. The small files get generated.
You will get more information with
When you run
surrogator.phpagain, it will only generate small files when the raw file is newer than the "square" file in the var folder. You can force the update with
To check if everything is setup correctly, try the following tools:
- Libravatar domain check tool for DNS resolution tests
- Libravatar server check tool for image resolving tests
Surrogator is licensed under the AGPL v3 or later.
Written by Christian Weiske, firstname.lastname@example.org