[Support] kru-x - wordpress


Recommended Posts

Hi!

 

I am running this docker very flawlessly, so great!

 

My only issue, is with updates. When it says that a new update is available and I click update, after the update it puts back the "-p 80:8080" mapping (which I have removed). I have quite a few containers, so it is a bit time consuming to remove it, click ok, and then go to edit and remove and click OK again.

 

I also have many MariaDB containers and I have also removed the port-mapping there, but it's only the Wordpress docker that puts these back. When mariadb updates, i just have to click update and then that's it..

Any idea how I can make the Wordpress container behave the same way so I don't have to edit and remove the port-mapping for every docker, every time there is an update?

 

 

Link to comment
12 hours ago, ingarb said:

Hi!

 

I am running this docker very flawlessly, so great!

 

My only issue, is with updates. When it says that a new update is available and I click update, after the update it puts back the "-p 80:8080" mapping (which I have removed). I have quite a few containers, so it is a bit time consuming to remove it, click ok, and then go to edit and remove and click OK again.

 

I also have many MariaDB containers and I have also removed the port-mapping there, but it's only the Wordpress docker that puts these back. When mariadb updates, i just have to click update and then that's it..

Any idea how I can make the Wordpress container behave the same way so I don't have to edit and remove the port-mapping for every docker, every time there is an update?

 

 

Hi ingarb,

 

I understand what you are saying but not why ;-), 

It works like this, first time you add a container you download a/my template (in this case my WP), then as soon as you save it, it is saved in a template directory with all your modified settings, any subsequent use should use the modified template, do you delete the templates in between? I don't get it,

 

Also why would you try to remove the port mapping, 80 is the port inside the container to communicate with the "outside world" and the port you add is the port you communicate with from the outside. How are you doing it otherwise?

 

Kru-x 

Link to comment
On 9/17/2020 at 8:06 AM, ingarb said:

Hi!

 

I am running this docker very flawlessly, so great!

 

My only issue, is with updates. When it says that a new update is available and I click update, after the update it puts back the "-p 80:8080" mapping (which I have removed). I have quite a few containers, so it is a bit time consuming to remove it, click ok, and then go to edit and remove and click OK again.

 

I also have many MariaDB containers and I have also removed the port-mapping there, but it's only the Wordpress docker that puts these back. When mariadb updates, i just have to click update and then that's it..

Any idea how I can make the Wordpress container behave the same way so I don't have to edit and remove the port-mapping for every docker, every time there is an update?

 

 

The only "reason" that I can see to remove the port mapping for the webUI is that you are running the container on it's own IP address.  In this case, it's more or less irrelevant whether or not that port mapping is present or not, as it's ignored anyways.

 

Ideally you shouldn't be removing the mapping, but if you do want to remove it and have that survive updates do this

 

https://forums.unraid.net/topic/57181-docker-faq/page/2/?tab=comments#comment-894170

 

Link to comment
4 hours ago, Squid said:

The only "reason" that I can see to remove the port mapping for the webUI is that you are running the container on it's own IP address.  In this case, it's more or less irrelevant whether or not that port mapping is present or not, as it's ignored anyways.

 

Ideally you shouldn't be removing the mapping, but if you do want to remove it and have that survive updates do this

 

https://forums.unraid.net/topic/57181-docker-faq/page/2/?tab=comments#comment-894170

 

Thanks for that explanation Squid, didnt know that,

 

Kru-x 

Link to comment

Hey all. I'm pretty pumped about being able to run my own websites off of my Unraid server. What started off as a Plex server has blossomed. :)

 

So I've tried several things to be able to host my own sites. Everything seemed so complicated until I stumbled on this thread and NginxProxyManager was suggested.  Very easy to use, except I'm not able to access my website. I'm just curious if someone could help me answer some questions where guides/videos were not able to.

 

Should Wordpress docker be run in host, bridge or custom? I created a custom 'proxynet' while following a spaceinvader guide for LetsEncrypt before going the NPM route.

 

Here is what the docker page shows for port mappings (app to host) 

172.18.0.3:80/TCP<>192.168.86.66:4000

 

Here is what I have set up on NPM

765010974_ScreenShot2020-09-21at1_20_59PM.thumb.png.f07bbdb7864597cc72571e3f8860fec5.png

 

394466682_ScreenShot2020-09-21at1_20_50PM.thumb.png.0560b612c64b93a525e73ebff2b22309.png

 

If I type in http://192.168.86.66:4000 into the browser I can get in. If I type ajpointgod.com it does not. It gives me the Congratulations screen for NPM. What am I missing?

Edited by dancue
Link to comment
2 hours ago, dancue said:

Hey all. I'm pretty pumped about being able to run my own websites off of my Unraid server. What started off as a Plex server has blossomed. :)

 

