TOMCAT - Forward services/DNS to other ports - web

Is there a way to make TomCat check the DNS being accessed and direct to the ISS?
I have a problem similar to this, but referring to TomCat.
I have a service running on TomCat port 80 with a DNS-A, and now I'm configuring another service for another port (5000 with DNS-B) but this other service will use the Windows ISS service. I configured the bind on the ISS and informed the host in server.xml.
when I access DNS-B it directs me to the TomCat server with the HTTP Status 404 – Not Found message.
Does anyone know how to proceed with some documentation?
I looked in the tomcat Docs, but nothing similar

Related

Configure Linux Server as Web Server

I am currently working on my own web application. I am hosting aws linux server.
My question is:
I can deploy war file into /var/lib/webapps/test.war, and access each single page from this war, furthermore, I am binging A record to my ip address. Assume, I am binding www.test.com to my ip. So that I can access my web page from test.war by www.test.com:8080/test/single.html.
How can I access only by www.test.com/single.html?
One more thing is, if i have one file t.html under /var/www/html/t.html. I can access this file by www.test.com/t.html.
How should I deploy my test.war in order to access it by www.test.com/single.html
Let me know if any description is not clear. I tried couple of days. Hope anyone can help!
Do you need to deliver static content via the Apache HTTP?
YES: Configure Apache as reverse Proxy for Tomcat.
NO: Configure Tomcat to listen on Port 80.
EDIT:
Since i realized you need further explanation:
Apache HTTP normally listens on Port 80. A Web-Browser tries to connect on Port 80 or 443 automatically when u enter a domain or an IP. Apache HTTP usually serves content from /var/www/....
Tomcat is an Application Server and listens in your case on Port 8080. Tomcat deploys webapps from /var/lib/webapps (With your configuration).
You cant just put a Java webapp in Apache's Document root. Apache has no Idea how to handle such content...
If you want to reach your webapp on Port 80 you can either reconfigure Tomcat to listen on Port 80 or use the Apache HTTP as reverse proxy (https://en.wikipedia.org/wiki/Reverse_proxy).
READ THE DOCS!
Change the port of Tomcat from 8080 to 80. Currently, your tomcat server listens to port 8080. Only if it listens to port 80, the suffix :8080 will be hidden. Only one application can bind to a port at a time, so make sure your Apache HTTP server is not binding to 80.
Change the port of Apache HTTP or just stop this service.
Back up files in folder webapps/ROOT, because your following action will replace its content. Rename test.war to ROOT.war and deploy your application at the root in Tomcat.
Rename test.war to ROOT.war (capitalization important) and deploy it to the same location. Tomcat will use that as the "root" webapp and you won't need to include a folder in the URL.

setting up a MEAN app in production

I am a frontend developer and having issues setting up my MEAN app in production server. I am confused about the role of apache ? if any.
right now I don't have a domain name, just an IP address for a CentOS 6 VPS.
I stopped apache and am using express only, I deployed the app code and ran the grunt task in production environment and the app is listening on port 3000 .. but when I visit the site at
http://104.238.103.223:3000/ I get a "page not available" error
I am confused at how to specify a "DocumentRoot" without apache ? how do I tell DNS where to find my app ? I may be looking at the problem wrong since I am not well aware of the backend side of things.
You should reverse proxy to port 80 (or 443 for https) to access your application with your domain name. You can use apache, nginx or haproxy etc.
Also check your firewall if port 3000 is allowed.
Check out this page; http://blog.podrezo.com/making-node-js-work-with-apache/

Solr with Jetty on LAMP server - Admin page access issue

I have Solr with its default Jetty that came with example directory installed on Linux server which has apache2 as its web server.
Now, within the same private LAN, when I open a browser and type in http://<ip-address>:8983/solr works ONLY when I do port forwarding otherwise it doesn't work. I am not sure what could be the problem? Please note this installation has been done on a remote server in a hosting environment for production deployment and I am a beginner wrt deployment stuff.
You can use the jetty.host parameter during startup to allow direct access to Jetty.
The -D option of the java command can be used with the followin syntax:
java -Djetty.host=0.0.0.0 -jar start.jar
In this way Jetty can be reached from all the hosts.
However this is not the ideal setup IMHO. I prefere to setup Jetty to listen only on localhost, implementing the client with another frontend server which listen on port 80. If you want to implement the frontend on another server you can use iptables to limit the incoming connection, dropping everything on the 8983 port if the IP is different from the one of your frontend server.
This image depicts my preferred setup for a LAMP stack includin SOLR:

redirecting from IIS to tomcat?

i have a hosting space in vps. where numerous domains are parked. my domain name is mywebsite.com it is present in c:\uname\mywebsite.com inside the folder there is default.aspx file. when I type in the url as www.mywebsite.com i can see default.aspx page. if i replace with any other page index.jsp i will get the error thrown by IIS server. so, I installed tomcat, java and deployed war file. I have even made changes in server.xml in tag specifing the host name too... how can i redirect the incoming requests to tomcat server? please guide me in it
You need to install a connector.
I would try BonCode: tomcatiis.riaforge.org
The standard way is to go to tomcat.apache.org, and download the ISAPI redirector. This communicates via AJP and you can set it up to redirect various urls to tomcat.
HTTP uses port 80 for connections by default.
One network port (in this case is TCP 80 or the http://example.com:{port}) on each IP can only being listened to by one application.
Yours is currently used by IIS. First you need to do is check what port is used by the Tomcat (refer here).
Then you should try to browse http://example.com:{port in tomcat server.xml} and see if you can view the Tomcat welcome page correctly or not, or your application.
After you verified that the tomcat is working, you can decide to change the Tomcat port number to whatever you want, make sure IIS is shutdown if you want to run it on 80.
Another option is to install Apache on port 80 as a proxy to connect the Tomcat port 8080, this will provide for security and flexibility if you need to extend your infrastructure in the future.

Can WebORB "share" a port with another site in IIS?

I'm using WebORB for .NET and I've had no problems with it running on its default port (2037) in my development environment.
When I deploy it to my staging environment and attempt to access it over the public internet, this port is blocked at many points along the way as it's an uncommon port, and I observe a red WebORB logo with the message "can not connect to messaging server" when I access the WebORB console.
Opening the port is a partial solution, but anyone accessing WebORB's applications will also need to ensure they're not blocking that port... so it's not really a proper solution.
I have managed to get WebORB running on port 443 (which is used for SSL, and therefore almost never blocked), but only if I have no other sites in IIS with a port 443 binding.
This is also unacceptable as I will eventually have another site on the same server with a port 443 binding.
So, my question is: is it possible to run WebORB on port 443 (or 80), when another site in IIS is also bound to that port?
Update following answer
I'm on Server 2008R2, and therefore IIS7.5, and I'd prefer to run my WebORB website in integrated mode. The instructions in the first article mention adding a wildcard script map for Isapi.dll - this will only be invoked in classic mode.
I've added all of the entries that the article suggests, and have configured my site to use port 80. There are other sites bound to port 80 in IIS.
When I navigate to the WebORB console, I'm observing the same behaviour I saw before adding the new RTMPT handlers - a red WebORB logo and no entries appearing in the "Messaging Server" panel. However, I do see the "Bad request, only RTMPT supported." message when navigating to ~/open/1, and my diagnostics.aspx page looks fine.
In the log I see the following:
...
WEBORB INFO:adding child scope for - \root
WEBORB INFO:scope registered - \root
WEBORB INFO:WebORB Messaging Server 4.4.0.0 (c) 2003-2010 Midnight Coders, Inc.
WEBORB INFO:is running - False
WEBORB EXCEPTION:System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions
at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at Weborb.Messaging.BaseRTMPServer.start()
WEBORB INFO:shutting down WebORB Message Server
WEBORB INFO:loading type: Weborb.Management.ServiceBrowser.Browser.AssemblyBrowser
...
Do I need to alter any other config to enable the console to use RTMPT?
Also, given that incoming requests must be over HTTP, is there no way to consider host headers?
what you are asking is whether you can route RTMP connections via port 80 or 443. Since these ports are managed by IIS, the incoming connections must be HTTP-based. Your RTMP clients can connect via port 80 or 443 by using RTMPT or RTMPS respectively. In that case, you do not need to "run WebORB on these ports", but instead configure WebORB to use RTMPT or RTMPS. Please see the following doc:
Configuring RTMPT in WebORB: http://www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/rtmpt.htm
Configuring RTMPS in WebORB:
http://www.themidnightcoders.com/fileadmin/docs/dotnet/v4/guide/rtmps_support.htm
Hope this helps.
UPDATE: If the goal is to route the management console's traffic via RTMPT, it will not work with the currently released version. The console can dynamically determine the RTMP port, but it will stick to the RTMP protocol and does not have the code to switch to RTMPT. This is something we will look into.
As for the exception you're getting, it occurs because the port you specified in Global.asax is already taken by some other process.

Resources