B4J Question Install SSL on a server already running apache (Jetty)

Douglas Farias

Expert
Licensed User
Longtime User
Hello.

I have a VPS running cpanel/apache with several domains working correctly.

I would like to know how I can run B4J Server (Jetty) at the same time on this VPS without having problems with the ports.

I tried running a .jar generated on port 51042, without SSL and it worked fine.

But when I try to configure ssl, on port 443 I can't run the .jar because this port is already in use by apache.

I tried to change port 443 to 447 but the browser shows invalid certificate.

Could someone help me with this configuration?
I believe it is possible, as I noticed that the erel service runs on a different port and with SSL installed.



what I already tried.

- Generate the SSL and keystore using the VPS IP, but it gave an invalid certificate error when accessing the url.

I used sslzero to generate the SSL, but there in sslzero there is no way to add a port on the IP, only the IP.

- I also tried to use the ssl certificate of a domain that is already working in apache.

mydomain.com is already working with normal ssl.
however when I use the keystore of this ssl certificate it also shows invalid certificate error.

So I'm in doubt, should I use an ssl for my vps IP or for a domain that is already working in apache?

I would just like to access
https://ip: port

or

https://domainworkingonapache.com: port


Thxx
 
Last edited:

EnriqueGonzalez

Well-Known Member
Licensed User
Longtime User
Hi douglas, the key to have 2 web servers on the same machine and both with SSL is called Reverse Proxy, there are plenty out there the one i like the most is Caddy.

If you are more confortable with standard technologies then you can do the same with NGINX (or however you write it)
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
Reverse proxy is always great solution, some on benefits in articles below:




I'm using nginx open source for all of my web sites.

For SSL you can use CertBot.
 
Last edited:
Upvote 0
Top