Multitenant setup please help

i have check alot of forums here about this situation and i couldnt have an solutition for my issue i have follow all the steps
but i am using my sistem on a virtual box when i
put this comand bench config dns_multitenant on and crieate anothers websites
the wesite stop work i dont know actualy how to call it on the browser
any support

you have to add the host_name in site_configuration.json.

If u are using VM with NAT should also add hostname to your host file.

i have this error
./nextmoz.com/site_config.json does not exist

i have add the host_name but doesnt work

do i need to have dns configurate on my server?

on this link https://frappe.github.io/frappe/user/en/bench/guides/setup-multitenancy i have tryied the DNS based multitenancy but when i do it i have page not found so if you have an step by step process it would be nice

Hi!

Just a tip.

When you use multitenency the website folder name must match the domain you want.

For example if you have a domain “example.com” you must have a site folder: frappe-bench/sites/example.com/

This means if you already started working in frappe/erpnext under the default “site.local” site you must rename that folder to match your domain or create another site with that domain name.

yes that is working, thanks
but i want to make subdomains linek site2.example.com
how can i do it?

Subdomains should work the same way if you setup a new site:

bench new-site site2.example.com

If you are on a VM then you’ll want to add “site2.example.com 127.0.0.1” to your VM host’s host file so you can access it.

Then in your host’s browser http://site2.example.com:8080 should display the subdomain site.

having dificulties to get to it do you have any tutorial to see step by step?

I don’t have a tuturial per say, but I just did this manually to make sure it works. I am assuming you are on a VM with ubuntu installed as your OS. You didn’t mention if your VM host was a windows machine, macos or another linux system. Check out this link to see how to modify your host file

  1. Create a new subdomain site in you vm:

bench new-site site2.example.com

  1. Make sure multitenancy is enabled

bench config dns_multitenant on

  1. Rebuild nginx configuration

bench setup nginx

  1. restart nginx

sudo service nginx reload

  1. Update your VM Host’s host file. Add your localhost to handle the subdomain:

site2.example.com 127.0.0.1

  1. Open up a browser on your VM Host and go to: http://site2.example.com:8080 You should now see a new frappe site with that subdomain.

You can do this host file trick to any domain during development to make sure your site behaves as you expect once it is deployed.

2 Likes

yes i am using ubuntu vesion 14 on digitalocean i will try this steps and tell you how did it go

when i follow this steps i have this error

Not Found

./domain.com/site_config.json does not exist

and when i create the site2.domain.com it just give page not found
any idea

do i have to install DNS or something i am missing ?

this is what i did

1- ubuntu 14.04 instalation
2- run easy installation of erpnext
3.the domain is pointing to the server IP an external domain to the server
4-follow the guide for multitenant
5- when i run it i cant reach the sites anymore by IP
6- when i put the domain i have that error on my list post
7- my other website site2 the browser says that doesnt existe

are u in NAT mode?

i am not very expert on this so i dont even now i just can tell you i hosted it on digital ocean and pointed the domain to there

Ah ok …i though u were testing it locally …sorry

What about to try to reinstall from scratch …maybe on ubuntu 16?

i just installed it for scratch my i need to make any change on my dns records as A or CNAME because i didnt change nothing i just installed the sites and subdomains, the main site works fine, but the subdomain i dont get there

from ur local machine can u test:

ping sub1.yourdomain.com

and check if it’s pointing to ur server?

ah, my instructions were for a VM as you mentioned you were using one originally.

You will have to setup an A(or CNAME) record to your server to even access the subdomain.