Thank you for your suggestion. I’m already familiar with the multi-tenancy feature in Frappe. Here’s my current setup:
- I have a self-hosted Ubuntu VPS.
- I’ve installed one bench instance named
frappe-bench.
- Under this bench, I’ve created two sites:
a.localhost and b.localhost.
- Production mode has not been configured yet.
What I’m trying to achieve:
I want to run both sites simultaneously—a.localhost accessible at server_ip:8000 and b.localhost at server_ip:8001.
Steps I’ve taken so far:
- I tried starting each site on a different port using
bench --site a.localhost serve --port 8000
and
bench --site b.localhost serve --port 8001
in separate terminals.
However, this approach hasn’t worked as expected and I’m encountering errors.
Could you please guide me on the correct way to run multiple sites in development mode on different ports using a single bench installation?
Traceback (most recent call last):
File “env/lib/python3.10/site-packages/redis/connection.py”, line 699, in connect
sock = self.retry.call_with_retry(
File “env/lib/python3.10/site-packages/redis/retry.py”, line 46, in call_with_retry
return do()
File “env/lib/python3.10/site-packages/redis/connection.py”, line 700, in
lambda: self._connect(), lambda error: self.disconnect(error)
File “env/lib/python3.10/site-packages/redis/connection.py”, line 1002, in _connect
raise err
File “env/lib/python3.10/site-packages/redis/connection.py”, line 990, in _connect
sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “apps/frappe/frappe/www/app.py”, line 30, in get_context
boot = frappe.sessions.get()
File “apps/frappe/frappe/sessions.py”, line 183, in get
bootinfo.has_app_updates = has_app_update_notifications()
File “apps/frappe/frappe/utils/change_log.py”, line 218, in has_app_update_notifications
return bool(frappe.cache.sismember(“changelog-update-user-set”, frappe.session.user))
File “apps/frappe/frappe/utils/redis_wrapper.py”, line 278, in sismember
return super().sismember(self.make_key(name), value)
File “env/lib/python3.10/site-packages/redis/commands/core.py”, line 3359, in sismember
return self.execute_command(“SISMEMBER”, name, value)
File “env/lib/python3.10/site-packages/redis/client.py”, line 1266, in execute_command
conn = self.connection or pool.get_connection(command_name, **options)
File “env/lib/python3.10/site-packages/redis/connection.py”, line 1457, in get_connection
connection.connect()
File “env/lib/python3.10/site-packages/redis/connection.py”, line 705, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:13000. Connection refused.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File “apps/frappe/frappe/website/serve.py”, line 20, in get_response
return renderer_instance.render()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 84, in render
html = self.get_html()
File “apps/frappe/frappe/website/utils.py”, line 534, in cache_html_decorator
html = func(*args, **kwargs)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 95, in get_html
self.update_context()
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 163, in update_context
data = self.run_pymodule_method(“get_context”)
File “apps/frappe/frappe/website/page_renderers/template_page.py”, line 223, in run_pymodule_method
return method(self.context)
File “apps/frappe/frappe/www/app.py”, line 32, in get_context
raise frappe.SessionBootFailed from e
frappe.exceptions.SessionBootFailed
I’m trying to run multiple sites on the same server without a domain name (only using the server IP).
Here’s what I tried:
- In the first terminal, I ran:
bench start
- In the second terminal, I ran:
bench --site a.localhost serve --port 8001
- In the third terminal, I ran:
bench --site b.localhost serve --port 8002
With this setup, both sites open in the browser simultaneously, but the issue is that I keep getting logged out suddenly.
Since I don’t have a domain name yet, I want to access these sites only through the server IP.
Could anyone please guide me on how to properly configure this so sessions don’t conflict? Any hints or suggestions would be much appreciated.
Thanks in advance!