Multitenancy Setup Issue

Hi Everyone!,

I have followed the instructions outlined in official documentation for setting up multi-tenancy in ERPNext and Frappe. Despite executing all commands without encountering any errors, I am encountering difficulties accessing the new site via the designated URL.

While my application functions correctly when initiated through the URL http://192.168.2.30:8000/, it fails to operate when accessed through the URL aalam.siteone.com:8000.

I also added the host in respective /etc/hosts file.

I would greatly appreciate your assistance in troubleshooting and resolving this issue.

Thank you for your attention to this matter.

Sincerely,
Vijay Perumalsamy

I followed DNS based multitenancy.

Hi @Vijay-Perumalsamy
Please watch this video. I hope you get help

Thank You!

Hello @Mohammadali,

I appreciate your assistance and thankyou for your time. I’ve followed the instructions in the video and successfully executed all the mentioned commands. However, I’m encountering an issue where I can only access the default site, and even then, only through the respective server URL. I’ve updated the /etc/hosts file accordingly, but I’m still unable to access my newly created sites using URLs like aalam.siteone.com:8000 and aalam.sitetwo.com:8000.

Could you please help me identify any mistakes I might have made?

Hi @Vijay-Perumalsamy
Please check the currentsite.txt file. If so remove it and try again.
Thank You!

Hi @Mohammadali,

There isn’t a “currentsite.txt” file. Instead, there’s an option called “defaultsite” in the “common_site_config.json” file. When I set the “defaultsite” to my newly created site, it functions properly only on the URL “192.168.2.30:8000”. However, if I remove the default site, it stops working altogether.

Are there any alternative solutions to address my problem?

Hi @Vijay-Perumalsamy

Please share “common_site_config.json” file

Here is my common_site_config.json file:

{
“background_workers”: 1,
“default_site”: “aalam.siteone.com”,
“developer_mode”: 1,
“dns_multitenant”: true,
“file_watcher_port”: 6787,
“frappe_user”: “aalamuser”,
“gunicorn_workers”: 5,
“live_reload”: true,
“maintenance_mode”: 0,
“pause_scheduler”: 0,
“rebase_on_pull”: false,
“redis_cache”: “redis://127.0.0.1:13000”,
“redis_queue”: “redis://127.0.0.1:11000”,
“redis_socketio”: “redis://127.0.0.1:13000”,
“restart_supervisor_on_update”: true,
“restart_systemd_on_update”: false,
“serve_default_site”: true,
“server_script_enabled”: 1,
“shallow_clone”: true,
“socketio_port”: 9000,
“use_redis_auth”: false,
“webserver_port”: 8000
}

@Vijay-Perumalsamy
please try it

{
“background_workers”: 1,
“developer_mode”: 1,
“dns_multitenant”: true,
“file_watcher_port”: 6787,
“frappe_user”: “aalamuser”,
“gunicorn_workers”: 5,
“live_reload”: true,
“maintenance_mode”: 0,
“pause_scheduler”: 0,
“rebase_on_pull”: false,
“redis_cache”: “redis://localhost:13000”,
“redis_queue”: “redis://localhost:11000”,
“redis_socketio”: “redis://localhost:13000”,
“restart_supervisor_on_update”: true,
“restart_systemd_on_update”: false,
“serve_default_site”: true,
“server_script_enabled”: 1,
“shallow_clone”: true,
“socketio_port”: 9000,
“use_redis_auth”: false,
“webserver_port”: 8000
}
1 Like

Got it @Mohammadali , if we remove the default site, none of the sites are functioning in the UI