[Support] kru-x - wordpress


Recommended Posts

3 hours ago, Kru-x said:

 

Hi SPOautos,

You are on the right track in your understanding. I can only tell you how I work and what I found best, I am sure others would have different opinions. But wordpress works as if you add a page or any redirects to a page/photo/shopping basket or whatever, it saves that value or "link" in the database, so if you have it installed on 192.168.1.100:8080 thats the pointer that is saved.

 

You have to convert those values to the right ones as in the link you refer to if you move/migrate the site. The easiest way I find and the plugin that I use is "Duplicator Pro", it is to move my site around either way, production to develop or the opposite, it works great, it is a small cost but it saves you a lot of headaches. It will convert all the links and copy the DB and the whole site in one, easy as. You just have to fire up a new wp container on any machine and wipe the folder clean, add the files from Duplicator pro and it will automatically install the whole site with the right url's. Kru-x

 

Thank you! I'm investigating the Duplicator plugin. All the how to's are for windows. I guess this will be pretty much the same though.

 

So basically when I get ready to load in the Duplicator installation and archive files I just do it on a brand new WP container....so by doing this often (probably weekly) I'd just delete a container when Im done testing and next week install the WP container again? But when I install it dont set anything up because Duplicator will do everything, I just tell it the new URL and it loads the website with the correct url based on which server I'm installing on. (If moving to here I tell it ip:port and if moving from here to live host I tell it the url)

 

Would I also need to reinstall the Mariadb each week when I want to move my website here to test? Or will it just overwrite whatever is there from the previous week?

Link to comment

Ok, as some constructive feedback - 

What can we do to fix the consistent database connection issues that are prevalent with this container?  

 

Specifically what I'm referring too is that if the variables in the container lists support for the ability to specify host port, db name, db user, db password, for all intents and purposes i would expect said variables to work.

But the consistent thread is that they dont and we should 'leave them blank' instead.  

 

So we either need to work out why they aren't working, or remove them from the template and specify on the readme accordingly.

 

What would be the better route forward for this do you think?

 

To be clear, I'm willing to help with some testing if it helps improve the container for others. 🙂

Edited by boomam
Link to comment
4 hours ago, SPOautos said:

 

Thank you! I'm investigating the Duplicator plugin. All the how to's are for windows. I guess this will be pretty much the same though.

 

So basically when I get ready to load in the Duplicator installation and archive files I just do it on a brand new WP container....so by doing this often (probably weekly) I'd just delete a container when Im done testing and next week install the WP container again? But when I install it dont set anything up because Duplicator will do everything, I just tell it the new URL and it loads the website with the correct url based on which server I'm installing on. (If moving to here I tell it ip:port and if moving from here to live host I tell it the url)

 

Would I also need to reinstall the Mariadb each week when I want to move my website here to test? Or will it just overwrite whatever is there from the previous week?

The plugin is WP specific and wont bother about what operating system you have, and/or it is all linux anyway when you are working with a docker container.

 

You dont need a new container, it just depends on how many instances you need. Duplicator overwrites everything, even the DB. You just remove/delete all files from your WP root folder and put the two files exported from Duplicator, then you open the installation.php in your browser and follow the instructions. Duplicator will change everything needed. Takes a few minutes.

 

I Duplicate my live site onto my laptop where I have my "development" setup, where all my WP development is a plugin. The plugin I install in to a fresh WP instance on my Unraid server for testing or beta. I also copy the whole site from time to time, I have had up to three different isntances on my unraid server to test them in between. Just use as many as you like or only one, work with Docker on all my comuters, same setup everywhere. Work great, just took me some time to get my head around docker now I love it, increadible powerfull the whole concept.

Kru-x

Link to comment
1 hour ago, boomam said:

Ok, as some constructive feedback - 

What can we do to fix the consistent database connection issues that are prevalent with this container?  

 

Specifically what I'm referring too is that if the variables in the container lists support for the ability to specify host port, db name, db user, db password, for all intents and purposes i would expect said variables to work.

But the consistent thread is that they dont and we should 'leave them blank' instead.  

 

So we either need to work out why they aren't working, or remove them from the template and specify on the readme accordingly.

 

