Announcement

#1 2018-03-05 20:21:31

goldennumber
Member
2018-03-05
12

What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

Hello!

I am looking to host 300,000 large images using Piwigo.

What is the best way to do this using amazon cloud and amazon web services?  Is there a better way to host this?

Are there any companies who install Piwigo on amazon web services?

I program in LAMP--php/mysql--and I am hoping to modify the Piwigo installation once it is installed in the amazon cloud.  Will amazon allow me to do this?

Thanks & Best!

Offline

 

#2 2018-03-19 22:22:59

dlgentle
Member
2017-03-09
12

Re: What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

Also interested... I'm not sure you can upload the whole program, but you would want to have the pictures load to the S3 bucket, then have piwigo find them there from your site.  let me know if you come up with anything.  I tried one on CDN extension that did not work for me.  I have tried to search the forums using CDN, Amazon, s3, and I really have not found any clues...
let me know if you come up with anything and post it here.

thanks,

Don

Offline

 

#3 2018-03-21 10:20:00

Fizban
Member
2018-03-21
2

Re: What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

I just managed to use Cloudflare CDN from external site after hacking the cdnplus plugin. Biggest trouble was that Piwigo seems to like to use relative URLs like ../_data instead of absolute. I had to first resolve the addresses before rewriting. See yourself: https://i.fizban.fi . Note that the site itself is not proxyed (yet) through Cloudflare - only images.

I changed the code without any knowledge of Piwigo nor php. It still has bugs and is certainly not production level.

I'll try the s3 plugin next. I'd like to have final config so that source images and videos are in s3 bucket, thumbnails in web host (or in s3) and the site accelerated with Cloudflare.

Is there any internal switch in Piwigo to use canonical addressing instead of relative?

Offline

 

#4 2018-03-21 11:14:16

teekay
Member
2013-06-12
427

Re: What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

goldennumber wrote:

Hello!

I am looking to host 300,000 large images using Piwigo.

What is the best way to do this using amazon cloud and amazon web services?  Is there a better way to host this?

Are there any companies who install Piwigo on amazon web services?

I program in LAMP--php/mysql--and I am hoping to modify the Piwigo installation once it is installed in the amazon cloud.  Will amazon allow me to do this?

Thanks & Best!

Sure, EC2 + EBS or EFS. You could mount an s3 bucket to the EC2 using s3fs-fuse, too, if performance doesn't matter.

Last edited by teekay (2018-03-21 11:33:01)

Offline

 

#5 2018-03-21 12:36:39

dlgentle
Member
2017-03-09
12

Re: What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

Fizban wrote:

I just managed to use Cloudflare CDN from external site after hacking the cdnplus plugin. Biggest trouble was that Piwigo seems to like to use relative URLs like ../_data instead of absolute. I had to first resolve the addresses before rewriting. See yourself: https://i.fizban.fi . Note that the site itself is not proxyed (yet) through Cloudflare - only images.

I changed the code without any knowledge of Piwigo nor php. It still has bugs and is certainly not production level.

I'll try the s3 plugin next. I'd like to have final config so that source images and videos are in s3 bucket, thumbnails in web host (or in s3) and the site accelerated with Cloudflare.

Is there any internal switch in Piwigo to use canonical addressing instead of relative?

Fizban  Thanks for the details-how did you make the addressing of the images relative?  What doc did you find that code?

thanks, Don

Offline

 

#6 2018-03-22 00:36:27

Fizban
Member
2018-03-21
2

Re: What is the best way to host Piwigo in the amazon cloud? ec2 & s3?

Don,
The addresses ARE relative but they need to be canonical (i.e. they start from root). Go to any page in piwigo instance and the view source. Most of the addresses are in form ../../themes instead of /instance/themes. The cdnplus plugin  just slaps the cdn server and instance in front of any address. It makes e.g. cdn.example.com/instance/../../themes which of course fails.

You can find my hacked version  of one file in cdnplus plugin here: https://web.deva.fi/files/piwigo/ . It tries to convert the relative addresses to canonical before prepending the cdn address to it. Be warned it's incomplete. Some parts still fail, it assumes certain config, e.g. Apply to Theme option has to be off. I got most of my site running with it.

Thinking a bit more, you might have better luck by not using that plugin. Instead use cloudflare so that it completely proxies your source site. Then in theory those relative addresses don't matter. There is more to configure in cloudflare because everything goes through it. But it will also be more effective because t can cache more than a dummy cdn.

Thinkng some more, maybe this works:
Create piwigo at iadmin.example.com .
In cloudflare make the iadmin.example.com as source of xxxxxxxxxxxx distribution. Exclude login and session cookies traveling through. Effectively this is stateless, cached read-only copy of the original site.
Create DNS cname images.example.com pointing to xxxxxxxxxxx.cloudflare.net
Publish the images.example.com as your public site for viewing. This gets huge boost being cached, distributed and proxied through the cloudflare cdn.
Use the iadmin.example.com as your management site.
You need custom certificate if you use https for images.example.com because cloudflare responds to it.

I might try this myself nyt no promises.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact