Mapping Domain Name to Tomcat application - linux

I am having stand alone Linux Centos server with Static IP. I am running two tomcat application http://IP:8080/sampleapp, http://IP:8090/myapp. i can access that both application from internet.
i bought domain from ipage.com. now i wanted to map http://sampleapp.com to http://IP:8080/sampleapp and http://myapp.com to http://IP:8090/myapp.
I don't want to add another apache layer to forward port.
How can i map..? please help me

You can give a redirection in your ipage.com DNS setting which redirects your domain to your static IP.
But I would like to suggest you can run on port 80 to just make your link prettier.

Your requirement is not very clear. However you can deploy both apps to the same port, like 80, and then use Tomcat virtual host to achieve what you need: https://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html

Related

Accessing Web application in tomcat without port numbers

I am trying to have multiple tomcat instances on a Linux server and each instance would have an web application ROOT deployed in it.
While accessing the application, the url is formed in the format : whereas I don't want the end users to remember the ip address or the port of the application.
Since more than one instances would be used in the linux server, defaulting to 80 port ( http ) and 443 ( https ) wouldn't help out.
The idea is to expose the DNS name for the application and looks like Apache HTTP server would help me solve the case. Is the approach right ?
I assume the apache server should be one per linux server vs one per tomcat instance. Could this be confirmed ?
The Apache Tomcat version is 8.5.4 and the plan is to go with the apache http server version 2.4
Setting an Apache HTTPD (or any other) as front server is a good approach.
You won't be able to use more than one Apache HTTPD per server, since you don't want to use :port notation in the url's, at least it will not be possible to use standard HTTP/HTTPS ports in more than one HTTPD at once at the same server.
If you plan to use both http and https, you should create at least one virtual host for each of them. There is a limitation on creating virtual hosts for name based virtual host while using SSL 443 port, so if you want to have more than one HTTPS port enabled you will need IP based virtual hosting.
This is the Apache HTTPD 2.4 virtual host documentation.
Then, you could forward requests to each Tomcat using mod_proxy or tomcat connector. I personally choose one or other depending on the current requirements, specially if there is straight correspondence between contexts in Tomcat and Apache HTTPD (in this case I use AJP) or there's the need to rewrite it (mod_rewrite):
httpd://apache.httpd/context1 -> tomcat:XXXX/context1 (ajp tomcat connector)
httpd://apache.httpd/ -> tomcat:XXXX/context2 (mod_rewrite)
httpd://apache.httpd/context3 -> tomcat:XXXX/context4 (mod_rewrite)

IIS In use Port Redirection

We had a service running in IIS at example.com:88 in one of our server and the url is hardcoded in most of our client apps in android /ios
We needed to move our applications to a new location and this time we had Windows domain among our servers.
That made port 88 busy and occupied with Kerberos.
Now that we have moved all our application and main domain name to the new environment. We are not able to find any workaround to redirect connection coming on port 88 to a different address.
Need help with a workaround to the problem.
Do you have Multiple Public IPs form your ISP?
if so you can assign/change/add one of those ip to this application/server and have that port also open on that public ip.
Solution depends what kind of router you have and if you are able to acquire additional IPs. Also is it possible to access the app using a FQDN?

deploying a node.js on a new domain

I have a server that runs different websites on different ports. All of them (but one) are Apache servers and thanks to webmin, I managed to have, for instance, example.com point to 123.123.123.123:80 and example.fr to 123.123.123.123:8000, somehow automatically
I am now running a nodejs server on the same machine, so the 80, 8000, and many other ports are already taken. My nodejs listens on 8008. I have another domain name, say example.org, and I want it to point to my nodejs website, but I simply don't know how to do that! I have updated the DNS and everything is pointing to 123.123.123.123 (my server's IP). I want to avoid using an ugly example.org:8008/ for everything on this node server. How can I make it point implicitly to the 8008 port?? I must add that I cannot afford to take down the apache servers ;)
DNS only provides name to ip address mapping. It cannot handle ports. What you can do instead is to set up a proxy server listening on port 80. The proxy server can then return data based on the host header.
Your best option is to just redirect the request from Apache. Otherwise you can use a reverse proxy like Nginx. Also, you can write a lightweight proxy in node... check out this page

Hosting node.js for a specific domain only on a VPS

I have a VPS where I have hosted a few sites. All based on LAMP stack, so it was no big deal. They provide WHM/cpanel for managing different sites. I decided to try node.js, bought a separate domain for it, and I need some clue how to point that domain to the node.js application.
So here are the questions:
1) What is the best way to host node.js application on a specific domain without hampering the other sites? How will I configure the domain? Yes, I'd like to use default http port (80) for node.
2) As Apache is already listening to the 80 port, is it a good idea to use Apache mod_proxy for the purpose? I mean if I want to use websocket, will apache still use separate threads for maintaining connection to node?
PS. I have already seen this question, but the answers don't seem to be convincing.
Edit:
I forgot to mention, I have an unused dedicated IP for that VPS which I can use for node.js.
Follow these steps
Goto "WHM >> Service Configuration >> Apache Configuration >> Reserved IPs Editor" and then 'Reserved' the IP that you want to use for node.js. This will release the IP from apache.
Create a new DNS entry with a A entry like - example.com A YOUR_IP_ADDRESS
Tell the node.js server to listen to your IP using server.listen(80, "YOUR_IP_ADDRESS");
If Apache is already listening to port 80, then the only thing you can do is proxy to your node instance. And yes, apache will create a new thread for each connection.
As others have mentioned, there's not a whole lot you can do here. Apache is currently driving your server and node.js won't like riding shotgun.
I'd recommend checking out things like nodester, no.de, heroku, and so on.

Mapping domain name to linux server

I bought a domain name with GoDaddy.com. I have a Ubuntu linux server running with Rackspace Cloud. On this server, I have Apache up and running.
My question is this: How can I set up my domain to point to my server with Rackspace Cloud. More specifically, I want http://www.mydomainname.com to map to my Apache server.
I am assuming that I need to establish something with DNS.
Thank you for your help.
Make a new A record and point www to your ip address, eg 69.69.120.200. Also make another A record and point # to the same IP.
Then make corresponding virtualhosts in Apache with ServerName domain.com
Create the record as meder said, then in the GoDaddy interface you will need to point the name server to the name servers at Rackspace.

Resources