[Support] kru-x - wordpress


Recommended Posts

9 minutes ago, tr0910 said:

Ok, I just deleted the mariaDB passwords from the WP container setup and suddenly it works.  WP is installed and the dashboard is up now. 

 

Is that what you do with passwords for setup.  Ignore them?

The 0 in the MariaDB setting is telling the container to not use a password (blank) for the root user, WP is trying to login to the DB with the password 0 that you used as password in hence it didn't work. You can set a password, if other then 0, then you have to add the same password in the WP template.

 

Kru-x

Link to comment
17 minutes ago, tr0910 said:

Ah OK, thanks for pointing me in the right direction.  Once I can spin up a WP site repeatedly without error, I'll move on to getting NPM to work.

No worries,

 

Just remember to start the installation of WP after you got the NPM to work and can connect to the site by your domain. Else WP is going to try to redirect to your internal IP, you gona get the same problem when you are moving your sites if you are not careful. Best is to use a plugin to migrate your whole site, ill use "Duplicator Pro" for moving my sites around when needed.


Kru-x

Link to comment
3 hours ago, Alex.b said:

I don't know why but after each restart of Wordpress docker, database name in wp-config.php is set to wordpress.

Hi Alex,

 

Its most likely wordpress doing it or you have problems with your share folder. Docker compares the share folder To the one inside the container, if the file is missing he adds it else he wont. Docker wont overwrite any existing files. I would ask in a WP forum,

 

Kru-x

Link to comment
5 hours ago, Alex.b said:

That’s weird because it replace only the variable database name. The rest of the file remains intact. I don’t understand why the docker try to create a database 


MySQL "CREATE DATABASE" Error: Access denied for user 'alex'@'%' to database 'wordpress'


WARNING: unable to establish a database connection to '192.168.1.9:3306'

