Port based multitenancy on ubuntu local server

I want to create 2 site and test it on my local server, how can I access two different sites using localhost.

@megha007 Refer this Video link :slight_smile:

Thanks

When I execute bench start command. I’m getting this output
but when I run one of the following url not working any of the url
http://localhost:8001
http://localhost:8000
http://my_ip:8001
http://my_ip:8000

7:20:00 system | redis_cache.1 started (pid=10913)
17:20:00 redis_cache.1 | 10920:C 19 May 2022 17:20:00.995 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:20:00 redis_cache.1 | 10920:C 19 May 2022 17:20:00.996 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=10920, just started
17:20:00 redis_cache.1 | 10920:C 19 May 2022 17:20:00.996 # Configuration loaded
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.997 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:20:00 system | socketio.1 started (pid=10923)
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.998 * Running mode=standalone, port=13000.
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.998 # Server initialized
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.998 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.998 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:20:00 redis_cache.1 | 10920:M 19 May 2022 17:20:00.998 * Ready to accept connections
17:20:00 system | redis_queue.1 started (pid=10918)
17:20:00 system | web.1 started (pid=10929)
17:20:01 system | schedule.1 started (pid=10927)
17:20:01 system | redis_socketio.1 started (pid=10916)
17:20:01 redis_queue.1 | 10930:C 19 May 2022 17:20:01.004 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:20:01 redis_queue.1 | 10930:C 19 May 2022 17:20:01.004 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=10930, just started
17:20:01 redis_queue.1 | 10930:C 19 May 2022 17:20:01.004 # Configuration loaded
17:20:01 redis_socketio.1 | 10940:C 19 May 2022 17:20:01.004 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
17:20:01 redis_socketio.1 | 10940:C 19 May 2022 17:20:01.004 # Redis version=5.0.7, bits=64, commit=00000000, modified=0, pid=10940, just started
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.004 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:20:01 redis_socketio.1 | 10940:C 19 May 2022 17:20:01.004 # Configuration loaded
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.005 * Running mode=standalone, port=11000.
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.005 # Server initialized
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.005 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.005 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:20:01 redis_queue.1 | 10930:M 19 May 2022 17:20:01.005 * Ready to accept connections
17:20:01 system | worker_short.1 started (pid=10928)
17:20:01 system | worker_default.1 started (pid=10943)
17:20:01 system | watch.1 started (pid=10931)
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.007 * Increased maximum number of open files to 10032 (it was originally set to 1024).
17:20:01 system | worker_long.1 started (pid=10934)
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.007 * Running mode=standalone, port=12000.
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.007 # Server initialized
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.008 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.008 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
17:20:01 redis_socketio.1 | 10940:M 19 May 2022 17:20:01.008 * Ready to accept connections
17:20:01 socketio.1 | listening on *: 9000
17:20:02 web.1 | * Running on all addresses.
17:20:02 web.1 | WARNING: This is a development server. Do not use it in a production deployment.
17:20:02 web.1 | * Running on http://192.168.1.157:8000/ (Press CTRL+C to quit)
17:20:02 web.1 | * Restarting with stat
17:20:02 watch.1 |
17:20:02 watch.1 | yarn run v1.22.19
17:20:02 watch.1 | $ node esbuild --watch --live-reload
17:20:02 web.1 | * Debugger is active!
17:20:02 web.1 | * Debugger PIN: 760-165-810
17:20:03 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:03 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:03 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:03 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:09 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:09 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:09 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:09 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:12 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:12 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:12 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:12 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:12 watch.1 | clean: postcss.plugin was deprecated. Migration guide:
17:20:12 watch.1 | PostCSS 8.0: Plugin migration guide—Martian Chronicles, Evil Martians’ team blog
17:20:13 watch.1 | Watching for changes…

can you find any solution for this ?
i have same problem

Hy @nilpatel42

Use this command (sudo gedit /etc/hosts) to add this line Add (127.0.0.1 site name) to the file and search for (sitename .com:8000)

i hope it works

Thank You!

Thank You for reply @Mohammadali

i edit the file but still not working

image

@nilpatel42 If there is a currentsite.txt file, remove it and after try it

@Mohammadali

after removing currentsite.txt file in first site error show and second site still not accessible

Thank You

@nilpatel42

The solution is to watch this video carefully

Thank You!

Thank you for helping me @Mohammadali

i tried this step very carefully, but my both site database is same (db name is different i checked)
if i create a lead in one site, in second site also created (one site access with two different domains)
sorry for my English

any mistake i have did ? (i want port based but if this work i adjust with it)

@nilpatel42 If you want to port-wise site then use this command

bench --site [site_name] serve --port 8080

I hope it work

Thank You!

1 Like

sorry @Mohammadali

i don’t understand the process of working with this command

i have two site
site1.local:8000
site2.local:82

when first site running with bench start command
second site command show this

can@can:~/frappe-bench$ bench --site site2.local serve --port 82
can@can:~/frappe-bench$ Permission denied

how to start both at the same time ?

Thank you

It’s working i tried with port 8080

i have doubt why not working with 82
@Mohammadali

thank you for helping for long time :pray:

@nilpatel42 Try This Port Number 8443,8843,8880 It’s Working

Thank You!

1 Like