So I've tried several things to be able to host my own sites. Everything seemed so complicated until I stumbled on this thread and NginxProxyManager was suggested.  Very easy to use, except I'm not able to access my website. I'm just curious if someone could help me answer some questions where guides/videos were not able to.

 

Should Wordpress docker be run in host, bridge or custom? I created a custom 'proxynet' while following a spaceinvader guide for LetsEncrypt before going the NPM route.

 

Here is what the docker page shows for port mappings (app to host) 

172.18.0.3:80/TCP<>192.168.86.66:4000

 

Here is what I have set up on NPM

765010974_ScreenShot2020-09-21at1_20_59PM.thumb.png.f07bbdb7864597cc72571e3f8860fec5.png

 

394466682_ScreenShot2020-09-21at1_20_50PM.thumb.png.0560b612c64b93a525e73ebff2b22309.png

 

If I type in http://192.168.86.66:4000 into the browser I can get in. If I type ajpointgod.com it does not. It gives me the Congratulations screen for NPM. What am I missing?

HI dancue,

Personally I run all my containers in Bridged mode, but I know many is using Spaceinvaders guide and are using a "proxynet" that creates a separate "internal" network. Many swear by it and I have read that it might be better for a proxy routing traffic.

 

Having said that, only ones I have had the need to use a specific separate network and even then later on I switched back to bridge mode again and got it working. For me it is just easier to use one network as I know exactly what the different IPaddresses are on each box (i got two servers).

 

You don't need to add a "custom location" as per your screen shots otherwise it looks right and as for your setup, I guess you installed WordPress from your internal ip address and not on your Domain name, eg remove both the WP and MariaDB's folders and add the two containers again, then check if you can see WP's installation page on your local address but without starting the install, then try to connect to it from your domain name and do the install from there.

 

Hope it helps,

Kru-x

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

HI dancue,

Personally I run all my containers in Bridged mode, but I know many is using Spaceinvaders guide and are using a "proxynet" that creates a separate "internal" network. Many swear by it and I have read that it might be better for a proxy routing traffic.

 

Having said that, only ones I have had the need to use a specific separate network and even then later on I switched back to bridge mode again and got it working. For me it is just easier to use one network as I know exactly what the different IPaddresses are on each box (i got two servers).

 

You don't need to add a "custom location" as per your screen shots otherwise it looks right and as for your setup, I guess you installed WordPress from your internal ip address and not on your Domain name, eg remove both the WP and MariaDB's folders and add the two containers again, then check if you can see WP's installation page on your local address but without starting the install, then try to connect to it from your domain name and do the install from there.

 

Hope it helps,

Kru-x

I figured out the issue. There is a setting in wordpress under Setting > General where I had to change the site address. (For anyone curious, I changed both wordpress and site address). All is good with that now.

 

Another question though... If I want to create more than one wordpress website can I create another wordpress docker pointing to a different port?

Link to comment

I'm getting an error when trying to upload a theme. "The link you followed has expired." Through research I found that I need to create a php.ini file. Where am I dropping this file? Where is the public html folder?

 

I feel like the docker install page should have the option to specify the limits. I can't seem to find a php.ini file at all. 

Edited by dancue
Link to comment
27 minutes ago, dancue said:

I'm getting an error when trying to upload a theme. "The link you followed has expired." Through research I found that I need to create a php.ini file. Where am I dropping this file? Where is the public html folder?

Hi,

The root folder is the one you created when you added the container, as per below "/mnt/user/appdata/wordpress-temp/".

image.thumb.png.ae6969f16ea69ba3498bfb92f4843bac.png

 

The php.ini is not there by default but you can add one. I have had more success with .htaccess method to increase the upload limit.
Kru-x

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

Hi,

The root folder is the one you created when you added the container, as per below "/mnt/user/appdata/wordpress-temp/".

image.thumb.png.ae6969f16ea69ba3498bfb92f4843bac.png

 

The php.ini is not there by default but you can add one. I have had more success with .htaccess method to increase the upload limit.
Kru-x

I swear I tried that folder. I had a file that looked like _.php which I deleted and then put the new php.ini file. It works now. Thanks for validating that.

 

Is this file going to get deleted on an update?

 

Link to comment
1 minute ago, dancue said:

I swear I tried that folder. I had a file that looked like _.php which I deleted and then put the new php.ini file. It works now. Thanks for validating that.

 

Is this file going to get deleted on an update?

 

Nahhh, it will only replace a file that is missing but not overwriting. So your _.php might pop up again, not that I know what that is , never seen one myself.

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

Nahhh, it will only replace a file that is missing but not overwriting. So your _.php might pop up again, not that I know what that is , never seen one myself.

