Jump to content
Kru-x

[Support] kru-x - wordpress

192 posts in this topic Last Reply

Recommended Posts

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

Share this post


Link to post
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

Share this post


Link to post
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?

 

Share this post


Link to post

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.

Share this post


Link to post
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

Share this post


Link to post

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

Share this post


Link to post
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

Share this post


Link to post

I installed the wp-docker and connected it to a db on the maria-db docker.

 

In the LAN (i'm outside over VPN) i got Access via http://192.168.2.121:8080 to website and admin site.

 

In NginxProxyManager I made a subdomain wp.mydomain.com with ssl and forwarded to http://192.168.2.121:8080. Unfortunately I can't access.

 

That's all I did.

Share this post


Link to post
22 minutes ago, cracksilver said:

I installed the wp-docker and connected it to a db on the maria-db docker.

 

In the LAN (i'm outside over VPN) i got Access via http://192.168.2.121:8080 to website and admin site.

 

In NginxProxyManager I made a subdomain wp.mydomain.com with ssl and forwarded to http://192.168.2.121:8080. Unfortunately I can't access.

 

That's all I did.

I think it is becouse you did the WP installer on your internal address, always creates a lot of havocs.  Delete your folders and DB and start from the beginning, ones you have your domain up running then start the wp installer, 

 

Kru-x

Ps. read some of the threads earlier in this forum, its a common issue that many run in to.

Share this post


Link to post
31 minutes ago, Kru-x said:

ones you have your domain up running then start the wp installer,

Ahaa..... you mean over wp.mydomain.com?

 

Ok. I'll try... Thx

Share this post


Link to post

so I tested the blog a bit and everything runs well and smoothie.

The only part I get a server timeout 504 is when I try to print as pdf. There is a plugin for that. 

 

Can I change some settings somehow?

 

greg

Share this post


Link to post
19 minutes ago, cracksilver said:

so I tested the blog a bit and everything runs well and smoothie.

The only part I get a server timeout 504 is when I try to print as pdf. There is a plugin for that. 

 

Can I change some settings somehow?

 

greg

Hi Greg,

Glad to hear it is running well, a server time out is not really related to this setup and I'm not sure. Really can't help you, ask in a general WP forum, could be anything.

 

But to give you a starting point, you can increase the time b4 it times out both in wp-config and in NginX (NPM) but I am not sure why this would be needed. Maybe ask the plugin developer.

 

I use wkhtmltopdf to generate pdf's from HTML pages, but that is a lot off hassel and have to be built in to the WP docker container in this setup.

 

Sorry I can't be of more help,

Kru-x

Share this post


Link to post

Hello, I'm back. There have been a couple of docker updates to these Wordpress websites and it has been a headache to have to go into the wp-config file and update them with the proper database name. I realize that if I were to use a unique MariaDB for each wordpress docker I wouldn't have to rename the db, I could just leave it as the default name. 

 

Is there a way instead to not have the wp-config file replaced upon update of docker?

 

If not, can you explain exactly what you do? Do you have a phpmyadmin, MariaDB and wordpress docker per website?

 

Edit: Restarting a docker also resets the wp-config file. That's really annoying. Any possibility that you can add a wordpress database name field to the docker setup so that it can update it after each restart or update? Even easier... can it just not touch the wp-config file?

Edited by dancue

Share this post


Link to post
On 10/27/2020 at 9:34 AM, dancue said:

Hello, I'm back. There have been a couple of docker updates to these Wordpress websites and it has been a headache to have to go into the wp-config file and update them with the proper database name. I realize that if I were to use a unique MariaDB for each wordpress docker I wouldn't have to rename the db, I could just leave it as the default name. 

 

Is there a way instead to not have the wp-config file replaced upon update of docker?

 

If not, can you explain exactly what you do? Do you have a phpmyadmin, MariaDB and wordpress docker per website?

 

Edit: Restarting a docker also resets the wp-config file. That's really annoying. Any possibility that you can add a wordpress database name field to the docker setup so that it can update it after each restart or update? Even easier... can it just not touch the wp-config file?

Welcome back, ;-)

 

Not sure how you have set it up, but docker works as if a file is missing he will add it but if you have a file with the same name he wouldn't.

Have you taken the wp-config.php file out of the root folder, or are you renaming it?

 

So, It copies the files from /var/www/html in the docker container to /var/www/html/mnt/user/appdata/your_folder (that is the root of your site), on restart or update, if a file is missing he will add it but never replace it. Odd if he do!

 

I name my WordPress container: my_site1-wordpress and I match it with the MariaDB continer like: my_site1-MariaDB, and so on. I have one database to each WP site. I leave the DB name to default "wordpress" in each MariaDB container.

 

I rarely connect to the DB on my server, I only fiddle with it on my development (my laptop, mac) where I have exactly same setup with docker as on my server. Don't use phpmyadmin, I use TablePlus. I if I need to connect to my MariaDB container i just connect to it with ip:port when I am on my network or by vpn when I am away.

 

Kru-x

 

Share this post


Link to post
15 hours ago, Kru-x said:

Welcome back, ;-)

 

