JBoss Binding IP addresses - java

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.

Related

How to access a localhost server from one computer to another on the same network

I have a spring boot application (Spring Web) which has a tomcat server embedded into it (maven dependency). The application is a server and consists of several HTTP routes. This application is on my laptop. I would like to execute the application on my laptop, and be able to RESTful calls (e.g. GET, POST etc) to the server. How can I make requests to the server from my computer?
I've checked out several tutorials and they tend to use XAMP or another similar application so not sure on how to go about this. Thank you.
Once your war is deployed on your server, you can send any REST call to it using curl, a browser, or my personal favorite for testing is Postman as it circumvents cross-domain issues.
To make the REST call simply use the IP address of the server instead of localhost. You can get the IP address of the machine using ifconfig or whatsmyip.org
http://<IP address>/...

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!

URL Rewrite IIS and Glassfish from port 8080 to 80

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

deploy java ee application to another port than 8080

Just wonder if i can deploy my java ee application in any application server for eg: glassfish, and user are able to access without typing the port number, for eg:http://abc.com
(my current application url will be http://abc.com:8080)
as from my knowledge, i might need another web server like for eg:Apache to redirect request to application server using mod_proxy module in order for me to achieve that, right?
kindly advise...
Setting up Apache to proxy requests from port 80 to your app/web server running on port 8080 is one way to eliminate the need for port numbers in your URLs. But it's certainly not the only way. You should be able to configure any J2EE application server or web server to run on port 80 instead of 8080 (a common default in J2EE app/web servers). The details of the configuration editing are app/web server specific. You may need root privileges on your system to bind to port 80.
You need to tell it to bind to port 80 instead of 8080, which is usually well documented how to since this is a common operation.
Note: Under Unix systems you need to be root to bind to port 80 - here an Apache frontend might be useful.

Categories