continuing anyways (which might have unexpected results)

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.10. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.10. Set the 'ServerName' directive globally to suppress this message
[Fri Jul 17 00:49:36.149182 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.8 configured -- resuming normal operations
[Fri Jul 17 00:49:36.149222 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

 

Hi Alex.b

 

I think you are misunderstanding and I am not sure what you are trying to do. Change DB name? Why. The log you see is the log of WP not docker. During the first install WP is loging in to the MariaDB with the root privilege and creating a database inside with the name "wordpress" and user "alex" and setting up privileges for that user, then subsequent login WP is using "alex" as user and "alex" has no privileges to create a database only read and write into that DB, it is only "root" that has that privilege of "CREATE DATABASE".

 

The best way to understand it is to login to MariaDB with a database software and look at the database within, privileges & users, with that you could create a database logged in as root and then set privileges to alex, but still I don't know what you are trying to do and there is not any real reasons to change the database name I can think of.

 

Kru-x 

Link to comment
On 7/16/2020 at 12:56 AM, tr0910 said:

Ah OK, thanks for pointing me in the right direction.  Once I can spin up a WP site repeatedly without error, I'll move on to getting NPM to work.

@Kru-x NPM is installed and available.  But when I attempt to request a cert for a private domain already forwarded to my ip address, I get interenal error from NPM. 

 

I suspect that I may have port 80 and 443 being blocked by my no name ISP.  I have those ports forwarded in my router, and the NPM congratulations page is never displayed.  I can torrent (with unRaid Transmission docker) over this ISP, so not everything is blocked.

 

Is this likely my problem? 

Edited by tr0910
Link to comment
3 hours ago, tr0910 said:

@Kru-x NPM is installed and available.  But when I attempt to request a cert for a private domain already forwarded to my ip address, I get interenal error from NPM. 

 

I suspect that I may have port 80 and 443 being blocked by my no name ISP.  I have those ports forwarded in my router, and the NPM congratulations page is never displayed.  I can torrent (with unRaid Transmission docker) over this ISP, so not everything is blocked.

 

Is this likely my problem? 

Hi tr0910,

 

I'm not sure what you mean and I doubt that your ISP is blocking your ports, what happens if you go to your ip address in a browser? You said that you had a fixed one, didn't you? The same if you have forward your domain(s) to that ip address, what are you seeing? the same as when you are using your domain as with the ip?

Edited by Kru-x
Link to comment

From my cell phone with WiFi shut off, both my external IP address and my domain forwarded to this IP respond with the same thing.  Yes IP is fixed. 

 

This site cannot be reached. 

ERR_Connection_Refused

 

Router is forwarding 80 and 443 to unRaid 1880 and 18443 as per a default NPM recommended install.

Link to comment
47 minutes ago, tr0910 said:

From my cell phone with WiFi shut off, both my external IP address and my domain forwarded to this IP respond with the same thing.  Yes IP is fixed. 

 

This site cannot be reached. 

ERR_Connection_Refused

 

Router is forwarding 80 and 443 to unRaid 1880 and 18443 as per a default NPM recommended install.

It is for sure NPM, only worry about your IP address first of all, when you add that to any browser and when it is working you should be greeted with a welcome to NPM greeting. Not until then you can start to invoke your containers and certificates.

 

You say that you have forward the ports correctly, but I would double check the settings again. Did you forward too the right IP of your server? Is this the first time you connect to your server from internet?

 

Donno, but I suppose your ISP could potentially block those ports but I cant see why, ask them or find out googling, IF they do, tell them to bugger off and get another provider, you don't have to have a fixed IP, waste of money if you pay extra or the ISP provider charge extra for it.

 

Kru-x

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

You say that you have forward the ports correctly, but I would double check the settings again. Did you forward too the right IP of your server? Is this the first time you connect to your server from internet?

Here is the router page:

image.png.7946270fbbdab6a8b85d59bb98ea44af.png

 

Going to 192.168.13.142:1880 from inside the local lan brings me to the congratulations page for NPM.  Does it look ok to you for the normal suggested port forwarding logic for NPM?

 

Googling around led me to believe that ISP blocking of 80 and 443 was quite normal and to be expected.  Your response makes me question this.  You haven't had to deal with blocked ports? 

 

It does seem that others have had to deal with this.  There is even a SpaceInvaderOne unRaid video about port 80 blockage with Lets Encrypt setup.  And sorry, this particular area where I am testing at present does not have other ISP options.  If they are blocking, we will have to either ask nicely, or just work around it.  I'll dig some more and see what I find.   Thanks for the pointers...

Edited by tr0910
Link to comment
14 minutes ago, tr0910 said:

Here is the router page:

image.png.7946270fbbdab6a8b85d59bb98ea44af.png

 

Going to 192.168.13.142:1880 from inside the local lan brings me to the congratulations page for NPM.  Does it look ok to you for the normal suggested port forwarding logic for NPM?

 

Googling around led me to believe that ISP blocking of 80 and 443 was quite normal and to be expected.  Your response makes me question this.  You haven't had to deal with blocked ports? 

 

It does seem that others have had to deal with this.  There is even a SpaceInvaderOne unRaid video about port 80 blockage with Lets Encrypt setup.  And sorry, this particular area where I am testing at present does not have other ISP options.  If they are blocking, we will have to either ask nicely, or just work around it.  I'll dig some more and see what I find.   Thanks for the pointers...

Looks ok, but I believe the protocol should be UDP, don't know if that would make any difference.

 

Hope it works out and for sure ask your provider, if they are good they should take care of their costumers need.

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

Looks ok, but I believe the protocol should be UDP, don't know if that would make any difference.

 

Hope it works out and for sure ask your provider, if they are good they should take care of their costumers need.

ISP admits to blocking these ports but for an additional fee they can give me a static IP (which I already have) and ports 80 and 443 will be unblocked.  The additional fee is not desirable, so now I need to find a different way around this blockage. 

Link to comment
5 hours ago, tr0910 said:

ISP admits to blocking these ports but for an additional fee they can give me a static IP (which I already have) and ports 80 and 443 will be unblocked.  The additional fee is not desirable, so now I need to find a different way around this blockage. 

Ohh that sucks,

 

You need the ports to divert the traffic thru, if you can't change provider I doubt that you can do anything else then pay up. You might be able to use a VPN but then you are on thin ice and are going to run in to problems all the time. Wouldn't do that in production. Why can't you change, sound strange to me? Shared cable in to units or?

Any how good luck and keep us posted,

 

Kru-x

Link to comment
  • 4 weeks later...
22 hours ago, hkinks said:

Is there any way of giving the wordpress database name as an environment variable? Right now I can only modify wp-config.php manually if I have the database with different name.

Hi hkinks,

What are you trying to achieve? You say "if I have a database with different name".

 

On a new install you can name the database to whatever you want by adding the the parameters to the DB template see https://hub.docker.com/r/linuxserver/mariadb (heading "parameters"). If the WP container can't login to the mariaDB container you are presented with the WordPress install where you can add your DB name user and PW. You could also login as root to the mariaDB with a separate DB software and create whatever DB name you like then install WP the same as a above. Remember user and privileges thought.

 

Hope this answered your question
Kru-x

Link to comment

Thanks for answering!


I would simply like to name the database differently than the default 'wordpress' since I can have multiple wordpress sites using the same MariaDB server. Would be really convenient to set it as a docker env var when running it, e.g. WORDPRESS_DB_NAME.


Maybe if I explain my setup workflow it is better understood or maybe I am overlooking some easier solution. I want to set up a wordpress site for a blog let's say. I create database 'wp_blog' and user 'wp_blog' with access rights to that db. I configure the Wordpress docker, however I can only specify database host, user and a password at this point. When I start the container and visit the site I would get message "Error establishing a database connection". The reason is that it expects database name to be 'wordpress'. So what I do in this case is
1) go to mapped volume /mnt/user/appdata/wp_blog/wp-config.php
2) modify the line
define( 'DB_NAME', 'wordpress'); to use 'wp_blog' instead.
after that everything works as expected and can continue installing WordPress.