What would be the better route forward for this do you think?

 

To be clear, I'm willing to help with some testing if it helps improve the container for others. 🙂

Hi Booman,

 

I love constructive feedback, thank you. There is a biiig problem with the container and the template, that is that it is too many options and as you said you can choose to leave them blank or fill them in. That makes for confusion.

 

I should possibly remove the DB specific varibles and let people figure out the WP installation, then the problem is going to be the DB side of it and that is equally confusing.

 

If you look at https://hub.docker.com/_/wordpress/ there is tons of setting and options, what and what not should we use?

 

I think the best "route forward" would be to have a good turtorial eg. "Spaceinvader" style and I have also suggested that for him. I should maybe have done one myself and added it to the first post, but I am usless at that and am flat out with other stuff (and asnwering this thread) ;-) 

 

You tell me, what do you think would be esiest, remove them or not?

 

Kru-x

Link to comment
  • 1 month later...
On 12/16/2020 at 1:35 AM, Kru-x said:

Hi dancue,

 

You need to read up a bit on how Docker works, then you will understand the setup better. You should not edit the files in the container as those files are changed every time you update or restart, the /var/www/html path is inside the container and has nothing to do with Forklift that is a ftp/ssh client that you can connect too Unraid with. You can use the Console (click on the WordPress icon) in Unraid to connect into the container, but much of the time you shouldn't need to, and changes there would definitely change during restart or update.

 

You say "copying the wp-config file" but i guess you mean overwrite. It is odd and maybe ask in the general docker container forum (https://forums.unraid.net/forum/47-docker-containers/) why a file is being is overwritten it shouldn't be, I don't know and cant understand why it is.


Sorry I can't give you an answer,


Kru-x 

 

 

Ok. I understand where you are coming from but I think the solution to this would be to provide an option in the docker container settings to input the WORDPRESS_DB_NAME. Just like we enter WORDPRESS_DB_USER: and WORDPRESS_DB_PASSWORD:.

 

The reason why I say that is because it is updating only the value of the Wordpress db name. Anything else I add to the wp-config file stays and no changes are made. That leads me to believe that the values are updated, not the actual file. For example... I added the following line to the wp-config file... "define('NGG_UPLOAD_LIMIT', 1);" and it stayed untouched in the file after an update and reboot but the database name went back to the default value.

 

With that said, can we get an update to the container to specify the Wordpress db name like we have the username and password?

 

EDIT: I think I may have found a solution. I created a new variable in the docker container settings. Had no idea this would work as I just tried it out of desperation but after a restart the value stayed. We'll know on the next docker update if it for sure stays. I've attached some images of how I set up the variable and what it looked like after setting it up. Hopefully anyone else that stumbles on this issue and this thread will benefit as well.

Screen Shot 2021-02-23 at 9.58.10 AM.png

Screen Shot 2021-02-23 at 9.56.48 AM.png

Edited by dancue
Found a solution.
Link to comment
On 1/18/2021 at 3:23 PM, Kru-x said:

Hi Booman,

 

I love constructive feedback, thank you. There is a biiig problem with the container and the template, that is that it is too many options and as you said you can choose to leave them blank or fill them in. That makes for confusion.

 

I should possibly remove the DB specific varibles and let people figure out the WP installation, then the problem is going to be the DB side of it and that is equally confusing.

 

If you look at https://hub.docker.com/_/wordpress/ there is tons of setting and options, what and what not should we use?

 

I think the best "route forward" would be to have a good turtorial eg. "Spaceinvader" style and I have also suggested that for him. I should maybe have done one myself and added it to the first post, but I am usless at that and am flat out with other stuff (and asnwering this thread) ;-) 

 

You tell me, what do you think would be esiest, remove them or not?

 

Kru-x

I think a tutorial would be great. I like being able to control those variables in the docker settings rather than going in the config files. In my specific case, having a tutorial would have saved me headache. I had no idea I could add a variable to specify database name. Now that I know and set it up I definitely don’t want that taken away.

Edited by dancue
Link to comment
  • 2 weeks later...

If anyone wondering why your docker instance is not working / error connecting to the database after installing:

 

You need to manually create the database in your mariadb. The docker container will not do this for you. 

 

