Multi-tenant Setup

76 views
Skip to first unread message

Omkar Ghatpande

unread,
Sep 4, 2014, 2:17:24 AM9/4/14
to erpnext-developer-forum
Guys, sorry.. Rookie question.

I've created 2 separate sites locally - site1.local and site2.local. First is my actual ERPNext setup and 2nd one is the demo.

I've also made port changes as mentioned in the multi-tenant setup guide (site2 mapped to port 82)

How do I actually access site2? (localhost:8082, localhost:82 not working)

Right now, I need to set one of them as default to be able to access it on localhost:8000 

Thanks a lot!

Omkar

Pratik Vyas

unread,
Sep 4, 2014, 2:58:10 AM9/4/14
to erpnext-dev...@googlegroups.com
Hi Omkar,

Have you setup nginx?
If yes, did you try reloading it?

Thanks,
--
Pratik
erpnext

Omkar Ghatpande

unread,
Sep 4, 2014, 3:10:16 AM9/4/14
to erpnext-developer-forum
Hi Pratik,

Yes.. I've setup nginx. My /nginx/conf.d has a frappe.conf which lists both the servers/ports/sites.

Is there any additional setting I should be checking?

Thanks for the response,

Omkar


--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0Eka13XFD7GC7FMOR%2Bn81SHvP70RcywJmRx-Z%2BX%2B01W_XA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Pratik Vyas

unread,
Sep 4, 2014, 5:11:10 AM9/4/14
to erpnext-dev...@googlegroups.com
On Thu, Sep 4, 2014 at 12:39 PM, Omkar Ghatpande
<omkar.g...@gmail.com> wrote:
> Hi Pratik,
>
> Yes.. I've setup nginx. My /nginx/conf.d has a frappe.conf which lists both
> the servers/ports/sites.
>
> Is there any additional setting I should be checking?
>
> Thanks for the response,
>
> Omkar
>

Hi Omkar,

Is nginx running? Test using `curl localhost:80`

If yes, please post the generated nginx config on dpaste.com.

Thanks,
--
Pratik
erpnext

Omkar Ghatpande

unread,
Sep 4, 2014, 5:27:57 AM9/4/14
to erpnext-developer-forum
Hi Pratik,

Yes, nginx is running as well - curl o/p - http://dpaste.com/3V2EHZ4


Thanks

Omkar



Thanks,
--
Pratik
erpnext

--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

Pratik Vyas

unread,
Sep 4, 2014, 6:02:36 AM9/4/14
to erpnext-dev...@googlegroups.com
On Thu, Sep 4, 2014 at 2:57 PM, Omkar Ghatpande
<omkar.g...@gmail.com> wrote:
> Hi Pratik,
>
> Yes, nginx is running as well - curl o/p - http://dpaste.com/3V2EHZ4
>
> Config file - http://dpaste.com/15KKRGX
>
> Thanks
>
> Omkar
>

Okay,

the response is of nginx default page.

If your config is correctly linked, your nginx restart must have
failed complaining that there are two default server block for port
80.

what is the output of
`sudo service nginx restart`?

Omkar Ghatpande

unread,
Sep 4, 2014, 6:25:17 AM9/4/14
to erpnext-developer-forum
Yup, not able to restart - though not sure how I can see the localhost page :)

omkar@omkar-Vostro-1014:~$ sudo service nginx restart
 * Restarting nginx nginx                                                                                                                [fail] 

Tried debugging this further, got:

omkar@omkar-Vostro-1014:~$ sudo nginx -c /etc/nginx/nginx.conf -t
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/default:21
nginx: configuration file /etc/nginx/nginx.conf test failed

Should I remove this duplicate entry? Also, any changes required in /nginx/sites-available and /ngnix/sites-enabled?

Thanks a lot,

Omkar


--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

Omkar Ghatpande

unread,
Sep 4, 2014, 6:50:58 AM9/4/14
to erpnext-developer-forum
Hi Pratik,

Update - removed both default files from /nginx/sites-enabled and /nginx/sites-available. Now I'm able to start/restart nginx properly. I can also access localhost:82 but again it'll load with my default site.

Any pointers?

Thanks,

Omkar

Pratik Vyas