Not sure how you have set it up, but docker works as if a file is missing he will add it but if you have a file with the same name he wouldn't.

Have you taken the wp-config.php file out of the root folder, or are you renaming it?

 

So, It copies the files from /var/www/html in the docker container to /var/www/html/mnt/user/appdata/your_folder (that is the root of your site), on restart or update, if a file is missing he will add it but never replace it. Odd if he do!

 

I name my WordPress container: my_site1-wordpress and I match it with the MariaDB continer like: my_site1-MariaDB, and so on. I have one database to each WP site. I leave the DB name to default "wordpress" in each MariaDB container.

 

I rarely connect to the DB on my server, I only fiddle with it on my development (my laptop, mac) where I have exactly same setup with docker as on my server. Don't use phpmyadmin, I use TablePlus. I if I need to connect to my MariaDB container i just connect to it with ip:port when I am on my network or by vpn when I am away.

 

Kru-x

 

I'm not seeing either of those locations... /var/www/html and /var/www/html/mnt/user/appdata/your_folder

how can I find them? I see Root/Appdata/Folder for each one of the dockers. I'm using Krusader to view these files. What docker are you using?

 

No... I don't take the file out and it gets replaced with a new copy every time I restart the docker, restart the server or update the docker.

Share this post


Link to post
8 minutes ago, dancue said:

I'm not seeing either of those locations... /var/www/html and /var/www/html/mnt/user/appdata/your_folder

how can I find them? I see Root/Appdata/Folder for each one of the dockers. I'm using Krusader to view these files. What docker are you using?

 

No... I don't take the file out and it gets replaced with a new copy every time I restart the docker, restart the server or update the docker.

Sorry it should have been /mnt/user/appdata/your_folder this is the path on your unraid server. Krusader probably mounts the user/ as root/ so it should be the same as yours.

 

1556726018_ScreenShot2020-10-29at5_02_24am.thumb.png.b71442390bf4d3ede787c54f03b7f22e.png

 

See the "/var/www/html", this is the path (folder) inside the container, and the "mnt/user/appdata/wordpress-temp" is the path (folder) on your server. What version of docker wont matter.

 

So when you crank up a new container all files in "/var/www/html" (in this case all files in a new WP installation, the root of your site) gets copied to "mnt/user/appdata/wordpress-temp", after that on each update or restart of the container, all files in this folder should be persistent as docker wont copy and overwrite any files/folders with the same name.

 

I tried Krusader ones but I didn't get it (i'm on mac and are using Forklift), how do you edit and save the wp-config.php file can you confirm in the terminal, if you go to the "mnt/user/appdata/your-site" (your case Root/Appdata/your-site) that the file is actually changed in there after edit. Looks to me that you are editing the file in the container, or that the storage is not persistent on your server but then the whole site would change so I am a little bit lost on that one.


Kru-x

Screen Shot 2020-10-29 at 5.02.24 am.png

Share this post


Link to post

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.