Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display URL without port

 
randhir sethi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using some sort of proxying on the Apache side?
 
Tim George
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic