URL Rewrite IIS and Glassfish from port 8080 to 80 - java

I'm running a glassfish server that handles all jsp and servlets.
Now there is a way to get it working so that you can run IIS on port 80 and glassfish on port 8080, now the problem is:
When i request http://localhost/myWebApplication it should rewrite the url and use http://localhost:8080/myWebApplication
Basically I make a request to IIS, but the response I get back must be from Glassfish.
When I request the url with port 8080 it works, because its getting it from Glassfish, but i need to go through IIS to Glassfish.
Here is a website that explains it all: http://jstoup.wordpress.com/2012/04/25/how-to-integrate-glassfish-with-iis/
but I still can't get it working.
I have got no idea how my url rewrite rules must be set up.

This is James from the blog you referenced. If you haven't gotten this working you may have to enable your server farm as a proxy. If you select your web farm there should be a proxy config in the center console. All you should have to do is turn that on and you should be good to go. Let me know if you've got any problems

Related

How to redirect rest requests from localhost:8080 to different port?

I have my spring web application which I can run with tomcat. My problem is, that I need to send all requests from application to different port that my tomcat is running on. Now tomcat is running on localhost:8080 and I want to send all request from my web application to different port for example localhost:8081. Can you give me some advice or is that even possible?
Want to change Request URL from Actual Request URL (image) to this: http://localhost:8081/pa165/lecture/list
Simply document that 8081 is the port to connect to, just as you would have had to document that 8080 was the port to connect to.
If you didn't document that somewhere somehow for port 8080, how would any user/client know where to go ? Ditto if your port is any other.
Based on the correct answer of this question How to change tomcat port number
You need to:
Go to tomcat>conf folder
Edit server.xml
Search "Connector port"
Replace "8080" by your port number
Restart tomcat server.

Glassfish cannot start, port is occupied

I tried to run my war application on port 80 instead of 8080. However when I change port number of Glassfish to 80 it cannot start because apache uses that port. My website is working on that port and I want to run my application in a subdomain of my website. What should I do to get rid of 8080 port in URL?
Two applications cannot share a TCP port on different subdomains since the concept of a subdomain/domain is specific to DNS and HTTP, not TCP itself. However, you can either keep both Apache and Glassfish on alternate ports (perhaps listening on 127.0.0.1 only) and use nginx or another reverse proxy. Alternatively, you can keep Apache on port 80 and instruct it to reverse-proxy requests on the subdomain to Glassfish, or the other way around.
You can host your website on Glassfish. It has a built-in http server.
Right click on server.
Click on add server.
Add glassfish server information. Click on choose. Then click on next.
After that, the created server is available under the server tab. Right click on the created server and start the server, then, create new web application.

Running Tomcat service on same port as IIS Service

I'm trying to set up three services to run on the same port (port 80). Two of the services are hosted on IIS thus enabling bindings to use the same port. One of the three services is however hosted on a Tomcat server as it is a Java Servlet. How can i set this up so that all can be accessed through port 80?
I've tried using URL Rewrite in the IIS to forward the request to port 8080 where the Tomcat service is active but it doesn't work with other services being active on port 80.
Any other ideas?
EDIT
I have no support for URL Rewrite not working for this purpose other than my own attempts. If anyone have used it and knows it should work, please shout out as it would be an optimal solution with minimal complexity to the system!

Access webservices deployed on a local jboss server from bb simulator

I have deployed a webservice on my local jboss server which runs on port 9090. So my webservice url will be http://localhost:9090/app/Services/blah. I have written a mobile client code(for blackberry) which connects to this url to get the data. Initially the client code when run on a bb simulator threw HTTP 403 error. Found that addressing urls as localhost won't work on a bb simulator ( on a simualtor localhost refers to the MDS? ).
So I tried accessing the local jboss server using http://127.0.0.1:9090 , http://machinename:9090/, http://ipaddress:9090 and nothing works. All these urls throw HTTP 501(Service unavailable) which is weird. Can someone tell me what is wrong with this and what is the correct way to access the server?
http://machinename:9090/, http://ipaddress:9090 -> These urls are not even working when i try directly on a desktop browser. FYI, its a windows machine. Do I have to change any nw settings on my machine.?
chedine,
I am not good at bb. But, can you please ensure that your App Server is up & running? Can you access the JMX-Console screen of JBoss in your desktop browser - ie. http://a.b.c.d:9090/jmx-console or something similar. Only if the app server is up, we can dig further into this issue. Please let us know the result.

JBoss Binding IP addresses

I need some help from someone who understands JBoss Hostname Binding. I think the solution is easy, although it's complicated to explain.
I am deploying an application using JBoss (v4.2) and am having troubles configuring the application.
This application has two parts, a web site on port 8080 and web services on port 8080 using SOAP APIs.
My server sits behind a firewall, and has an alias, let's say it's called orange.mycompany.com
My problem is that I cannot get the console to connect to the web services. The website works, but I see an connection refused error connecting to the web services.
[xfire.transport.http.HttpChannel]
java.net.ConnectException: Connection
refused
There are 2 things I can control, the bind IP on Tomcat, and the URL of the web services.
If I start JBoss, and bind to the local IP address:
./run.sh -b 10.1.2.3
And I set the URL of the web services to be that same IP
url=http://10.1.2.3:8080/services
I can see the website on port 8080 from outside the firewall, but the console cannot connect to webservices.
From the server, orange, itself I cannot see the website by calling http://localhost:8080/ or http://10.1.2.3:8080 or orange.mycompany.com:8080
However, if I start JBoss and bind to 127.0.0.1:
./run.sh -b 127.0.0.1
And I set the URL of the web services to localhost
url=http://localhost:8080/services
Now I can't see the website at all from outside the firewall.
But from the server itself, I can see the website browsing http://localhost:8080 and the I can successfully connect to the web services. That's great, but I need the website to be accessible from outside.
Can anyone suggest any combination of settings that will let me browse the website and also let the console call webservices on localhost?
Never mind.
Start JBoss binding to all IP's works.
./run.sh -b 0.0.0.0
Aren't your running JIRA standalone, right?
I always run tomcat and jboss behind a apache with mod_jk. This still hide ports, what sounds great for newbies users.
Your server is behind a NAT?
Sometimes I use ProxyPass or RewriteRules (mod_rewrite) to provide external access, thru reverse proxy.

Categories