Thanks. I think it was a corrupt file when I initially tried to import the php.ini.

 

Last question. I asked earlier but it must have gotten looked over. If I want to create more than one wordpress website can I create another wordpress docker pointing to a different port? Is that how that should work?

 

 

 

Link to comment
6 hours ago, dancue said:

Thanks. I think it was a corrupt file when I initially tried to import the php.ini.

 

Last question. I asked earlier but it must have gotten looked over. If I want to create more than one wordpress website can I create another wordpress docker pointing to a different port? Is that how that should work?

 

 

 

I gave it a shot. It worked but this is what I did...

  1. I created a new database in MariaDB and granted permissions to my user.
  2. I added the docker with a different Port number.
  3. I modified the wp-config.php file to change the database name to what I created in step 1 above.
  4. I dropped in the php.ini file.
  5. Setup the domain in NginxProxyManager
  6. Navigated to DomainName.com and installed wordpress.

Does that sound about right? Is there something else I should have done?

Edited by dancue
Link to comment
2 hours ago, dancue said:

I gave it a shot. It worked but this is what I did...

  1. I created a new database in MariaDB and granted permissions to my user.
  2. I added the docker with a different Port number.
  3. I modified the wp-config.php file to change the database name to what I created in step 1 above.
  4. I dropped in the php.ini file.
  5. Navigated to IP:NewPort and installed wordpress.

Does that sound about right? Is there something else I should have done?

You can create as many instances of WordPress as you like and it seems you have figured it out, create different containers with different ports and that should be it. Seems like you are confident enough to change user permission and wp-config.php, that is good if you are but in a basic setup you shouldn't need to, the MariaDB is accessed by WP as root user with full privileges and the installation takes care of the directions in the wp-config.php file, both if you just use the regular settings in the template. 

 

And just a side note, if you start the install from the internal ip address that is the address that is used, might be easy enough to change b4 you have done any changes or added any pages but if you work a bit on the site and then wants to get it on a domain address you are in for a ride, much of the internal working of WP is relying on the info in the DB. I always suggest to do a clean install from the domain name and work from there, if there is a site you have worked on or a development instance, move it to the clean instal of that domain by using a plugin, I always use "Duplicator Pro".

 

Kru-x

Edited by Kru-x
Link to comment
29 minutes ago, Kru-x said:

You can create as many instances of WordPress as you like and it seems you have figured it out, create different containers with different ports and that should be it. Seems like you are confident enough to change user permission and wp-config.php, that is good if you are but in a basic setup you shouldn't need to, the MariaDB is accessed by WP as root user with full privileges and the installation takes care of the directions in the wp-config.php file, both if you just use the regular settings in the template. 

 

And just a side note, if you start the install from the internal ip address that is the address that is used, might be easy enough to change b4 you have done any changes or added any pages but if you work a bit on the site and then wants to get it on a domain address you are in for a ride, much of the internal working of WP is relying on the info in the DB. I always suggest to do a clean install from the domain name and work from there, if there is a site you have worked on or a development instance, move it to the clean instal of that domain by using a plugin, I always use "Duplicator Pro".

 

Kru-x

I noticed that they all tried to install to the 'wordpress' database. I HAD to go to the wp-config.php file and change the database there. Unless I missed something. Also.. if I can provide some feedback... when you change the port for the container from the default 8080 clicking on the docker container and selecting webUI will take you to port 8080 instead of what you changed it to.

 