After you've created the empty database, then in your docker setup, add variable 

WORDPRESS_DB_NAME = your-database-name

 

  • Like 1
Link to comment
  • 4 weeks later...

Can someone talk me through how to change the max upload limit via htaccess or otherwise - I would traditionly edit the php.ini within wp-admin, but while I can create the file, editting it through the unraid console is challenging - no vi, nano or similar that I can find.

 

Maybe I am being dense here but could use a hand! 

 

TIA.

Link to comment
1 hour ago, LewJ said:

Can someone talk me through how to change the max upload limit via htaccess or otherwise - I would traditionly edit the php.ini within wp-admin, but while I can create the file, editting it through the unraid console is challenging - no vi, nano or similar that I can find.

 

Maybe I am being dense here but could use a hand! 

 

TIA.

Hi LewJ,

 

I use the htaccess method and there is several articles about it, just google it. I guess the bigger issue is how to edit files in WP (or any other containers) and it is quite easy, you just ssh in to unraid and edit any file in your favorite editor. 

 

So if you are on Mac, I used "Fork Lift" as my ssh client to find and work with the files, and edit them with "Visual Studio Code" now in windows I use only VS-code as there is an ssh client as a plugin. 

I use the unraid console all the time, but it is only for finding files, peeking in to containers etc.

 

Actually found this https://www.a2hosting.com/kb/developer-corner/php/using-php-directives-in-custom-htaccess-files/setting-the-php-maximum-upload-file-size-in-an-htaccess-file it's for a hosting company but it explains the whole workflow with ssh as well, just as we do it for our own "hosting server".

 

Hope that explains,

Kru-x

Link to comment
  • 2 weeks later...

Kru-x, you mentioned a while a go to me that your preference is to have one Mariadb per Wordpress container. I was doing one Mariadb for ALL of my wordpress containers. It inevitably bit me in the ass and so I wanted you to know, and anyone else for that matter, that a Mariadb container per wordpress site is a MUST in my book.

 

One of the databases became corrupt and as a result all of my websites were down for an extended period of time. Had I followed your advice it would have been isolated to just one container. Instead I lost all of my databases. (another lesson learned, database backups daily)

 

Lessons learned the hard way. 

Link to comment
11 hours ago, dancue said:

Kru-x, you mentioned a while a go to me that your preference is to have one Mariadb per Wordpress container. I was doing one Mariadb for ALL of my wordpress containers. It inevitably bit me in the ass and so I wanted you to know, and anyone else for that matter, that a Mariadb container per wordpress site is a MUST in my book.

 

One of the databases became corrupt and as a result all of my websites were down for an extended period of time. Had I followed your advice it would have been isolated to just one container. Instead I lost all of my databases. (another lesson learned, database backups daily)

 

Lessons learned the hard way. 

Hi Dancue,

 

Thanks for letting us know and I am sorry to hear about your mishap. But on the same note I am glad that I gave a good advice (even if it was not followed ;-).

 

