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:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Without port address = port 80 for http, or port 443 for https.

If these ports are not already open then you can configure your ABM server to listen on these ports.

In most cases you will need to configure a backward proxy. @alwaysbusy probably has more experience with the required configuration.
Note that you need to run a backward proxy that supports WebSockets.
 
Upvote 0

John Naylor

Active 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.

I do it using the .htaccess file - add the following....


<If "%{HTTP_HOST} == 'example.com'">
Redirect "/" "https://example.com:15000/"
</If>
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
Without port address = port 80 for http, or port 443 for https.

If these ports are not already open then you can configure your ABM server to listen on these ports.

In most cases you will need to configure a backward proxy. @alwaysbusy probably has more experience with the required configuration.
Note that you need to run a backward proxy that supports WebSockets.
I have configure ABM server to listen to port 80.

Now I can browse http://www.mydomain.com/GeraiSoftware, but still coludn't browse if only type these http://www.mydomain.com.

What is backward proxy ? How to implement this with ABM/B4J?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I don´t think the www folder is the correct place for it.
You need to put the file to a server path accessible to your webserver listenening at port 80.
It is the Apache (?) task (http daemon) who is reading and handling .thaccess files.
Sorry, I don't know if this is Apache or not, this thing is new for me.

I made it via ABM mini template.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
To be honest, we outsourced that part ourselves. I know there is an Apache and HAProxy running on the server but how it is configured exactly, no idea.

I did not know one could use the .htaccess file to do that too. It should be placed indeed in your Apache (port 80/443) www, NOT in the ABM (port e.g. 51042) www! The ABM app should be placed in your HOME folder, NOT the Apache www folder.
 
Upvote 0

John Naylor

Active Member
Licensed User
Longtime User
What OS are you deploying on? Windows? Linux?

Possibly more importantly what OS will you be using when you deploy for real?

.htaccess sits just above your www folder and is often hidden from view.

If you're currently on a Windows box and will be eventually deploy to a Linux machine then I'd simply not yet worry about getting it to work as you want right now. You can sort that when you deploy for real.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi all,
correct me if I am wrong (I didn't yet use ABM-wonder so far).
Turning off Apache (ISS or any other "standard" webserver) and setting ABM to ports 80/443, we would have a chain like the following:
DNS-->Static IP of server machine --> ABM
since ABM would be the only service listening on ports 80/443, right?
It could be used to show a minimalist website too if a few static html pages are stored in its www dir, right?
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
What OS are you deploying on? Windows? Linux?

Possibly more importantly what OS will you be using when you deploy for real?

.htaccess sits just above your www folder and is often hidden from view.

If you're currently on a Windows box and will be eventually deploy to a Linux machine then I'd simply not yet worry about getting it to work as you want right now. You can sort that when you deploy for real.
I have deploy it to the Linux OS.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
So, guys, kind of confused here.

My vps OS is Ubuntu server.

I installed Java 8 on the VPS, then copied ABM app & www folder into home folder and run ABM app via command line java -jar.

Just like that.
So can this achieve with settings like those?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Just like that.
that´s correct to start your app.

But you want to start the app with pointing to a port 80 url.
So you need to extend the port 80 webserver functionality to forward requests to the b4j app runing on another port. THIS is what the .htaccess does/supposed to.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
To be honest, we outsourced that part ourselves. I know there is an Apache and HAProxy running on the server but how it is configured exactly, no idea.

I did not know one could use the .htaccess file to do that too. It should be placed indeed in your Apache (port 80/443) www, NOT in the ABM (port e.g. 51042) www! The ABM app should be placed in your HOME folder, NOT the Apache www folder.
Where is Apache (port 80/443) www folder on ubuntu server?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Where is Apache (port 80/443) www folder on ubuntu server?
Did you tried to consult GOOGLE first? I´m sure there are hundrets of results.

One result:
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
I think my vps does not have Apache installed, so this .htaccess file can be implemented.

I don't want to install Apache in this app.

I tried Erel's suggestions to set ABM app to listen to port 80, it worked if the address type like this

Without ABMapp in the address, it won't work.

Is there other alternative?
 
Upvote 0
Top