OHDSI Home | Forums | Wiki | Github

WebAPI default port change

Hi All

I want to deploy 2 different Atlas & WebAPI on same server.(port 10000, 20000)
but WebAPI has port 8080 by default.
how can i change WebAPI port from 8080 to another one?

thanks

I think it’s didn’t need to change webapi port.

it’s a best solution that change tomcat port and altlas port.

-Atlas change path: “/Atlas/js/config-local.js”

-tomcat change reference: [Tomcat] 아파치 톰캣 서버 포트 변경하기

2 Likes

답변감사합니다 선생님

When you are running a local environment (for development), WebAPI runs in an ‘enbedded’ mode where an internal instance of Tomcat is spawned to recieve HTTP requsets. You can set the port of this by overriding the value in your POM configuration (using settings.xml when you build your WAR file). The configuration parameter can be seen here.

For non-development deployments, you usually have a Java servlet container (like Tomcat) already running. This Tomcat instance was installed on the server and is configured to receive requests on a specific port. So, if you want 2 different WebAPIs in that environment, you’ll have two instances of Tomcat installed on your server, each configured to recieve requests on a different port. Then you go to the administration console on each Tomcat instance and deploy WebAPI separately. Then you will have a WebAPI hosted on the Tomcat Instance on port 10000, and the other WebAPI hosted on the Tomcat on port 20000.

Once you have that, you will need to configure your Atlas to point to the correct WebAPI on the correct port, as @11112 explained.

-Chris

One way to do this is via Docker. You can create several WebAPI docker containers (all would be port 8080 within the container), add them all to a docker network, and then you could use something like nginx to create your own ports for each WebAPI.

t