Edited by hkinks
Link to comment
1 hour ago, hkinks said:

Thanks for answering!


I would simply like to name the database differently than the default 'wordpress' since I can have multiple wordpress sites using the same MariaDB server. Would be really convenient to set it as a docker env var when running it, e.g. WORDPRESS_DB_NAME.


Maybe if I explain my setup workflow it is better understood or maybe I am overlooking some easier solution. I want to set up a wordpress site for a blog let's say. I create database 'wp_blog' and user 'wp_blog' with access rights to that db. I configure the Wordpress docker, however I can only specify database host, user and a password at this point. When I start the container and visit the site I would get message "Error establishing a database connection". The reason is that it expects database name to be 'wordpress'. So what I do in this case is
1) go to mapped volume /mnt/user/appdata/wp_blog/wp-config.php
2) modify the line
define( 'DB_NAME', 'wordpress'); to use 'wp_blog' instead.
after that everything works as expected and can continue installing WordPress.

No  worries,

 

Personally I can't see any benefit using the same DB to different sites more then in a multi-site setup. It is no disadvantage to run different DB's and it benefit separating each instance witch makes it easier should something go wrong. That's the main reason I have not added more variables to the template, I tried to make it as simple as possible.

 

But having said that, each person have it's own preferences and a more confident user can add any variables himself, you can add a WORDPRESS_DB_NAME  environment variable to your template.

 

But if I can give an advice I wouldn't bother as per above, still if you insist i would use a software to connect to my database and manually manage the DB's/users/ and passwords. You can leave the WORDPRESS_DB_HOST blank for a new instance then you get presented with the WP installation on startup where you can do it all manually, but with this the user needs to understand what the container and DB is about (thus use a software), in regards to username password and db names etc. 

 

The MariDB container is setting the user to root with full privileges and the WP container is using the same to use the DB, in a production environment this should be done manually and should not be using root.


Kru-x

 

 

Link to comment
On 8/17/2020 at 12:04 AM, Kru-x said:

No  worries,

 

Personally I can't see any benefit using the same DB to different sites more then in a multi-site setup. It is no disadvantage to run different DB's and it benefit separating each instance witch makes it easier should something go wrong. That's the main reason I have not added more variables to the template, I tried to make it as simple as possible.

 

