Topic on Project:Support desk

How to store images of Mediawiki on separate servers?

6
Deletedaccount4567435 (talkcontribs)

For example, currently I am using Linode VPS which is expensive and slow. I would like to store image to Amazon S3 or another cheaper VPS.

Now I am using

$wgUploadDirectory = "/wiki/image"; 
$wgUploadPath = "//static.mengniang.org"; 

to enable CDN from different domain.

However, the images still store at the same VPS with Mediawiki software. How to let mediawiki upload and load image to a separate servers?

Ciencia Al Poder (talkcontribs)

When you upload a file to MediaWiki, it stores it in $wgUploadDirectory, and when a page containing that image is rendered, the URL of the image points to $wgUploadPath. You need something to make MediaWiki upload that file to Amazon. See Extension:AWS or Extension:LocalS3Repo

Deletedaccount4567435 (talkcontribs)

Ok thank you. And how about different server? How can I store image on a different server?

Ciencia Al Poder (talkcontribs)

You could mount a remote filesystem on the local server using NFS, but that may not work on servers not placed on the same local network.

Another way would be to continue storing images locally, and have some sort of proxy cache (in $wgUploadPath address) for when a image is requested, if it doesn't exist, request the image to your wiki server and store it locally, so next requests for that image serve the saved image instead of requesting it again to your wiki. But that would be problematic if you upload a new version of the same image, since it would not notice the update, unless it's intelligent enough to periodically check if a new version of the file exists.

Deletedaccount4567435 (talkcontribs)

Thank you Ciencia Al Poder!

I tried the Network File System but the delay is toooooo large when using different location server. Now we are using multiple squid proxy which works good so far. However this does not solve the local storage problem, which means we still need to spend lots of money for Linode's disk space.

RainDelay (talkcontribs)

I would also find it incredibly useful to store all user uploaded images on a different server. Is there anyway to do that besides mounting the remote file system using NFS?

Reply to "How to store images of Mediawiki on separate servers?"