Ideas for hostinga webserver on my Unraid


8 posts in this topic Last Reply

Recommended Posts

Morning community. Do to the pandemic , I thought on reducing cost whit my office website hosting. Thinking on moving the hosting the part on an virtual machine on Unraid. I thought making a small Ubuntu, using a free manager like aaPanel, host it my self and using CloudFlare for DNS management.

How do you think i should proceed?

Link to post

Hi all,

 

It's an intersting project and you made me discover aaPanel thanks ! Running a VM could be usefull but I wouldn't it be nice and handier to have it within a Docker as well ?

Link to post

A webserver in a docker could be a little too fancy I gess. I was thinking of more simple solutions:

For hosting one website there is some wordpress docker that can do the trick easily

For more advance settings and flexibility some people use a mariadb docker with swag or nginx proxy manager. Then they install wordpress  directly within nginx.

 

I was looking at this tutorial https://technicalramblings.com/blog/how-to-set-up-a-wordpress-site-with-letsencrypt-and-mariadb-on-unraid/ at a starting point.

If you have a static IP it's easy to configure with the swag. and mariadb dockers.

 

I've try your aapanel solution even though I didn't find the aapanel community very dense :

I have installed a Debian VM and then launch the aapanel installation command. I think it's an interesting solution and you should give it a try. I think there is some optimization to do during the vm install as the www directory is located at root with the aapanel.

 

For now i'm just exploring the different solutions looking for the best that will fill my needs.

 

Like you I already host 3 personals websites on a cheap dedicated server and I want to transfer them within Unraid. They are hosted on a Debian with nginx and wordpress. I don't have any panel to manage them.

 

My problem with Unraid is that I have a dynamic IP and I'm looking forward to find the best and easy way to forward all my domains to my public IP. I'm already using swag and duckdns to access remotly to my running dockers and everything work like a charm.

 

I have studied the @SpaceInvaderOne and ibracorp ( @Sycotix)videos' dealing with domain names and webproxy with cloudflare. I think it can do the trick for me but I have some more research to do to deal with the cloudflare docker to be able to manage more than one domain.

 

Hope you'll find an easy solution and that some more people can share their experiences with webserver in an Unraid environment.

 

 

Link to post
8 hours ago, Rikul said:

My problem with Unraid is that I have a dynamic IP and I'm looking forward to find the best and easy way to forward all my domains to my public IP. I'm already using swag and duckdns to access remotly to my running dockers and everything work like a charm.

 

I have studied the @SpaceInvaderOne and ibracorp ( @Sycotix)videos' dealing with domain names and webproxy with cloudflare. I think it can do the trick for me but I have some more research to do to deal with the cloudflare docker to be able to manage more than one domain.

 

 

 

If you want to have 3 domains all point to your public WAN IP it is very easy to do.

The Cloudflare DDNS container would update your main domains IP (yourdomain1.com )  by means of a subdomain .  

For example you would set the container to  update the subdomain dynamic.yourdomain1.com to be your public WAN IP

So then dynamic.yourdomain1.com will always be pointing to your public WAN IP.

 

Then any other domains or subdomains that you want to point to your public WAN IP, you just make a CNAME  in your cloudflare account which points to dynamic.yourdomain1.com

So for example  you could point and subdomain for example www.yourdomain2.com to dynamic.yourdomain.1.com

However many domains like to use a “naked” domain (which is a regular URL just without the preceding WWW) so for example you can type google.com and goto google without having to type www.google.com.

 

This "naked" domain is the root of the domain. DNS spec expects the root to be pointing to an IP with an A record.

However Cloudflare allows the use of a CNAME at root (without violating the DNS spec) by using something called CNAME flattening which enables us to use a CNAME at the root, but still follow the RFC and return an IP address for any query for the root record. So therefore you can point the "naked" root domain to a CNAME and could use yourdomain2.com pointing by CNAME to dynamic.yourdomain1.com

 

So with your 3 domains you can point any subdomain or the root domain to the (cloudflare ddns docker container updated on unraid)  dynamic.yourdomain1.com

 

But you don't need to use Cloudflare DDNS if you don't want to. Instead of using the Cloudflare DDNS container you could use the DuckDNS container.

Then for the subdomain dynamic.yourdomain1.com  instead of having its a record updated by the Cloudflare container you would use a CNAME for dynamic.yourdomain1.com to point to yourdomain.duckdns.org (or whatever your DuckDNS name was)

 

So basically its just a chain of things that eventually resolve an IP which is your public WAN IP. 

 

Also Swag reverse proxy allows you to make letsencrypt certs for not just one domain but multiple domains too.

 

I hope that makes sense :)

Link to post

Thank you so much for this very detailed answer.🤩

6 hours ago, SpaceInvaderOne said:

This "naked" domain is the root of the domain. DNS spec expects the root to be pointing to an IP with an A record.

However Cloudflare allows the use of a CNAME at root (without violating the DNS spec) by using something called CNAME flattening which enables us to use a CNAME at the root, but still follow the RFC and return an IP address for any query for the root record. So therefore you can point the "naked" root domain to a CNAME and could use yourdomain2.com pointing by CNAME to dynamic.yourdomain1.com

You pined out the thing I didn't understand as I naturally was willing to point the root domain to a A name.

I think I understood how I'm gonna  deal with my redirection problems.

I hope I'm not gonna break everything especially my Nextcloud setup even though I know I will be able to revert it back.

It's gonna be a tweecking sunday for me.

 

Thanks again for all your amazing videos I've learn so much since I start playing with Unraid. You deserve a good sunday 🍺, hopping you'll find an open pub !

Link to post
On 3/29/2021 at 2:26 AM, Rikul said:

Thank you so much for this very detailed answer.🤩

You pined out the thing I didn't understand as I naturally was willing to point the root domain to a A name.

I think I understood how I'm gonna  deal with my redirection problems.

I hope I'm not gonna break everything especially my Nextcloud setup even though I know I will be able to revert it back.

It's gonna be a tweecking sunday for me.

 

Thanks again for all your amazing videos I've learn so much since I start playing with Unraid. You deserve a good sunday 🍺, hopping you'll find an open pub !

Came late to the party but the question seems to have answered. Cheers! Apologies for the delay.

Link to post
  • 1 month later...

Hello,

 

Here's an update of my hosting setup.

 

As a starter I've used the new 6.9 pools' features to dedicate an ssd for my dockers as my websites will be hosted within swag in the www folder.

I'm still using duckdns in conjunction with cloudflare. I don't use the cloudflare docker because the cloudflare API doesn't manage some of my fancy tld in .tk.

So everything is managed trough swag / mariadb (with adminer) and duckdns.

 

In Cloudflare all my domains got 2 CNAME (the domain and www) pointing to my duckdns.

In swag I've used the extra domain line to register all my new domains for my websites (by the way don't proxy a domain in cloudflare before getting a certificate with letsencrypt)

I've created my dedicate folders for my websites in Appdata\swag\www

All my nginx conf sit in Appdata\swag\nginx\site-confs. Pretty standard nginx.conf for wordpress nothing fancy.

 

For my previous existing websites I have just copied all the wordpress files in my Unraid server trough ftp. Copied the existing sql databases. Created the new databases with adminer and imported the previous .sql files....the classic wordpress migration with a modification of the previous wp-config.php files to match the user/login/database location.

 

And everything is running smoothly :)

 

Thanks everybody for your help. I hope mu modest contribution will be helpfull.

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.