B4J Question [SOLVED] [ABM] How to point a domain to a Website made by ABM?

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I don't know if this is related to ABM or not, so forgive me if it is not.

I made a website with ABM.

My web address is http://localhost:15000/MyWeb/.

I have uploaded this website to a vps and I have a domain that point to the ip address of that vps.

I can type in browser http://mydomain.com:15000/MyWeb/ and the website showed OK.

My question is can I just type http://mydomain.com (without port address and MyWeb) to show my web site ?
Is this handle via ABM or via domain or what? I am newbie to this kind.

Thanks in advance.
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
I don't want to install Apache in this app.
Apache is not part of your app.

Apache is a webserver and part of your server.
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Look at the StartServer and StartServerHTTP2 in the ABMApplication class module. In both there is a section that you need to uncomment one line
B4X:
    ' uncomment this if you want to directly access the app in the url without having to add the app name
    ' e.g. 192.168.1.105:51042 or 192.168.1.105 if you are using port 80
    srvr.AddFilter( "/", "ABMRootFilter", False )
Make sure you have ABMRootFilter.bas included in your project. If necessary, it can be found in the Templates directory
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
In both there is a section that you need to uncomment one line
Completely forgot about that one! In case you use the ABMServer library, you will have to make this change in the library for now. I'll see it will become a parameter in a future update.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I'll see it will become a parameter in a future update.

So an update IS planned!(?)
May I suggest that the new SSL library and functional code to be included so that managing ssl can be a pleasant experience instead of the current nightmare state!?
 
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
I have deploy it to the Linux OS.
You should be able to modify your .htaccess file as I described then.

When you point a Web browser at your url it'll look inside your wwwroot folder. In there you should create the .htaccess file as I described above. Then you can force the browser to automatically point anywhere you want

Use nano or vim or whatever text editor you prefer to create / edit the file
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Look at the StartServer and StartServerHTTP2 in the ABMApplication class module. In both there is a section that you need to uncomment one line
B4X:
    ' uncomment this if you want to directly access the app in the url without having to add the app name
    ' e.g. 192.168.1.105:51042 or 192.168.1.105 if you are using port 80
    srvr.AddFilter( "/", "ABMRootFilter", False )
Make sure you have ABMRootFilter.bas included in your project. If necessary, it can be found in the Templates directory

If I included ABMRootFilter.bas in the project, got an error :
ABMRootFilter is declared twice

If dont included, got an error
Main - 63: Undeclared variable 'srvr' is used before it was assigned any value.

So I don't included ABMRootFilter.bas, changed the code into this
B4X:
Sub Process_Globals
    Public Server As ABMServer
End Sub

Sub AppStart (Args() As String)
    Server.Initialize("", DonatorKey, "123") ' Application = ' the handler that will be used in the url e.g. http://localhost:51042/template
    Server.Port = 80
    Server.srvr.AddFilter("/", "ABMRootFilter", False )
End Sub

It worked.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
You should be able to modify your .htaccess file as I described then.

When you point a Web browser at your url it'll look inside your wwwroot folder. In there you should create the .htaccess file as I described above. Then you can force the browser to automatically point anywhere you want

Use nano or vim or whatever text editor you prefer to create / edit the file
I don't have Apache installed on the VPS, can this method use?
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Guys,

I managed to point my domain to ABM app just like a normal web address (ie www.mydomain.com) if ABM app listen to port 80, thanks to OliverA for his suggestion.

Since port 80 is usually used for http port, what are the effects if I used it for ABM app?

I use this VPS not only for ABM app, but for jRDC2 server and for download center. Will there any effect to jRDC2 & download center ?
 
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
Guys,

I managed to point my domain to ABM app just like a normal web address (ie www.mydomain.com) if ABM app listen to port 80, thanks to OliverA for his suggestion.

Since port 80 is usually used for http port, what are the effects if I used it for ABM app?

I use this VPS not only for ABM app, but for jRDC2 server and for download center. Will there any effect to jRDC2 & download center ?
Download center uses ports 9999 and 55555, jrdc2 uses whatever port you decide to use so you shouldn't have any issues.
 
Upvote 0

RWK

Member
Licensed User
Install nginx proxy manager to your ubuntu server.
Configure the domain to point to this server
In nginx you can route any incomming traffic on port 80 or 443 to any server and port.
So you can host different web services on different ports which you can reach on different subdomains or different subpages.

As a nice side effect you can automate your lets encrypt ssl certificate generation.

For other services like jrdc, jitsy, video... you can configure streams in nginx to throughpass or redirect the ports.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Install nginx proxy manager to your ubuntu server.
Configure the domain to point to this server
In nginx you can route any incomming traffic on port 80 or 443 to any server and port.
So you can host different web services on different ports which you can reach on different subdomains or different subpages.

As a nice side effect you can automate your lets encrypt ssl certificate generation.

For other services like jrdc, jitsy, video... you can configure streams in nginx to throughpass or redirect the ports.
Thanks for your suggestion.
But for now, I think, I will not install others software to this vps, just stick to what ABM app can handle.

This is because, this vps is an active one, there are a lots users use it and I can't take a risk if something goes wrong by modification it.

I do have a plan to rent another vps, and when it is happen, I can explore many option, such as install Apache and most probably install nginx proxy manager as your suggestion.
 
Upvote 0
Top