But having said that, each person have it's own preferences and a more confident user can add any variables himself, you can add a WORDPRESS_DB_NAME  environment variable to your template.

 

But if I can give an advice I wouldn't bother as per above, still if you insist i would use a software to connect to my database and manually manage the DB's/users/ and passwords. You can leave the WORDPRESS_DB_HOST blank for a new instance then you get presented with the WP installation on startup where you can do it all manually, but with this the user needs to understand what the container and DB is about (thus use a software), in regards to username password and db names etc. 

 

The MariDB container is setting the user to root with full privileges and the WP container is using the same to use the DB, in a production environment this should be done manually and should not be using root.


Kru-x

 

 

Thanks, not specifying the WORDPRESS_DB_HOST was basically what I was looking for. I was somehow under assumption these env vars are obligatory. Without it I was presented with Wordpress installer's own database credentials view and could specify the database name there like you said.

 

Personally I just prefer to manage databases from one dbms instance, better overview and easier to remember what is going on.

Link to comment
  • 3 weeks later...
11 hours ago, Martintheshred said:

Hi Kru-x
   I am fairly new to this so please bear with me i have MariaDB docker running already that my next cloud docker connects to so how do i down load a new MariaDB or do i just add a new path or variable? as when i click on the MariaDB is says reinstall or edit? sorry if this sounds like a stupid question.

 

Cheers

  Martin  

Hi Martin,

No worries we are all at a stage where we wondering how to do things. I recommend reading up on docker itself, that taught me a lot in my understanding of how containers works.

 

As for your question, you just add a new template with a different name and port, then a new instance (container) of a MariaDB is created. Make sure the folder path is different as well.

 

Hope it helps,

Kru-x

Link to comment

I worked for a several days to try to get wordpress work with letsencrypt(with nginx)..

 

the letsencrypt have already for my nextcloud docker(I can access my nextcloud with external network)

 

For wordpress I made progress today by using the wordpress.subdomain.conf suggested in this post

 

 https://forums.unraid.net/topic/89657-guidehow-to-make-your-own-streamingplatform-like-twitch-and-co-using-wordpress-mariadb-letsencryptnginx-rmtp-by-alfg/?tab=comments#comment-831787&searchlight=1

 

I thank god that finally its not giving me something like bad request in the browser.

 

however, I only got the text working in the browser, but all the theme and css seems not working. Please help.. (This is fine if I access through internal ip:port)

 

image.thumb.png.0cc1bd42e7b3df69ef6180eb8c4d410c.png

Link to comment

The behaviour is very strange

 

1)desktop browser(domain)

I)outside local network: above result

2)inside local network: above result

 

2) desktop browser(ip)

no problem at all

 

3) mobile device browser

i) local network: can load picture, but still some css error

ii) outside local network: cannot load at all

Link to comment
6 hours ago, skymount said:

The behaviour is very strange

 

1)desktop browser(domain)

I)outside local network: above result

2)inside local network: above result

 

2) desktop browser(ip)

no problem at all

 

3) mobile device browser

i) local network: can load picture, but still some css error

ii) outside local network: cannot load at all

Hi,

 

Try to empty your browsers cache. But having said that (and read your message properly :-()) wonder. I never got the hang of letsencrypt/nginx settings , and it seems to be ask in that forum or to make life easy for you use the nginx manager as per previous posts. Then you don't have to worry about settings.

 

Kru-x

Edited by Kru-x
Added answer
Link to comment
On 9/9/2020 at 12:55 PM, Kru-x said:

Hi,

 

Try to empty your browsers cache. But having said that (and read your message properly :-()) wonder. I never got the hang of letsencrypt/nginx settings , and it seems to be ask in that forum or to make life easy for you use the nginx manager as per previous posts. Then you don't have to worry about settings.

 

Kru-x

 

thx bro

 

but i am not so sure, as I am already running letsencrypt and its version of nginx

 

If I install this nginx manager, am I required to remove the letsencrypt version of nginx?

 

or they coexist with each other? THen I have no idea how to set them up..

 

 

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.