after that i went to my browser and typed in my usual ip address plus port combo like 192.168.254.157:8000 but was only greeted with an error. page cannot load
can anyone tell me what i amx doing wrong?
before i did the multitenancy step i was able to access my site fine
My erpnext is in a ubuntu server while im using another pc to connect to the ubuntu server
In your case, you switched on dns multi-tenancy, thus you need to setup a web server (e.g. Nginx) to do the routing to the correct site based on the domain you typed in /etc/hosts.
In your case you’ll need to type foo.bar, not the IP address.
When using port multi-tenancy, then you can use the ip address with the port number to route to your site.
Basically the question is how the system can route your request to the correct files, using port numbers or domain names (DNS server or hosts-file).
Using nginx for DNS multi-tenancy with bench is pretty straight forward, just follow the instructions and you’ll good to go, including let’s encrypt certificates if needed.
i already have nginx active and also supervisor active but whenever i try to access using the name demo.erp(i didnt really use foo.bar as stated in the tutorial and used my own) it always goes to my search engine like google. I am accessing the erpnext on a different pc though.
here is the error when i try to access it using ip
update 1: i was able to make it work when i use port multitenancy so i think dns multitenancy is the only thing i cant make work. is there a step i should have done to make dns multitenancy work?
Did you call “bench setup nginx” with your site?
Also, did you make a link in the /etc/nginx/config folder to your bench config file?
Something like: ln -s /etc/nginx/bench.conf /home/myuser/mybench/config/nginx.conf
Exchance paths accordingly.
Nginx needs to load the config files for the bench sites. Thus we need to let nginx know which one to load.
If it is not local, you have to use full domain name to access. And set your dns to point to the ip address.
If the domain is not the same as the site name, you have to run bench setup add-domain
if you setup nginx and supervisor then most likely you are on production which is not on localhost.
If on localhost you have to add your domain to the local host list.
Check nginx.conf if it has your domain name in it. If not you have to run bench setup nginx again, and bench setup reload-nginx.
Access the site from browser with domain name without the port.
Actually I curious if you use the name demo.erp because I think it is not a valid TLD.
hmm using .com .net etc means i need my ubuntu server to be hosted at the cloud and also buy working dns name from online right? if so is it possible to do it just on the local machines using dns? by local machine i mean i have my server physically at home and i just connect to it locally using a router
so i have 2 pc at home one is headless running ubuntu server with erpnext the the other one is windows which is my daily driver and the one i used to ssh into my ubuntu server
you can apply the above method also on a single machine.
In the hosts file you define 127.0.0.1 for demo.erp or whatever domain you want to map.
You can use the ping command for checking as well.
if i understand it correctly i will edit the host file on my windows pc so it will point to the ip address of my ubuntu server?
ill use your example
so on my laptop i will go to the host file(fig 1) below then add a line (see fig 2) that contains the ip address. after that its gonna be all ok?