[Support] kru-x - wordpress


Recommended Posts

15 hours ago, Kru-x said:

Have you given the user "wordpress" full read and write access to the "wordpress" db in mariadb? Sounds like you haven't,

According to the linuxserver version of mariadb github readme the created user has superuser access to the created database. So I would assume it does.

Switching to the Mariadb Offical fixed the issue but I don't see why the linuxserver version is have the issue to begin with.

Link to comment
On 2/4/2023 at 9:13 AM, Kru-x said:

Hi sjoerd,

 

I can follow your thinking and I wonder myself, but WordPress updates internally and gets updated on the fly, thus you always have the latest version keeping it like it is. Guess they update the docker container for a new install. I think you get in to more trouble to do it that way, than not.

 

Question back, as I see that you are installing new instances. Do you get a problems in "Site Health" on a new install? Eg. open tools/settings/Site Health and see if you get any recommendations of faults, I have a few pesky ones that I don't know how to solve. like "The REST API encountered an unexpected result" & "your site could not complete a call back", doing my head in!


Regards,

Kru-x

 

Mmm  - sitehealth of both is "good" -

But both still run locally and I disabled REST for security purposes. You have no idea, well I think you have :-), how many hack attempts occurs each day. I run the wp-cerber plugin and wrote a little bash script around it to get all suspicious attempts and dump those ip-address into my opnsense router. What needs to configured correctly is the url. Mixing internal and external url gives errors therefor my current vm (migrating to docker + vm once my new hardware arrived - still running my new unraid-server as testphase on a trial-key with old hardware) can only be reached through the external url - hooray for the ngnix reverse proxy docker 🙂 - I might need to tinker with the docker-setting and change http://[IP]:[PORT:8080]/ to something hardcoded 🙂

Link to comment
On 2/4/2023 at 9:31 AM, Kru-x said:

And after reading your post thoroughly :~(): the container only copies the files the first time to the folder, any subsequent restart docker leaves the existing files and only adds files missing, thus if something changes in the file docker will not override it. But then as you said you should leave all file AS IS except for the wp_content, so you have a point.

 

The read and write access will be different in the container and WordPress wouldn't be able to update the files internally so the internal update would not work, you would have to wait until the container is updated I believe, so you would most likely get in to heaps of problems and I wouldn't recommend it, but then I am not an expert so I could be wrong.

 

Kru-x

 

Mmm - I see,

Still weird way - static eq. immutable data should be in the image, but it is true that wordpress updates on the fly. Maybe I need to revert my changes -

Link to comment
On 2/6/2023 at 10:59 AM, Kronos_ said:

Hi I have an issue where I get "Cannot select database". I'm using a second instance of mariadb from linux server (other one is being used by nextcloud). I'm not sure what the issue is as it says the username and password are correct but that it can't access the database still. Thanks in advance. sorry If I'm just doing something dumb.

 

 

Hey,

 

Not sure if this helps but I had same kind of issue.

I took the following steps:

* created a new docker network (docker network create web) - could be docker create network web (can't remember)

* installed phpmyadmin from linuxserver (networktype: web) -> make sure PMA_ARBITRARY is set to 1

* installed mariadb from linuxserver (networktype: web)

* with phpmyadmin 1) create the wordpress database with user/password and 2) then import your wordpress sql backup. Name of the server is the name of the mariadb container - default is "mariadb" - because both are in "web" they should see each other by hostname - if you go to phpmyadmin console you should be able to ping mariadb

 

 image.png.063cd9e7300582efd45c8b85678cb5ec.png

 

* install wordpress container (networktype: web) if the import of you wordpress backup went well you can just fill in the server, database, user and password.

