redirecting from IIS to tomcat? - iis

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.

Related

TOMCAT - Forward services/DNS to other ports

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

IIS Apache and Node.JS HTTP all on the same server

I have one windows server already running sharepoint on 80/443 and the site works correctly.
We're trying to add more functionality by installing NodeJS and Apache
I've set apache to listen on 8080 and the default website comes up.
Node is running on 3000 and I can access the explorer that way as well.
My questions come from this. The server has a complete certificate chain installed on it and https://:8080 comes up correctly, but I can't get the node stuff to work on https: Secondly it appears while I have proxy pass set up correctly within my httpd.conf, either something is wrong within that as if I goto the https://:8080 /api/and anything beyond that, I get 503 errors and the page can't be displayed.
I'm unsure what I'm doing incorrectly here as from reading the documentation on proxy module, it seems that everything is setup and configured correctly.
Netstat shows listening on 3000 and 8080 and 80/443 for my SharePoint farm.
I had to configure the ssl settings for the proxypass to use the IP address of the local machine. After doing that I was able to connect correctly.
This allowed for connecting on :3000 via telnet to the localmachine and allowed for explorer to be viewed with https://:8080 the correct way enforcing our certificates.

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.

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)

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:

Resources