do-dokku-wordpress
do-dokku-wordpress copied to clipboard
How to persist uploads?
Upload is working until you push an update. They're all gone. :(
Create storage dir for uploads:
cd /var/lib/dokku/data/storage
mkdir MYAPPNAME && cd MYAPPNAME
mkdir uploads
chown -R 32767:32767 .
Mount Storage in App:
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/uploads/:/app/wordpress/wp-content/uploads/
In my case I can't upload any image :(
Error: Failed to load resource: the server responded with a status of 403 (Forbidden) /wordpress/wp-admin/async-upload.php
Any help, please? :S
@jlsuarezs Did you saw my comment and tried it with this storage? Otherwhise it won't work if you don't create a shared volume. You have to pay attention to the rights of that folder too (chown)
Hi! Yes, now is working after change app to MYAPPNAME:
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/uploads/:/MYAPPNAME/wordpress/wp-content/uploads/
My new issue is that I am running in https, when I try to crop the image:
Error: There has been an error cropping your image.
Mixed Content: The page at 'https://MYDOMAIN.com/wordpress/wp-admin/customize.php?return=%2Fwordpress%2Fwp-admin%2F' was loaded over HTTPS, but requested an insecure image 'http://MYDOMAIN.com/wordpress//app/public/uploads/2017/04/image.png'. This content should also be served over HTTPS.
Ouch, how can I fix the SSL issue now? :(
Thank you so much for your help!!
No problem at all :)
Okay I had similar issues. What you should check is first your domain is set everywhere as https:
- check your config this command and see if there is a http instead a https somewhere:
dokku config MYAPPNAME
- add this code snippet to your wp-config.php
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] )
&& 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] )
{
$_SERVER['HTTPS'] = 'on';
}
- check that your wp-config vars contain the env var for domain name and url
define('WP_SITEURL', 'https://'. getenv('DOMAIN_NAME'));
define('WP_HOME', 'https://'. getenv('DOMAIN_NAME'));
and set these env var with (but just use MYDOMAIN.com without protocol):
dokku config:set MYAPPNAME DOMAIN_NAME=MYDOMAIN
Thank you again!
Yes, I've done all this before. Finally this plugin solved the SSL issue completely: Really Simple SSL Plugin
The thing is that I still can't upload any image, after crop I still have the same problem :(
What error message do you get now?
You could also try this plugin to update all your http URLs. It worked quite well for me:
https://de-ch.wordpress.org/plugins/velvet-blues-update-urls/
Hhumm, I think there is something more. I have two issues when I try to customize the theme (appearance > customize) > my session is always expired and the image error: GET https://MYDOMAIN.com/wordpress/wp-content/uploads/2017/04/logo.png 404 (Not Found)
Ohh, found that the uploads folder is not inside wp-content, after move in is working!!
And the correct command is yours:
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/uploads/:/app/wordpress/wp-content/uploads/
So, just to let you know we need to mount 3 folders:
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/plugins/:/app/wordpress/wp-content/plugins/
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/themes/:/app/wordpress/wp-content/themes/
dokku storage:mount MYAPPNAME /var/lib/dokku/data/storage/MYAPPNAME/uploads/:/app/wordpress/wp-content/uploads/
Now I just need to find why the session is always expired when customizing the theme...:S
Thank you!
@jlsuarezs were you able to figure out a solution to the session expiration when customizing your theme issue? I am running into the same thing.