Change default port for all sites (whe DNS based multitenancy is on)

Hi,

I have succesully setup “dns based multitenancy” for my self-hosted server. I have 3 sites, all are running on port 80. Now i want to change the default port for all my sites from 80 to 8080.

I have entered the “per site” command: “bench set-nginx-port sitioX.tidax.local 8080” but I think that this command is being ignored for the "DNS based multitenancy on.

I also have tried changing nginx.conf (port 80 to 8080) but that’s not working either.

¿How can i change my default port for all my sites when i use “dns based multitenancy on”?

Thans a lot!!!

@jhon.llatance

You must execute following steps to change ports for your sites from xx to 8080

  • bench setup config (This will create common_site_config.json)
  • Now, in your sites folder edit common_site_config.json to which should like as follows,
{
 "auto_update": false, 
 "background_workers": 1, 
 "frappe_user": "shreyasp", 
 "gunicorn_workers": 8, 
 "rebase_on_pull": false, 
 "redis_cache": "redis://localhost:11319", 
 "redis_queue": "redis://localhost:6387", 
 "redis_socketio": "redis://localhost:12319", 
 "restart_supervisor_on_update": false, 
 "serve_default_site": true, 
 "shallow_clone": true, 
 "socketio_port": 3008, 
 "update_bench_on_update": true, 
 "webserver_port": 8008,
 "developer_mode": 1
}
  • Edit "webserver_port" : 8080 and save the file.

This should do the trick for you. :smiley:

2 Likes

Thanks Shreyasp!!!

Does this solution still work. My instance is just ignoring the webserver port written in common_site_config file.

bench --site site-name serve --port 9020

The above command starts the server in the desired port but user is not able to login. And there are a bunch of socket I/O errors.

What is the recommended way to change the port of the instance from the default 8000?

This is what finally worked for me: