This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Display URL without port Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Display URL without port" Watch "Display URL without port" New topic
Author

Display URL without port

randhir sethi
Ranch Hand

Joined: Jan 27, 2009
Posts: 36
We are using both apache and tomcat in our environment. I wanted information on how to display a URL without port. In, our live environment, when we say http://reselleraccount.directonpc.com, it automatically takes it as http://reselleraccount.directonpc.com:10080. We are migrating to new server. In the new server, when I gave http://reselleraccount.directonpc.com, it displays like 'RED Hat Linux Test Page'.

I guess, I need to make some changes in our apache installation in our new server to get it to take 10080 automatically?

I hope, my question is clear.

Please, help in solving the doubt.

regards

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

randhir sethi wrote: I wanted information on how to display a URL without port.


Change tomcat default(8080) port to 80 in server.xml (windows OS)
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
The default HTTP port is 80. If no port is specified in URL, then port 80 will be used. So indeed just let your appserver listen on port 80.
Javid Jamae
Author
Ranch Hand

Joined: May 14, 2008
Posts: 198
Are you using some sort of proxying on the Apache side?


Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
Tim George
Greenhorn

Joined: Jan 09, 2009
Posts: 6
Here are a few options...

Use Tomcat standalone on port 80. You need to make sure nothing else is binding to port 80 if you do this (e.g. Apache).

Using Apache as a front-end you can use it as a proxy with mod_proxy or mod_proxy_ajp to pass through requests on port 80 to the Tomcat listening port. This requires configuration changes to Apache, and possibly installation of the modules. This is what your question implies you are looking for.

Alternatively you can use mod_jk to allow Apache to treat Tomcat as a sort of CGI handler for any content you specify. In this case you'll need to build and install a mod_jk module for your Apache installation and configure both Apache and Tomcat to use mod_jk.

There are pros and cons to each approach. The biggest issues I can think of are security, performance, and future upgrades (e.g. load balancing on multiple servers) You'll have to research these if you consider them important.

Documentation for each option is available at apache.org.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display URL without port