I have many spring boot jars running in different ports. Say 9087-9090. I have a domain say
mydomain.com.
I can access mydomain.com:9087/ and use the application. Also mydomain.com:9088/ and use another application but how can i use them just like mydomain.com and still map them to desired ports. What is the technical term for this.
I use digitalocean hosting and have a Ubuntu 14.04 x64 Box. I'm running Java 7 in it.
You need a reverse proxy (a.k.az front end load balancer) with URL rewriting. I'm not sure what you hosting solution offers or permits, but you could try nginx or Apache httpd if you want something running locally. There are also service providers you might be able to use outside your host.
Related
When installing ASP.NET Core apps on a windows machine, I used to install the websites within IIS, I used the bindings there to route depending on the URL to the correct web application and I used Letsencrypt to create the SSL certificates.
Now I want to start shipping my applications using Docker. The samples show, how to easily create an ASP.NET Core dockerized project, but that's where most of them end. So in the end I've got an ASP.NET application in my docker running listening on port 5000.
Are there any suggestion or resources showing how to set it up on a production system?
multiple web sites listening on the standard ports 80 and 443 and forwaring to the correct docker image
SSL certificate handling
Setup ngingx as a front end. It is world-class solution, used by top-traffic sites as a front-end for incoming requests.
Among other features it does:
Redirecting based on plenty of rules
SSL management (you can use unencrypted connections behind it)
Load balancing
It is free and available as docker image.
So, you open only ngingx outside your docker network, and make it route all your traffic inside.
Setup reverse proxy like nginx, even in IIS also you redirect to corresponding docker service having a particular port. You can fan out traffic to respective ports.
Image: https://blogs.msdn.microsoft.com/friis/2016/08/25/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps/
I'm using both JIRA and Confluence on the same server, running on Windows, using Apache Tomcat.
I have two domains pointing at the server, jira.company.com and confluence.company.com.
JIRA is running fine on port 80 in the Apache Tomcat instance, and I can get to that on the JIRA.company.com domain just fine.
Confluence is currently running on port 8090 on the same machine. What I'm trying to do is get Confluence working on the confluence.company.com domain.
Most of the documentation I can see is about configuring virtual hosts and reverse proxies in httpd.conf, however in Apache Tomcat all I have to work with is the server.xml file.
I understand I can add another host to the JIRA server.xml file to point to a different docBase for Confluence, but I have a feeling this breaks Atlassian's own recommendations found here.
When I add an additional host entry into Confluence's server.xml it's ignored, and the confluence.company.com domain sends me through to JIRA.
I've done some searching and found similar questions but they don't seem to apply to my configuration - they all mention httpd.conf which isn't present on my server.
My questions:
Can I run Confluence on the subdomain by adding an extra entry in JIRA's server.xml? If possible, is this bad?
Is there another way to get my Confluence Apache instance listening on port 80 but on it's own domain name?
I can do all this on IIS with my eyes shut, but in Apache/Tomcat I'm a little lost. Thanks in advance!
Tomcat is not really meant to directly handle incoming requests as usually an Apache or other proxy is put in front of it to hide the ports and provide other useful features you would need for Single Sign On etc. Note that there is a difference between the Apache Webserver, which is commonly only called "Apache" and "Apache Tomcat", which is only an application server made by the Apache Foundation community and named "Tomcat". Tomcat only supports basic webserver functionality.
In any case, you can use the IIS as a webserver and proxy to forward the requests and at the same time hide the ports of the applications. I personally haven't used IIS but Atlassian offers a thorough explanation for the Confluence and/or JIRA integration with IIS as a proxy: https://confluence.atlassian.com/adminjiraserver071/integrating-jira-applications-with-iis-802593039.html
The page covers JIRA for the most part but section 4 also has additional information if you want to hook up both JIRA and Confluence on the same server, which is exactly your use case.
This is a bit of a tricky situation. I'm testing deployment of a Laravel application which I've recently containerised. I've made a container based on php, which runs Apache inside itself to serve the application. If I simply run this container, bound to port 5000, then link_to('/login') correctly generates a link pointing to localhost:5000/login.
However, now I'm testing an actual deployment scenario, where this container is running behind an nginx load balancer. I've set up a VM using Vagrant, which is running two containers: one for the nginx load balancer, and one for the Apache/Laravel application. I access the VM's port 80 on my host's port 7000.
In this situation, link_to('/login') now generates links pointing to localhost/login. Where did the port go missing? It should link to localhost:7000/login, because that's the port I'm accessing the page on.
How can I debug this? I've tried looking into the implementation of link_to, but I suspect the problem is elsewhere.
EDIT
I've just discovered that in addition, if I serve the site over HTTPS (terminated at nginx; Apache still does everything over HTTP), this is also stripped from links created by link_to. Instead of https://localhost:7443/login, the link looks like localhost/login.
The solution is to use something like fideloper/proxy to properly handle the proxy headers added by Nginx. I thought I had done this, but I'd forgotten to add the facade to app/config/app.php.
I have a web server that responds to a number of different sites on port 80. Currently, IIS does the mapping to various sites via host headers, but I'd like to be able to serve other web apps on port 80 hosted in Jetty or Tomcat. IIS prevents that by grabbing all port 80 traffic.
I basically need a reverse proxy to just change the port number to something that another app stack can listen in on. I was looking into nginx but it seems to not be quite ready for prime time on Windows. Eventually I may set up a Linux box specifically for this, but for now I'm interested in a solution which will run all on the same box.
All I really need is something very light which mostly just matches hostname/port and allows rewriting of the port. Does anyone have any suggestions?
If you are running in IIS 7 or above you can use Application Request Routing for that: http://www.iis.net/download/ApplicationRequestRouting
For IIS 5-6, it looks like Apache Tomcat Connector (JK 1.2) is a clean solution. This is an IIS ISAPI filter which allows IIS to act as a reverse proxy for other web servers. It uses Apache JServ Protocol (AJP) to communicate with the app server actually serving requests. Both Tomcat and Jetty implement AJP. URLs are mapped with regex-like config to a particular AJP server instance.
Overview: http://www.iisadmin.co.uk/?p=40&page=3
IIS Config: http://tomcat.apache.org/connectors-doc/reference/iis.html
Mapping Config: http://tomcat.apache.org/connectors-doc/reference/workers.html
This ISAPI plug-in also works with IIS 7.x, but in that case the Application Request Routing (see marked answer) should be considered as it might work better with non-AJP servers.
What is the preferred way of deploying a compojure/sinatra applications? I have multiple sites running on the host so i can't run jetty/mongrel on port 80. How should i handle multiple sites/applications running at the same host?
Use a web server such as Apache that runs on port 80 and use virtual hosts to direct the traffic to the right app server. So basically you would run each application server (jetty/mongrel, etc.) on a different port and then in each virtual host would have a different configuration to use something like mod proxy to forward the traffic to the app server. You could use a different web server such as lighttpd or nginx. For the sinatra app you could also look at Phusion Passenger, a.k.a mod rails, a.k.a mod rack, which theoretically works with any rack app, although I've only used it with Rails.
If you look into it some more you'll find that there are various schemes for forwarding traffic to the app server from a web server, but the basic mechanism for doing this kind of thing always boils down to having a web server that listens on port 80 that uses name-based virtual hosts to then forward the traffic to the appropriate app.
I've been doing this kind of thing with various standalone servers (e.g., AllegroServe) for years. I've found the best approach to be:
Run each server on a different, non-privileged port (such as 8080)
Run pound (or Nginx etc.) on 80, configured to map requests to each application.
Pound is great, and the configurations end up very simple (unlike Nginx). It will also do SSL fronting and HTTP sanitization for you, which takes the burden off your application.
Use passenger! http://modrails.com - it is a plugin for apache and nginx that lets you (very) easily run a ruby app as a virtual host