I’ve installed ERPNext a while ago with the “easy install” script, its in production mode.
For some testing purposes I would like to install a development version of ERPNext as well, next to the already existing production version.
If I’ve understood correctly I have to install another bench which in’t running in production, so I did: bench init frappe-bench-dev && cd frappe-bench-dev bench get-app erpnext https://github.com/frappe/erpnext bench new-site erp-dev.domain.com bench --site erp-dev.domain.com install-app erpnext
All fine so far.
I’ve also changed the hostname of the existing site from site1.local to erp.domain.com by: bench setup add-domain --site site1.local erp.domain.com
What do I have to do be able to run the development site on erp-dev.domain.com next to the existing erp.domain.com, both on port 80 and both automatically started by supervisor?
I do this, but I have two separate bench instances frappe-bench-prd and frappe-bench-dev. Each bench has only one site in it erp.domain.com in frappe-bench-prd and then erp-dev.domain.com in frappe-bench-dev. That way all code bases are completely isolated from each other and you can update the dev instance at any time and do testing before you update prod.
That what I’m having at this moment. I’ve got two branches, each containing only one site. I can reach the production bench and site, which i installed with the easy install script, at erp.domain.com
The problem is that I can’t reach the development bench and site. I would like to reach them at erp-dev.domain.com, but I don’t know how to set up.
I suspect I have to add some configuration to Nginx and Supervisor?
I assume you have more than one ip address bound to the network adapter and then dns setup to point to proper ip by name? I have dev running on port 8080. I manually edited the nginx.conf file to do that, but I think there is a bench command to do it.
No, the machine has only one IP, the dns server has the two hosts (erp.domain.com and erp-dev.domain.com) pointing to that IP address. So normally I would have to setup virtual hosts to make this work.
The manual (https://github.com/frappe/bench/wiki/Multitenant-Setup) also speaks about multitenant based on dns instead of port, put I think those samples are based on a single bench setup with multiple sites and is not mentioning multiple benches.
The main thing is you cannot update only a single site at a time in one bench. So when you want a dev instance you need that in a different bench than prod site so you can update the dev bench first, do testing and then update the prod bench. With multi-tenant this is really important as you don’t want to update a ton of prod sites that have not been tested.
I don’t know how to do apache httpd “like” virtual hosts by name with nginx and since nginx is running under two different benches, its running two different nginx.conf files and instances.
My recommendation is to manually edit the nginx.conf file and setup a redirect from port 80 to port 8080 and then have erp dev run on port 8080 on the same host.
Hi James,
Please could you give an example of your nginx.conf setup?
I’m trying to set this up, an no matter what I try I get the “Sorry! We will be back soon.” page on the dev bench.
Thanks!
Could you please give some guidance on this? I encountered the same issue but in my case, the second domain name just goes to the site in the first bench. How does a user point a domain to the correct bench when they have multiple benches setup on one machine?
By the way, the domain name resolved correctly once I setup production but I’m not quite sure if this answers the question ‘how to setup domains for a production and development site on the same machine’