unread,
Sep 4, 2014, 12:04:40 PM9/4/14
to erpnext-dev...@googlegroups.com
On Thu, Sep 4, 2014 at 4:20 PM, Omkar Ghatpande
<omkar.g...@gmail.com> wrote:
> Hi Pratik,
>
> Update - removed both default files from /nginx/sites-enabled and
> /nginx/sites-available. Now I'm able to start/restart nginx properly. I can
> also access localhost:82 but again it'll load with my default site.
>
> Any pointers?
>

Are you running supervisor or `bench start`?

Omkar Ghatpande

unread,
Sep 4, 2014, 12:11:38 PM9/4/14
to erpnext-developer-forum

Using 'bench start'

>
> --
> Note:
>
> If you are posting an issue,
>
> 1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
> 2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
> 3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
> 4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

> To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAG8U0EnkYJMGwq_%2B-p7-oFZdhZs3pfzFUO61nGrcbpW03FARZg%40mail.gmail.com.

Pratik Vyas

unread,
Sep 4, 2014, 12:18:17 PM9/4/14
to erpnext-dev...@googlegroups.com
> Using 'bench start'
`bench start` will always use the default site. Configure supervisor.
It will also start the erpnext service on boot.

https://github.com/frappe/bench#supervisor

Thanks,
--
Pratik
erpnext

Omkar Ghatpande

unread,
Sep 5, 2014, 5:23:42 AM9/5/14
to erpnext-developer-forum
I did the supervisor setup.. and restarted my box. On grep bench, I can see that bench is running.

I assume, Supervisor takes care of application start-up, but now I'm getting a '404 Not Found' while accessing the application. Not able to 'bench start' as well because processes are already running. 

Any missing step?

Thanks for all your help Pratik,

Omkar


--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

Omkar Ghatpande

unread,
Sep 5, 2014, 5:39:12 AM9/5/14
to erpnext-developer-forum
Update - Application accessible on 127.0.0.1 (I was trying with localhost.. not sure what's the difference)

So now, how should I access my 2nd site? I'm getting the default one at 127.0.0.1

Thanks, 

Omkar

Pratik Vyas

unread,
Sep 5, 2014, 6:02:13 AM9/5/14
to erpnext-dev...@googlegroups.com
On Fri, Sep 5, 2014 at 3:08 PM, Omkar Ghatpande
<omkar.g...@gmail.com> wrote:
> Update - Application accessible on 127.0.0.1 (I was trying with localhost..
> not sure what's the difference)
>
> So now, how should I access my 2nd site? I'm getting the default one at
> 127.0.0.1
>
> Thanks,
>
> Omkar

Hi Omkar,

So, port 82 is not accessible?

`curl http://127.0.0.1:82/`

Thanks,
--
Pratik

Omkar Ghatpande

unread,
Sep 5, 2014, 6:12:31 AM9/5/14
to erpnext-developer-forum
Yup, that did it. Was not accessible before, so reset my port for the 2nd site which is accessible now.

Thanks a lot!

Omkar


--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

Pratik Vyas

unread,
Sep 5, 2014, 7:30:29 AM9/5/14
to erpnext-dev...@googlegroups.com
On Fri, Sep 5, 2014 at 3:42 PM, Omkar Ghatpande
<omkar.g...@gmail.com> wrote:
> Yup, that did it. Was not accessible before, so reset my port for the 2nd
> site which is accessible now.
>
> Thanks a lot!
>
> Omkar

Great!

Any changes you recommend for
https://github.com/frappe/bench/wiki/Multitenant-Setup ?

Thanks,
--
Pratik
ERPNext

Omkar Ghatpande

unread,
Sep 5, 2014, 8:35:28 AM9/5/14
to erpnext-developer-forum
2 small points which I think might be helpful for others:

1. In the 2nd section, need to mention - Supervisor setup is required and 2nd site can be accessed at localhost:<port set above>
2. In the 'reload nginx', I had to run 'sudo service nginx reload' on ubuntu. (Correction might be required). Also, need to make sure /nginx/sites-enabled and /nginx/sites-available is empty (was not in my case).

Thanks

Omkar
 

Thanks,
--
Pratik
ERPNext


--
Note:

If you are posting an issue,

1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages