Create a sub server to serve as a CDN domain for Wordpress

Hello

I have installed the new plugin for my wordpress called " Media Cloud" and because my server is a local domain server I have to improvise in order to get that plugin working.

I found some stuff on the web, but as usual they all are working with cPanel

The plugin function is to transfer all the media from /wp-content to external storage like Amazon S3 or other S3 compatible service like wasabi or in my case MINIO

In order to work properly I have to have a CDN URL for serving images and non-image files. If that was a on the web I can just put CloudFront, Fastly or another CDN to do the job, but as I said im my case I have improvise.

Any idea how can I create of what in cPanel called “subdomain” in Virtualmin I believe is called sub server and to be pointed to my main domain or something like that in order to for serving as CDN like CloudFront, Fastly or another CDN

Thank you

In Virtualmin, it is a cname that you should create, going by what you posted.

So if your main website is www.domain.tld and you create a cname called cdn.domain.tld and point the cname to xyz123.cdndomain.tld (or whatever subdomain the CDN service provider has created for you) then it should work for those WordPress plugins that can change the URL of your static resources from www.domain.tld to cdn.domain.tld

The documentation for Media Cloud plugin appears to be offline at the moment: https://kb.mediacloud.press/

this is the link to the documentation

I will try it thank you

OK That should work, but I am facing one problem

the MINIO is accessed by port minio.domain.ltd:9000 I have to some how redirect this port into domain only like minio.domain.ltd.

Sorry if I confuse you with my request but this terminology is new to me

EDIT:

OK I used my firewall to port forward 9000 to 80 and now when I can access my MINIO with minio.domain.ltd and I also added the CNAME as you said

I pointed cdn.domain.ltd to minio.domain.ltd and it is not working

I figured out, but because I still don’t understand the concept of subdomain in Virtualmin I can’t configured

So 
 1st I have to create a my own self hosted CDN This is how you do it within cPanel

But how can I do it with Virtualmin ???

Then when I complete this task all I need to do is enter the CDN name in the Media cloud

thank you

You can’t be serious. It’s this simple:

Hi, it has been said above by calport - you need to create a cname which will point to your external resource. Or if its a small website, just skip this part. Or if you have a dedicated server with a lot of RAM, use part of the RAM as disk in memory and as CDN.

Assuming you’re using Virtualmin to do your hosting and your DNS:

Let’s say you have a domain called mydomain. You create a sub-server (subdomain) of that domain called cdn.mydomain. That will create the subdomain on your Virtualmin system including all the records you will ever need for it (name, mail, ftp, www, all of them).

Then you can simply go to that subdomain in Virtualmin and amend the records to anything you need them to be under That Subdmain / Server Configuration / DNS Records.

Hello

All I need is to create a subdomain to serve as a CDN to my wordpress multisite, because when I leave this blank like that:

and when migrate the images to minio all images within media library goes blank like that:

When create a subdomain as you all saying here I got the same result This plugin need something between the wordpress and minio to serve the images and I never done anything like that before and I don’t know how to configured properly :frowning:

Or might be I am going the wrong way. Might be I don’t need CDN but what I need is:

Because if I don’t enter the CDN in the CDN Settings the plugin still rewrite the URL of the image, but the image shows like this withing the post:

The interesting part is that URL is rewritten with HTTP, because my MINIO does not have HTTPS because then I install TLS to MINIO server I got cURL error 60 because MINIO is using self signed certificate.

I tried to to configure cURL --insecure, I’ve downloaded the *.pem to my Virtualmin server and made this certificate trusted to this server, but still the plugin refused to connect to MINIO for some unknown reasons.

I have tried everything that I know and that I found on the web to make it work

EDIT: I just found out something

root@webserver:~# curl http://minio.domain.ltd

<?xml version="1.0" encoding="UTF-8"?>

AccessDeniedAccess Denied./neptune16B9E9434D5E1B22d954c3e2-6d12-4bbe-8a8f-2b1a54d41ae1

What that CDN setting is asking you is: Where do we get the images and pages you want us to store?

You enter your subserver (subdomain) information into those blanks.

The CDN should then go to that subserver you created and pull the images and documents off of it over to their network caches and that’s that.

It should be just that simple.

So after you created your cdn.mydomain subserver and placed your files there you simply enter that address into those blanks and save it.

That should be it.

OK, but the whole point of what I am trying to do is to offload my images to minio storage so I can save space on the webserver and my MINIO is direct attached to 12 fast SSDs, that will give my website a lot more speed. I have over 50 000 images and videos, because my webserver is vmware vm I prefer the dedicated storage to vmware to be used for my VMs, that’s why I want to offload the wordpress media on to the MINIO’s storage.

It seems like you’re talking around the problem (and this is also a reminder of why we do not use the term “subdomain” to refer to an account type in Virtualmin, because the way cPanel wrongly uses the term leads to confusion like this).

A subdomain is a name (in cPanel it is a name and some weird pseudo-domain account type
we don’t conflate the two concepts in Virtualmin). That’s all it is.

If you want a domain name pointing to some other IP, just create an A record that points to that other IP. That A record can be a subdomain name or any other name you want. It has nothing to do with sub-servers. I don’t know why it would have anything to do with subdomains in cPanel, either.

1 Like

Hello

when I create a subdomain A record pointed to my MINIO IP
The plugin rewrite the URL and when I open the URL I am getting this

BadRequestAn error occurred when parsing the HTTP request GET at ‘//sites/2/sites/2/2021/11/beets-vector-1.jpg’//sites/2/sites/2/2021/11/beets-vector-1.jpgneptuned954c3e2-6d12-4bbe-8a8f-2b1a54d41ae1

Where is your website server and where is your MINIO space. Lets forget the panels for a moment. As your CDN is external to your website, you need to configure and possibly open firewall ports and addresses. Your MNIO setup wont accept any connection by default? Your Virtualmin server needs to open/access Minio IP and port.

My minio and website are on the private network.

I don’t need CDN I figured out, but I need to configure MINIO to use TLS and then get rid of the cURL error 60

Now How I figured out!!! I have no idea, but I did something that clear some cache or some other stuff.

First I took a snapshot of my webserver VM on the vmware as always if I do something wrong I can revert to its previous state. Then I edit the virtual server and unchecked “Apache SSL website enabled”
Then I tried to access the admin of the wordpress with “http” and for some reason it kept redirecting me to “https” I don’t know why, but I reverted the VM from Vmware to its previus state and now when I upload I can see the image with its cloud icon on the right bottom corner as it should be

now I can insert the image to the post and I can also see it.

But when I open the front end of the page with “HTTPS” this is what I get:

but if I open it with HTTP I have no problem the image is loading. Now what I need to do is setup MINIO with TLS, but the problem is the plugin cannot connect to MINIO with “HTTPS” because it gets cURL Error 60 because of the Self Signed Certificate

CURLE_PEER_FAILED_VERIFICATION (60)

The remote server's SSL certificate or SSH md5 fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51. 

I can use -k --insecure to bypass curl, but is there a way to make my webserver trust the self signed certificate of my minio server

Thank you

In the past I have had to import the certificate .pem and .key file to the server for a service I used (not minio). Its app specific and process depends on the service. Some will use own portals whilst others require you to manually copy across. Probably best to ask within the minio community of people who have done this themselves with the self generated certificate.

Please create new topics for new problems.

Do you know the link to minio community. I can’t find any forum on their website

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.