Hosting web app on different web server

code_af2 years ago

What will be the recommended way if someone want to host the web app on a different hosting server, is there a place or places to change the URLs for accessing APIs in the web app?

Anton Tananaev2 years ago

I would recommend using a proxy for the API.

code_af2 years ago

I have our own web app on the default web directory of traccar, so now I want to add the modern app also to the same server, as a sub directory of the web directory.

For the APIs, it is already working on root path, but the problem is, the modern app is in a sub directory and it is refrencing the static folder and some other files from the root path instead of relative path.

Anton Tananaev2 years ago

Why do you need a sub directory? Our recommendation is to use a subdomain instead.

code_af2 years ago

Actually I set the path to ./web folder, and it contains a customized web application. So, now if I browse the IP, I can access the customized application. I added a subdomain with A record pointed to the IP of traccar server, and I can browse directly the customized application when I browse the subdomain.

Now, I also want to have the official traccar web app, with another sub domain, but I don't have an idea to do this. Therefore I put it in sub-directory in traccar server and attempted to redirect traffic with proxy on traccar server, but it didnt' work.

Anton Tananaev2 years ago

Use Apache with virtual hosts for different domains. Host the app in Apache and proxy API to Traccar.

code_af2 years ago

But web hostings are not allowing to edit Apache configuration, because it is shared hosting.

Is it possible to have two web apps on the Apache of the server where Traccar is installed?

Anton Tananaev2 years ago

Yes, of course it's possible.