* if you have an existing wordpress install scp the wp-content of the site to the new site (and do a chown sshd:sshd -R ./wp-content after because after the scp action it like owned by root (my actions at least did that)

* when that is done - all urls in your post are probably wrong. You can fix them with

 

image.png.7369baa1abd25a86cc96719db26b80e2.png

 

* when you are done stop the phpmyadmin container - Only start it when you actually need it. It's a very powerful but also very destructive tool.

 

Edited by sjoerd
Link to comment
13 hours ago, sjoerd said:

 

Mmm - I see,

Still weird way - static eq. immutable data should be in the image, but it is true that wordpress updates on the fly. Maybe I need to revert my changes -

I stand corrected!

 

Just playing with the container bitnami/wordpress-nginx and they do exactly what you are suggesting and they know what they are talking about, so I am for sure wrong in my assumptions. Haven't given it much thought before and has not seen the need for it but might have to reconsider.

 

Kru-x

  • Like 1
Link to comment
13 hours ago, sjoerd said:

 

Mmm  - sitehealth of both is "good" -

But both still run locally and I disabled REST for security purposes. You have no idea, well I think you have :-), how many hack attempts occurs each day. I run the wp-cerber plugin and wrote a little bash script around it to get all suspicious attempts and dump those ip-address into my opnsense router. What needs to configured correctly is the url. Mixing internal and external url gives errors therefor my current vm (migrating to docker + vm once my new hardware arrived - still running my new unraid-server as testphase on a trial-key with old hardware) can only be reached through the external url - hooray for the ngnix reverse proxy docker 🙂 - I might need to tinker with the docker-setting and change http://[IP]:[PORT:8080]/ to something hardcoded 🙂

I am about to build a woo-commerce site and believe I need it for that, thought bitnami/wordpress-nginx would help me but to no avail. Ill keep looking,

Kru-x

  • Like 1
Link to comment

Keep me posted - I was about the revert my own changes but I'll keep it the way it is for the moment.

 

Edit:

I can confirm that "hard-coding" the web-address works (as expected):

 

image.png.90859589e28895ffec29b0ba1ec9a827.png

 

It might be a bit out of scope to explain how to set this up, but is wordpress is suppose to be accessible from the outside. Couple of steps are necessary:

 

  • Add a new CNAME to your domain. This might take a while for it to work - depending where the domain is registered.
  • Setup the nginx reverse proxy manager (add a proxy-host) to point to the external side of the docker. In my case that's 10.34.51.55:8080. This address:port directs to the wordpress container. Also add the following lines to the nginx custom configuration for the proxy
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-For $http_x_forwarded_for;
    proxy_set_header  X-Forwarded-Proto $scheme;
    

     

  • Replace the WordPress- and Site Address to the new address (http since https is not configured yet)

  • At this point you could replace the WebUI url with the new http address so you can check if it works
  • When you can reach the http address just fine, you can configure nginx to add a let's encrypt certificate. Quite easy: Go to the proxy-host in nginx, selected the SSL tab and request a new one for the url. Check "Force SSL", "HTTP/2 support" and "HSTS enabled". You also might want the check "Block common exploits" on the first tab. The request takes a couple of seconds. Important is that let's encrypt can reach the site from the outside though port 80.
  • When this is done you need to update the WebUI url and the two url's in WordPress to https.
  • When you can reach the site though https, you need to replacement the url's that are everywhere in your posts, links etc. I used blue velvet url replacement plugin. I might be possible to you have added (or the theme editor) urls into sections the plugin does not or can not look - to make sure everything is coming from the url you can use the network inspector of the browser (usual F12 brings up developer stuff)

 

Sidenote:

nginx proxy manager does not run on my unraid server but as a lxc container (from the exact same image) on my router that is running proxmox with opnsense and hassio as vm and pihole and the nginx proxy manager as lxc container.. I do too much tinkering with unraid and pihole and nginx are a bit too "mission critial" as is opnsense, to be down (well according to my kids and wife)

 

Pictures say more than 1000 words so here they are:

image.png.d962ee45bc0ee6e26af9ff7834b2fa06.png

 

image.png.91c24ba3b92f41977642fa9d88bf3890.png

 