Thanks for the side note. I did have issues yesterday but what I started doing was adding a step between 4 and 5. (I'll edit my previous post to reflect that...) Before doing the install I go into NginxProxyManager and set it up for the website in question. Then I go on to install Wordpress. I do it at that time because I need to know the port number to set up in NPM and if I go on to install before doing that then in wordpress under Settings > General the website will have the IP web address instead of the URL. That was the mistake I made the first time around. It took me a while to figure out but I changed that to the domain name and it fixed the issue. All of my websites have been accessible outside of my local network.

Link to comment
6 minutes ago, dancue said:

I noticed that they all tried to install to the 'wordpress' database. I HAD to go to the wp-config.php file and change the database there. Unless I missed something. Also.. if I can provide some feedback... when you change the port for the container from the default 8080 clicking on the docker container and selecting webUI will take you to port 8080 instead of what you changed it to.

 

Thanks for the side note. I did have issues yesterday but what I started doing was adding a step between 4 and 5. (I'll edit my previous post to reflect that...) Before doing the install I go into NginxProxyManager and set it up for the website in question. Then I go on to install Wordpress. I do it at that time because I need to know the port number to set up in NPM and if I go on to install before doing that then in wordpress under Settings > General the website will have the IP web address instead of the URL. That was the mistake I made the first time around. It took me a while to figure out but I changed that to the domain name and it fixed the issue. All of my websites have been accessible outside of my local network.

Sounds like you are only using one instance of a MariaDB, whilst you could, I always make a new instance of the database eg. so two containers for each site ex wp-temp & wp-temp-MariaDB. Makes it much easier to fire one site up and delete it when needed.

 

The "issue" with the webUI, it should auto change to the port that you add in the template, if not you can change it your self in advance view and correct the  WebUI: http://[IP]:[PORT:8080]/ it works the same with all containers in unraid.

 

Kru-x

 

 

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

Sounds like you are only using one instance of a MariaDB, whilst you could, I always make a new instance of the database eg. so two containers for each site ex wp-temp & wp-temp-MariaDB. Makes it much easier to fire one site up and delete it when needed.

 

The "issue" with the webUI, it should auto change to the port that you add in the template, if not you can change it your self in advance view and correct the  WebUI: http://[IP]:[PORT:8080]/ it works the same with all containers in unraid.

 

Kru-x

 

 

ahah. I didn't think of looking at advanced. 

 

Great idea on one database and wordpress per website. I'll have to weigh the pros and cons to see if it's worth it to go that route or just keep it the way I have it now. Theoretically, I could delete the database via phpmyadmin. The biggest headache for having all of them on one MariaDB container is that when I need to make a change to the container (in this case... the webUI port) I will need to edit that wp-config.php file again.

 

Anyways. Thanks for your help and advice. I feel more confident about hosting these sites now. Exciting.

Link to comment
4 hours ago, dancue said:

Hmm. Interesting. I went into advanced and changed the port but it did not route it properly. Still went to 8080. 

Then it is that you installed WP on your local ip address first, it's WordPress that redirects to the same ip that it was installed on.

To explain what I believe is happening, during installation WP created an index.php page (the homepage) that have a an address of IP:8080 and saves that info in to the database. And even if you change the site's domain he will still redirect to domain:8080. That's why I always recommend installing from your domain first.

 

Kru-x

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

Then it is that you installed WP on your local ip address first, it's WordPress that redirects to the same ip that it was installed on.

To explain what I believe is happening, during installation WP created an index.php page (the homepage) that have a an address of IP:8080 and saves that info in to the database. And even if you change the site's domain he will still redirect to domain:8080. That's why I always recommend installing from your domain first.

 

Kru-x

Ahh. What if I change it in the index.php file?

 

Link to comment

Just finally got around to setting this up. Was already running containers for MariaDB, phpmyadmin, and Letsencrypt(I switched from Traefik 2 to Letsencrypt using Spaceivader's guide when I moved to unraid).

 

For you other Letsencrypt people, here's the process. It was as simple as opening phpmyadmin and creating a new user "wordpress" and selecting to also automatically create a database with all privileges. Install the wordpress container, giving the database info I just created in phpmyadmin. For databse server info, I give it MariaDB's internal ip and port, and place the wordpress container on the Custom:proxynet, same as all of my containers. I also copy whatever internal IP MariaDB was assigned when I set it up, and tell MariaDB to use that as a fixed IP, so it doesn't change on me and break things. Then in the Letsencrypt/nginx "proxy-confs" folder, make the file wordpress.subdomain.conf, and fill it with:

 

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name mydomain.com; #change this to your domain or subdomain

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_app wordpress;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        proxy_max_temp_file_size 2048m;
    }
}

Then open the site and do the standard wordpress setup. You'll notice I use my primary domain without a subdomain and it works perfectly fine. Just make sure the Letsencrypt container is not set to "subdomains only = true". Also, it is VITAL that you clear your browser's cache, or wordpress may keep redirecting your front page, to a page not found. At least it did for me(kept sending my to mydomain.com/ui/dashboard). And that's it, everything should work fine.

 

Of course, I have not yet started messing with any of the more complex themes/plugins/addons I want to use. Hopefully they all work without issue.

Link to comment
20 hours ago, dancue said:

Ahh. What if I change it in the index.php file?

 

Wish it was that easy, 🙂

 

But all references to pages, post, comments etc. are saved into the Database (thats how WordPress do much of it's workings), thats why it is better to start from scratch or you have to find all those faulty references in the DB manually. As I have mentioned in previous posts, there is good programs (plugins) that will do this for you if you have a site already or is working in a development environment.

 

Kru-x   

Edited by Kru-x
Link to comment
  • 4 weeks later...
57 minutes ago, cracksilver said:

Hi there

 

I have a fresh installation of wordpress docker. Everything is working inside mit network over http.

 

As soon as I try to get https access from outside via NginxProxyManager, it doesn't work. Even when I try over http.

 

Is there something to configurate in the config files from WP?

 

Thx

gregor

Did you install WordPress from you domain or local?

Kru-x

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.