Hi there.
I am running piwigo on a managed server. I do not have access via ssh. I want to serve my images off of AWS S3. It just seems like a logical way to do it. I like the idea of using piwigo. But I can't seem to find a way to use the latest version of teh software and get my upload_dir to point to my AWS bucket.
There must be a way to use my htaccess combined with the config file to make this happen. Can someone out there on this forum point me in a direction? If that were capable, I would think this would be a game changer for the software. There's no open-source, completely free DAMM software that makes organizing images as good as PIWIGO.
Resource space is pretty good, but it maxes out at 10GB for "free' then you have to a paid plan that is crazy expensive.
I am not an AWS engineer; I am a college photo professor trying to make the organization of my student's work manageable. I also don't have a budget, but I am willing to spend money for s3 storage.
I even with the way of using chatbot to help - and almost got there, but the upload direction still points to my domain and does not upload to my AWS and breaks the images
//$conf['upload_dir'] = 'bucketname.s3.amazonaws.com/upload';
my htaccess file
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [L]
RewriteEngine On
RewriteRule ^/upload/(.*)$ https://bucketname.s3.amazonaws.com/ [P]
# Configure AWS S3 bucket
SetEnvIf Host ^example\.com AWS_BUCKET=
SetEnvIf Host ^example\.com AWS_KEY=
SetEnvIf Host ^example\.com AWS_SECRET=
# Serve images from S3 bucket
RewriteCond %{ENV:AWS_BUCKET} !^$
RewriteCond %{ENV:AWS_KEY} !^$
RewriteCond %{ENV:AWS_SECRET} !^$
#RewriteRule ^/upload(.*)$ "https://bucketname.s3.amazonaws.com/$AWS_BUCKET/$1" [L]
RewriteRule ^/upload/(.*)$ https://bucketname.s3.amazonaws.com/ [P]
Please help.
thx
SG
Last edited by smgitner (2023-05-26 21:38:03)
Offline
Honestly? Forget it. Find a decent hosting provider that offers a plan with the storage capacity you need and best with ssh access as well.
But if you insist, take a look at the Wordpress example of https://stackoverflow.com/a/35165332 (adapt to Piwigo of course) and also check the comments and to replace [P] with [R,L]
See also Apache docs on reverse proxy and RewriteRule flags and flag P|proxy and flag R|redirect.
BUT, doing so will only work for serving files, not uploading to Piwigo, so you'd have to find a solution for that. Probably what you're after is a networking file system using S3, but I doubt you'd get that with a managed server that doesn't even offer you ssh access.
Offline
Thanks for the response -- I need to host my images elsewhere because of my server's storage size.
I would think that this option would be valuable to the software. Images are endless, and aws can host images super cheaply.
if someone out there has a solution I am all ears. thank you.
sg
Offline
I suggest you do either of these:
Go to a commercial, low cost web host which offers unlimited disk space (many do).
You can get one for like $180 for 3 years Mine is A2 hosting.
Since you probably have an IT department at your college, maybe you could ask them for a virtual server?
Looks like you already have one. BTW, for managing Piwigo, you really do not need SSH, just FTP and web based file manager will do perfectly fine.You could even do without file manager if you have access to the file system via FTP.
Raj
Offline
I would if I could, but I can't. Getting a new server host is like a year in the making through lawyers and contracts etc. it's crazy ridiculous, but I already have an account Plus, I have to prove the need for this, and I have to ask for money.
Universities are gigantic ocean liners that do not turn on a dime. They are not agile.
sg
Offline