image.png.88f5e1ba5583c4e6a3883b43e5bbae0d.png

 

 

Edited by sjoerd
Link to comment
  • 1 month later...

Hi,

 

I'm trying to make it accessible via Cloudflare Tunnel but it doesn't work and I don't know why.

 

My configuration:
UnRAID home server on which I have :

  • Cloudflare docker (status is Healthy)
  • Worpress + Maria DB

Wordpress is on 192.168.1.xx:8050 and works locally.

 

I added a subdomain pointing to this address (HTTP), and I tried with “No Happy Eyeballs” enabled, then disabled

 

But it doesn’t work. After a while, there is ERR_CONNECTION_TIMED_OUT on https: //sub.domain:8050.

I don’t know if the problem comes from Wordpress or Cloudflare.

 

I already have 2 other public hostnames that work fine (nextcloud and searchXNG), and I remember I had to edit a config.php file in Nextcloud to get it to work, maybe it’s the same for Wordpress but I couldn’t find any documentation about it…

 

Do you have any idea what I could check?

Link to comment
47 minutes ago, zarkoff said:

Do you have any idea what I could check?

 

I run cloudflared directly on the server. I do this so can use the Cloudflare VPN client to access my local network even if the array is stopped. Here is my script if you want to use it.

 

I also run Wordpress. In Zero Trust, I have it set to HTTP and localhost:8050.

Link to comment

Hello, 

 

Thanks for the script, I will take a look at it.

 

Right now my cloudflare tunnel works as a container (and it works fine for Nextcloud), but I'll see with your script if I can do it differently.

 

So you created a subdomain by entering HTTP and localhost:8050 and it works?

 

Did you configure something in wordpress in the interface or a configuration file somewhere?

 

for example in this screen ?

image.png.a39e8fe9fef386eff124f7dfad4ebde0.png

Edited by zarkoff
Link to comment

Ok I answer to myself, it could help someone else.

 

