How to use a Ceph (or S3) bucket for WordPress uploads
Listed below are the steps I took to use Ceph object store for WordPress media without a plugin. It works by mounting Ceph (or an AWS S3) bucket as a network device on the file system via
s3fs and using
wp-content/uploads/ as the mount path.
s3fs is POSIX compatible, it means you can still access (and manage) the media within
wp-content/uploads/ over SFTP/SSH as if they are natively there.
WP-CLI commands such as
wp media import and
wp media regenerate also still work.
Although your media is being stored and fetched from a network storage bucket, your web server can still resolve all the requests to
wp-content/uploads/ on the local filesystem like normal.
This means that image URLs do not have to be rewritten and will use the core format you're used to over HTTP
https://mysite.com/wp-content/uploads/cat.jpg and any absolute filesystem paths in PHP that may exist `/path/to/wp-content