I have a dedicated server and I have tomcat installed on it. But the only way to access tomcat is to give the port number in the URL.
For Example: http://server.mydomain.com:8080
takes me to the tomcat server.
How can I remove the port number from the URL????
As long as I was using it, this was fine but now I have generated a SOAP service and I have deployed it on axis2. Now the URL to access my service is like http://server.mydomain.com:8080/axis2/services/MyService?wsdl
which shows the port number, so how can I remove this port number??
OR is there any other way to make my service accessible without showing the port number??
Thanks
3 words: Apache Reverse Proxy
I hate dealing with Java/Tomcat idiosyncrasies like this so what I do is I reverse proxy through Apache to give Tomcat a nice/normal port 80 URL. I have a detailed answer on my approach here on Server Fault.
That way my Tomcat setup is sane & clean & Apache allows me more flexibility in front-end accessibility & control.
Not showing the port number means that it must run on port 80 (http) or 443 (https). For that you need to modify your tomcat configuration. I found this on the internet and hope it helps: http://www.mkyong.com/tomcat/how-to-change-tomcat-default-port/
Related
A Tomcat server on my server is running on port 8080.
We are in need to use the Tomcat server to get user requests and forward those to corresponding proxy server running on another server (111.111.111.111:9090, user: XXX, pw: YYY).
So: We need to configure Tomcat to transfer requests to another server.
You can't do this out of the box with Tomcat. It does not include HTTP reverse proxy functionality. You'd either need to find a 3rd-party module to do this (I'm not aware of any) or code up something yourself - e.g. using Apache HttpClient.
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.
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!
I have a application developing in Java, Strut2 and Tomcat
and is been deployed n Tomcat 6.0
the URL to access is
http://websiste:8181/webAppName/some.action
Now I am trying to change the above url to
http://website/webAppName/some.action
can you please let me know how to eliminate Port number in URL
You should run the server on port 80 which is default for http.
You need Tomcat to use port 80 instead of 8181. Port 80 is the default port used when no port is specified. See this post for details on how to change the port number.
Edit:
Since you have Apache running on port 80, you can't serve your app from Tomcat on port 80 too. One option is to use Apache's mod_proxy (can be dangerous), or the Tomcat's Apache connector to get Apache to serve /webAppName/* from Tomcat instead of from your other website's resources.
If you can change the tomcat configuration, it's a simple matter to change it to port 80. More info is available here: http://www.klawitter.de/tomcat80.html
There are two ways to eliminate it :
1) Preferred way : set the server to listen at port 80 instead of 8181 as others have already mentioned
2) Non preferred way : Change Proxy settings in your browser to hit 8181 port instead of 80 for http protocol. This will force you to explicitly use 80 port when trying to reach other web sites.
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.