You are not the only one that have wanted to run one DB, but I never got that as it is simpler and more workable with one for each, I have always set it up that way. I also backup my DB every 6hours and WP-folder once a day(really an overkill but it doesn't cost anything so why not).

 

Just be aware that you should really (if you have lots of traffic or vital data) not do it this way, if something change during the backup it can become corrupt. You should take a DB dump and back that up instead. I don't bother too much as my site is low traffic and if it miss a beat ones a while it wont bother me too much, hope that wasn't the case.

 

Otherwise how is it working (when it works)?

 

Kru-x

Link to comment
11 minutes ago, Kru-x said:

Hi Dancue,

 

Thanks for letting us know and I am sorry to hear about your mishap. But on the same note I am glad that I gave a good advice (even if it was not followed ;-).

 

You are not the only one that have wanted to run one DB, but I never got that as it is simpler and more workable with one for each, I have always set it up that way. I also backup my DB every 6hours and WP-folder once a day(really an overkill but it doesn't cost anything so why not).

 

Just be aware that you should really (if you have lots of traffic or vital data) not do it this way, if something change during the backup it can become corrupt. You should take a DB dump and back that up instead. I don't bother too much as my site is low traffic and if it miss a beat ones a while it wont bother me too much, hope that wasn't the case.

 

Otherwise how is it working (when it works)?

 

Kru-x

I’m doing a backup daily and then incremental backup of files every 4 hrs. Using UpdraftPlus and backing up to Google drive. Don’t want to go through what I went through this past week. Lol

 

Running one mariaDB per has been good so far. It seems faster also. 
 

Thanks for the advice again. 

Link to comment

Hi,

I'm trying to configure this Docker with mariadb.
This is my actual configuration: image.thumb.png.7675b1bad702dd43ede5398743a19de3.png

 

When I use the Docker UI button it takes me to the 8080 port, and when I change it to the one I put, I get the Database Error I've read here.

I checked he wp-config.php and the wp-config-docker.php files and they don't have any info from the docker form above.
When I edit them I only get an error that I need admin rights.

I'm a newbie, I only have Unraid from a week or so but as I have read and watched, I think this should work.

What am I doing wrong?
Thanks in advance

Link to comment
2 hours ago, Fonso_s said:

Hi,

I'm trying to configure this Docker with mariadb.
This is my actual configuration: image.thumb.png.7675b1bad702dd43ede5398743a19de3.png

 

When I use the Docker UI button it takes me to the 8080 port, and when I change it to the one I put, I get the Database Error I've read here.

I checked he wp-config.php and the wp-config-docker.php files and they don't have any info from the docker form above.
When I edit them I only get an error that I need admin rights.

I'm a newbie, I only have Unraid from a week or so but as I have read and watched, I think this should work.

What am I doing wrong?
Thanks in advance

Hi Fonso_s,

Great choice and welcome to the community. 

What DB are u using? MariaDB? Try to leave the DB user & password blank. It's most likely the privileges to the DB, they must be right. On a new install off the MariaDB the user is "root" and the password non. If u want to use your own you have to set them "as per your template" in the DB. 

 

Hope that helps and let me know if it won't work.

Kru-x 

Link to comment
9 hours ago, Kru-x said:

What DB are u using? MariaDB? Try to leave the DB user & password blank. It's most likely the privileges to the DB, they must be right. On a new install off the MariaDB the user is "root" and the password non. If u want to use your own you have to set them "as per your template" in the DB.

I had installed MariaDB for NextCloud, I created a new user and a new DB in the same docker following this Spaceinvader one video.

Should I create the database and the user with the same name? or should I install another mariadb docker just for this WP?


Thanks in advance.

 

Link to comment
1 minute ago, Fonso_s said:

I had installed MariaDB for NextCloud, I created a new user and a new DB in the same docker following this Spaceinvader one video.

Should I create the database and the user with the same name? or should I install another mariadb docker just for this WP?


Thanks in advance.

 

Are you using the same DB as nextcloud? I suggest that you use a separate DB for each container eg one for the WordPress container.

 

Just add a new mariaDB container with a different port then leave the user and password blank in the WP template (of course adjust for the ip and port). Then WP will be able to connect to the DB with as the "root" user and it will create the DB base named "wordpress" inside the MariaDB automatically.

 

Please read through previous threads, you got a lot of similar problems that you have, explained.

 

Let me know how it goes,

 

Kru-x

Link to comment
1 minute ago, Kru-x said:

Are you using the same DB as nextcloud? I suggest that you use a separate DB for each container eg one for the WordPress container.

No, I created a new table.
 

Quote

Just add a new mariaDB container with a different port then leave the user and password blank in the WP template (of course adjust for the ip and port). Then WP will be able to connect to the DB with as the "root" user and it will create the DB base named "wordpress" inside the MariaDB automatically.


I'll do this.

Thanks!

Link to comment

Hi


Sorry for my incompetence.

 

I'll describe what I've done but I still have the DB Error.

I've instaled a new mariadb instance, an left it like this:

 image.thumb.png.30696f7798e18fecad8a9e198ec0c56e.png

 

After that, I configured I tried to methods, first I mounted a new WP docker but it didn't worked.
I cleaned all up and Installed again the mariadb, entered through console and create a new wordpress database, here you can see the TablePlus info:

 image.png.d37e52f213d025924c552560493548fc.png 

After that I created again another WP docker like this: image.thumb.png.a29818454cc1069e7ec4f6bbfafbb8a1.png


As I said, I still have the "Error establishing a database connection".

Here it is the resume form the Docker panel:

image.thumb.png.a509e8d75f96f0331e020a293c12e128.png

I've read this thread several times, but I still can't figure out what I am doing wrong.
Thanks for your help.

Link to comment
26 minutes ago, Fonso_s said:

Hi


Sorry for my incompetence.

 

I'll describe what I've done but I still have the DB Error.

I've instaled a new mariadb instance, an left it like this:

 image.thumb.png.30696f7798e18fecad8a9e198ec0c56e.png

 

After that, I configured I tried to methods, first I mounted a new WP docker but it didn't worked.
I cleaned all up and Installed again the mariadb, entered through console and create a new wordpress database, here you can see the TablePlus info:

 image.png.d37e52f213d025924c552560493548fc.png 

After that I created again another WP docker like this: image.thumb.png.a29818454cc1069e7ec4f6bbfafbb8a1.png


As I said, I still have the "Error establishing a database connection".

Here it is the resume form the Docker panel:

image.thumb.png.a509e8d75f96f0331e020a293c12e128.png

I've read this thread several times, but I still can't figure out what I am doing wrong.
Thanks for your help.

It looks right what you have done, did you delete the WP folder in between since you try to install the first time. IMPORTANT

 

It was av while since I did it , but you shouldn't need to add the wp DB/table manually. WP takes care of that on installation.

 

Also you could try to add in the mariaDb template the root password. Eg set the password "mypass" and the in the Wp template add "root" as user and "mypass" as password.

And as you seem confident using Table Plus, you can always create a user manually and give that user full access and add that to the WP template but there you have to give that user full unrestricted access.

Kru-x 

Link to comment

I'm using CA Cleanup Appdata to clean everything between tries.

I've tried creating a password in the mariadb docker and setting the root user with the password and it didn't change anything.

image.thumb.png.3d0487a015f38cb23174443992a3c24f.pngimage.thumb.png.ceabe3af9f1722bbe7fc9bb1e60190ea.png

 

Thanks for all your help, I'm goin to  try using portainer to get this running.

Thanks for your time.

Link to comment

Some months ago i used this topic to run a wordpress container, and i recall walking through a step by step description (like spaceinvaders tutorials) on how to add the mariadb, how to create the db etc but i can't seem to find it anymore? Is there a step by step tutorial anywhere on how to set up a new wordpress site on unraid?

Link to comment
On 4/21/2021 at 6:14 AM, Fonso_s said:

I'm using CA Cleanup Appdata to clean everything between tries.

I've tried creating a password in the mariadb docker and setting the root user with the password and it didn't change anything.

image.thumb.png.3d0487a015f38cb23174443992a3c24f.pngimage.thumb.png.ceabe3af9f1722bbe7fc9bb1e60190ea.png

 

Thanks for all your help, I'm goin to  try using portainer to get this running.

Thanks for your time.

Hi Fonso_s,


Did you ever get it up and running?  I just today realized that the WordPress container has change and now wont create the DB as I told you. You where on the right track and I have now added the WORDPRESS_DB_NAME to the template. Sorry for all the headaches.

 

Kru-X 

Link to comment
On 4/24/2021 at 10:25 PM, jowi said:

Not what i was looking for but i found a tutorial in the french section that had the info i needed: 

 

Thanks' for that Jowi, good tutorial and even if you don't understand French (as me) it shows the settings.

Kru-X

  • Like 1
Link to comment
5 hours ago, Kru-x said:

Hi Fonso_s,


Did you ever get it up and running?  I just today realized that the WordPress container has change and now wont create the DB as I told you. You where on the right track and I have now added the WORDPRESS_DB_NAME to the template. Sorry for all the headaches.

 

Kru-X 

 

Hi Kru-X,

 

Yesterday I cleaned up everything, and tried again, this time I used an exclusive mariadb docker with a custom user and password and the database named "wordpress".

I did it twice and I got it running both times, each time with a exclusive docker for both wp and db.

 

Now I want to try make them public to the internet.

 

Thanks for your help.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.