here is how to proceed in Dockerized Wordpress and Cloudflare Zero Trust Tunnel (if you don't want to use reverser proxy)

  • install mariadb container (I took the official one)
  • install wordpress container BUT don't run it !!
  • update cloudflare zero trust tunnel redirection (http + localhost:port, no other option to change)
  • go to your subdomain et force url to be sub.domain.com/wp-admin/install.php
  • the initial setup can be done (langage, ...)

And voila, it should work.

Edited by zarkoff
Link to comment

I need help. Each time I go to my URL for my website it keeps taking me to the install screen for choosing language. I choose language again and it says already installed continue to log in. It does this every time I go to my URL. I don't know what I have set up wrong but any help would be appreciated.

Link to comment
5 hours ago, Jurak said:

I need help. Each time I go to my URL for my website it keeps taking me to the install screen for choosing language. I choose language again and it says already installed continue to log in. It does this every time I go to my URL. I don't know what I have set up wrong but any help would be appreciated.

Hi Jurak,

 

Odd, have you tried to log in from another system (InPrivate window) sounds like a cache problem to me. Or if not it is most likely a DB problem, is it pointing to an empty DB the first time you install?

 

R

Kru-x

Link to comment
On 4/2/2023 at 2:18 PM, Kru-x said:

Hi Jurak,

 

Odd, have you tried to log in from another system (InPrivate window) sounds like a cache problem to me. Or if not it is most likely a DB problem, is it pointing to an empty DB the first time you install?

 

R

Kru-x

Sorry been locked out of my forum account. Im now back. For some reason that day I left to spend time with my kid and when I got back it was working correctly.

Thanks for your help.

edited for misspelling

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

I'm very new to everything, Just trying to experiment with new stuff(Unraid in General). Installed the Wordpress Docker and MariaDB... Tried to open the WebUI to Wordpress but it just redirects me to my Tower's Main page? Reinstalled it a few times and for some reason it was redirecting me to my Adminer's Webui when i tried to open my Wordpress UI...... 

Figured out typing 192.168.1.78:8080/wp-admin/ takes me to the start up page, but going to just simply http://192.168.1.78:8080 does nothing...... Also when i try to use my NginxProxyManager to direct said webui to my domain for others to see(What I've been doing with other dockers) it does not work....  What exactly am i doing wrong?

Link to comment
3 hours ago, Aehryn said:

I'm very new to everything, Just trying to experiment with new stuff(Unraid in General). Installed the Wordpress Docker and MariaDB... Tried to open the WebUI to Wordpress but it just redirects me to my Tower's Main page? Reinstalled it a few times and for some reason it was redirecting me to my Adminer's Webui when i tried to open my Wordpress UI...... 

Figured out typing 192.168.1.78:8080/wp-admin/ takes me to the start up page, but going to just simply http://192.168.1.78:8080 does nothing...... Also when i try to use my NginxProxyManager to direct said webui to my domain for others to see(What I've been doing with other dockers) it does not work....  What exactly am i doing wrong?

Hi Aehryn,

 

You most likely installed it locally and has a reference in the DB to port 80 (Tower's Main page default port). Its fine to install it locally (port dependent) when you only using it locally but not so when wanting to use it behind a revers proxy. Remove containers and make it work with the proxy b4 you install it from the WP installation screen. Browse through previous posts in this thread, its problem people run in to often.

 

R

Kru-x

Link to comment
  • 3 weeks later...

Hello guys,

 

I have a issue with wordpress and nginx proxy manager.

I have installed wordpress and changed the external ip to 8179 as I have qbittorent on 8080. installed without any issue.
When I access webUI on wordpress it goes to the webUI of qbittorrent on port 8080. If I input 8179 manually it goes to wordpress. I need to change the port somewhere else on wordpress appdata?
I have a subdomain in nginx that goes to port 8179 but it doesn't work, it gives "This site can’t be reached IP refused to connect.". I have other subdomains pointing to plex and other programs and those work.

Someone who knows this problem can help me?

chrome_gRQ0XwyaWN.png

chrome_vFMM3jV1vo.png

Link to comment
4 hours ago, Drago Prime said:

Hello guys,

 

I have a issue with wordpress and nginx proxy manager.

I have installed wordpress and changed the external ip to 8179 as I have qbittorent on 8080. installed without any issue.
When I access webUI on wordpress it goes to the webUI of qbittorrent on port 8080. If I input 8179 manually it goes to wordpress. I need to change the port somewhere else on wordpress appdata?
I have a subdomain in nginx that goes to port 8179 but it doesn't work, it gives "This site can’t be reached IP refused to connect.". I have other subdomains pointing to plex and other programs and those work.

Someone who knows this problem can help me?

chrome_gRQ0XwyaWN.png

chrome_vFMM3jV1vo.png

Hi Drago Prime,

 

Did you install WordPress locally and then tried to add it to Nginx Proxy manager? One of the biggest problem people have with this docker, the easiest is to delete WordPress & DB folders, then make sure you can reach the WP installation screen on your domain b4 you install WP.

 

Hope it helps,

 

Kru-x

Link to comment

WordPress recently wants an FTP access to update plugins and themes, I'm thinking somehow it lost permissions to write to the necessary directories.

 

ls -la /path/to/wordpress

 

986142108_Screenshot2023-05-08at9_26_47PM.thumb.png.64e2eb3a420692e7069c504f0175dea7.png

 

any advise on restoring permission to default? i'm thinking something like;

 

sudo chown -R nobody:nobody /mnt/user/appdata/wordpress
sudo find /mnt/user/appdata/wordpress -type d -exec chmod 755 {} \;
sudo find /mnt/user/appdata/wordpress -type f -exec chmod 644 {} \;


send help @Kru-x

 

Link to comment
2 hours ago, Tolete said:

WordPress recently wants an FTP access to update plugins and themes, I'm thinking somehow it lost permissions to write to the necessary directories.

 

ls -la /path/to/wordpress

 

986142108_Screenshot2023-05-08at9_26_47PM.thumb.png.64e2eb3a420692e7069c504f0175dea7.png

 

any advise on restoring permission to default? i'm thinking something like;

 

sudo chown -R nobody:nobody /mnt/user/appdata/wordpress
sudo find /mnt/user/appdata/wordpress -type d -exec chmod 755 {} \;
sudo find /mnt/user/appdata/wordpress -type f -exec chmod 644 {} \;


send help @Kru-x

 

Hi Tolete,

 

Yes it is usually a read and write permission issue, check "Health Check" In WordPress, it will tell you what access it is missing. Cant remember exactly what permission WP requires but a quick google search on the subject will tell you.


Regards,

Kru-x

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

Hi Tolete,

 

Yes it is usually a read and write permission issue, check "Health Check" In WordPress, it will tell you what access it is missing. Cant remember exactly what permission WP requires but a quick google search on the subject will tell you.


Regards,

Kru-x

 

filesystem.permissionss.png.2d25ff139876b58a23954f773dab3274.png

 

never that simple, site shows directories are writable?

 

POSSIBLE FIX:

changing/correct the ownership and permissions, this did not fix my issue. BUT if you have jacked up your permissions this will get you back to 'stock'. Running, and testing permissions fix did not solve my issues.

 

sudo chown -R nobody:nobody /mnt/user/appdata/wordpress
sudo find /mnt/user/appdata/wordpress -type d -exec chmod 755 {} \;
sudo find /mnt/user/appdata/wordpress -type f -exec chmod 644 {} \;

 

THE FIX:

Adding the following lines to the "wp-config.php" file in the WordPress installation directory:

 

define('FS_METHOD', 'direct');
define('FS_CHMOD_DIR', 0777);
define('FS_CHMOD_FILE', 0777);

This will force WordPress to use the "direct" method for updating plugins and themes, and set the directory and file permissions to 0777, which allows all users to read, write, and execute the files and directories.

 

After adding code to my wp-config.php and re-testing solved my issue.

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

Hello all,

 

I have wordpress up and running locally and setup. The issue is when I add it to Nginx Proxy Manager and connect through a subdomain. I get the error "This site can’t be reached subdomain.domain.com took too long to respond. ERR_CONNECTION_TIMED_OUT" How do I fix this?

 

Edit: Figured it out using https://forums.unraid.net/topic/88258-support-kru-x-wordpress/?do=findComment&comment=1226261

Edited by xTrinity
Solution
Link to comment
  • 3 weeks later...
  • 1 month later...
On 5/9/2023 at 7:14 PM, Tolete said:

 

filesystem.permissionss.png.2d25ff139876b58a23954f773dab3274.png

 

never that simple, site shows directories are writable?

 

POSSIBLE FIX:

changing/correct the ownership and permissions, this did not fix my issue. BUT if you have jacked up your permissions this will get you back to 'stock'. Running, and testing permissions fix did not solve my issues.

 

sudo chown -R nobody:nobody /mnt/user/appdata/wordpress
sudo find /mnt/user/appdata/wordpress -type d -exec chmod 755 {} \;
sudo find /mnt/user/appdata/wordpress -type f -exec chmod 644 {} \;

 

THE FIX:

Adding the following lines to the "wp-config.php" file in the WordPress installation directory:

 

define('FS_METHOD', 'direct');
define('FS_CHMOD_DIR', 0777);
define('FS_CHMOD_FILE', 0777);

This will force WordPress to use the "direct" method for updating plugins and themes, and set the directory and file permissions to 0777, which allows all users to read, write, and execute the files and directories.

 

After adding code to my wp-config.php and re-testing solved my issue.

 

had a similar issue with my wordpress setup and I have followed the steps and it was still "not-writable"

turns out I had to go to the container's console window and reassign the "www-data" user back, because for some reason it has changed to root and 99.

afterwards I added your wp-config lines and Voila! everything is back to work as intended.

thanks!

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.